saltstack / saltstack/salt

[BUG] TypeError in transport/tcp.py

Open
#66,435 15 comments 0 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Description
Issue in SaltStack master 3007.0.

On FreeBSD, upgraded to 3007.0, it complained it needs Tornado. I Installed Tornado 6.3.3, the master started, but then any command results in this:

root@freebsd:/usr/local/etc/salt # salt '*' test.ping
[WARNING ] TCP Publish Client encountered an exception while connecting to /var/run/salt/master/master_event_pub.ipc: StreamClosedError('Stream is closed'), will reconnect in 1 seconds -   File "/usr/local/bin/salt", line 33, in <module>
    sys.exit(load_entry_point('salt==3007.0', 'console_scripts', 'salt')())

  File "/usr/local/lib/python3.9/site-packages/salt/scripts.py", line 532, in salt_main
    client.run()

  File "/usr/local/lib/python3.9/site-packages/salt/cli/salt.py", line 192, in run
    for full_ret in cmd_func(**kwargs):

  File "/usr/local/lib/python3.9/site-packages/salt/client/__init__.py", line 816, in cmd_cli
    self.pub_data = self.run_job(

  File "/usr/local/lib/python3.9/site-packages/salt/client/__init__.py", line 388, in run_job
    pub_data = self.pub(

  File "/usr/local/lib/python3.9/site-packages/salt/client/__init__.py", line 1905, in pub
    if listen and not self.event.connect_pub(timeout=timeout):

  File "/usr/local/lib/python3.9/site-packages/salt/utils/event.py", line 323, in connect_pub
    self.subscriber = salt.utils.asynchronous.SyncWrapper(

  File "/usr/local/lib/python3.9/site-packages/salt/utils/asynchronous.py", line 77, in __init__
    self.obj = cls(*args, **kwargs)

  File "/usr/local/lib/python3.9/site-packages/salt/transport/base.py", line 210, in ipc_publish_client
    return publish_client(opts, io_loop, **kwargs)

  File "/usr/local/lib/python3.9/site-packages/salt/transport/base.py", line 152, in publish_client
    return salt.transport.tcp.PublishClient(

  File "/usr/local/lib/python3.9/site-packages/salt/transport/tcp.py", line 219, in __init__
    super().__init__(opts, io_loop, **kwargs)

  File "/usr/local/lib/python3.9/site-packages/salt/transport/base.py", line 398, in __init__
    super().__init__()

[ERROR   ] An un-handled exception was caught by Salt's global exception handler:
TypeError: argument must be an int, or have a fileno() method.
Traceback (most recent call last):
  File "/usr/local/bin/salt", line 33, in <module>
    sys.exit(load_entry_point('salt==3007.0', 'console_scripts', 'salt')())
  File "/usr/local/lib/python3.9/site-packages/salt/scripts.py", line 532, in salt_main
    client.run()
  File "/usr/local/lib/python3.9/site-packages/salt/cli/salt.py", line 192, in run
    for full_ret in cmd_func(**kwargs):
  File "/usr/local/lib/python3.9/site-packages/salt/client/__init__.py", line 831, in cmd_cli
    for fn_ret in self.get_cli_event_returns(
  File "/usr/local/lib/python3.9/site-packages/salt/client/__init__.py", line 1654, in get_cli_event_returns
    for ret in self.get_iter_returns(
  File "/usr/local/lib/python3.9/site-packages/salt/client/__init__.py", line 1188, in get_iter_returns
    for raw in ret_iter:
  File "/usr/local/lib/python3.9/site-packages/salt/client/__init__.py", line 1105, in get_returns_no_block
    raw = self.event.get_event(
  File "/usr/local/lib/python3.9/site-packages/salt/utils/event.py", line 651, in get_event
    ret = self._get_event(wait, tag, match_func, no_block)
  File "/usr/local/lib/python3.9/site-packages/salt/utils/event.py", line 553, in _get_event
    raw = self.subscriber.recv(timeout=wait)
  File "/usr/local/lib/python3.9/site-packages/salt/utils/asynchronous.py", line 139, in wrap
    raise exc_info[1].with_traceback(exc_info[2])
  File "/usr/local/lib/python3.9/site-packages/salt/utils/asynchronous.py", line 147, in _target
    result = io_loop.run_sync(lambda: getattr(self.obj, key)(*args, **kwargs))
  File "/usr/local/lib/python3.9/site-packages/tornado/ioloop.py", line 527, in run_sync
    return future_cell[0].result()
  File "/usr/local/lib/python3.9/site-packages/salt/transport/tcp.py", line 374, in recv
    events, _, _ = select.select([self._stream.socket], [], [], 0)
TypeError: argument must be an int, or have a fileno() method.
Traceback (most recent call last):
  File "/usr/local/bin/salt", line 33, in <module>
    sys.exit(load_entry_point('salt==3007.0', 'console_scripts', 'salt')())
  File "/usr/local/lib/python3.9/site-packages/salt/scripts.py", line 532, in salt_main
    client.run()
  File "/usr/local/lib/python3.9/site-packages/salt/cli/salt.py", line 192, in run
    for full_ret in cmd_func(**kwargs):
  File "/usr/local/lib/python3.9/site-packages/salt/client/__init__.py", line 831, in cmd_cli
    for fn_ret in self.get_cli_event_returns(
  File "/usr/local/lib/python3.9/site-packages/salt/client/__init__.py", line 1654, in get_cli_event_returns
    for ret in self.get_iter_returns(
  File "/usr/local/lib/python3.9/site-packages/salt/client/__init__.py", line 1188, in get_iter_returns
    for raw in ret_iter:
  File "/usr/local/lib/python3.9/site-packages/salt/client/__init__.py", line 1105, in get_returns_no_block
    raw = self.event.get_event(
  File "/usr/local/lib/python3.9/site-packages/salt/utils/event.py", line 651, in get_event
    ret = self._get_event(wait, tag, match_func, no_block)
  File "/usr/local/lib/python3.9/site-packages/salt/utils/event.py", line 553, in _get_event
    raw = self.subscriber.recv(timeout=wait)
  File "/usr/local/lib/python3.9/site-packages/salt/utils/asynchronous.py", line 139, in wrap
    raise exc_info[1].with_traceback(exc_info[2])
  File "/usr/local/lib/python3.9/site-packages/salt/utils/asynchronous.py", line 147, in _target
    result = io_loop.run_sync(lambda: getattr(self.obj, key)(*args, **kwargs))
  File "/usr/local/lib/python3.9/site-packages/tornado/ioloop.py", line 527, in run_sync
    return future_cell[0].result()
  File "/usr/local/lib/python3.9/site-packages/salt/transport/tcp.py", line 374, in recv
    events, _, _ = select.select([self._stream.socket], [], [], 0)
TypeError: argument must be an int, or have a fileno() method.

Also see this bug report on FreeBSD Bugzilla: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=278149

I also installed Salt on a new machine and it behaves the same way.

Setup

  • VM running on a cloud service, please be explicit and add details

FreeBSD running on AWS. No jails.

Steps to Reproduce the behavior
Install py39-salt on a fresh FreeBSD 14, install py39-tornado, start salt-master, then try to run any command.

Expected behavior
Run the command, don't error out

Screenshots
N/A, trace above

Versions Report
I killed the machine, sorry, but it's 3007.0.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.