Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Salt shows stacktrace when master not started #66031

Open
1 of 9 tasks
twangboy opened this issue Feb 8, 2024 · 0 comments
Open
1 of 9 tasks

[BUG] Salt shows stacktrace when master not started #66031

twangboy opened this issue Feb 8, 2024 · 0 comments
Assignees
Labels
Bug broken, incorrect, or confusing behavior needs-triage

Comments

@twangboy
Copy link
Contributor

twangboy commented Feb 8, 2024

Description
Running salt commands against a master that isn't started throws an ugly stacktrace. This seems to only happen on Windows. I tested on ubuntu and there is no stacktrace.

Setup
Install Salt
Don't start the master or stop the master from running

Please be as specific as possible and give set-up details.

  • on-prem machine
  • VM (Virtualbox, KVM, etc. please specify)
  • VM running on a cloud service, please be explicit and add details
  • container (Kubernetes, Docker, containerd, etc. please specify)
  • or a combination, please be explicit
  • jails if it is FreeBSD
  • classic packaging
  • onedir packaging
  • used bootstrap to install

Steps to Reproduce the behavior
Run a salt command:

salt * test.ping

Expected behavior
No stacktrace, just a warning about the master not responding

Screenshots

(venv) PS C:\src\salt> salt * test.ping
[WARNING ] TCP Publish Client encountered an exception while connecting to 127.0.0.1:4512: TimeoutError(), will reconnect in 1 seconds -   File "C:\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,

  File "C:\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)

  File "C:\src\salt\venv\Scripts\salt.exe\__main__.py", line 7, in <module>
    sys.exit(salt_main())

  File "C:\src\salt\salt\scripts.py", line 532, in salt_main
    client.run()

  File "C:\src\salt\salt\cli\salt.py", line 192, in run
    for full_ret in cmd_func(**kwargs):

  File "C:\src\salt\salt\client\__init__.py", line 816, in cmd_cli
    self.pub_data = self.run_job(

  File "C:\src\salt\salt\client\__init__.py", line 388, in run_job
    pub_data = self.pub(

  File "C:\src\salt\salt\client\__init__.py", line 1905, in pub
    if listen and not self.event.connect_pub(timeout=timeout):

  File "C:\src\salt\salt\utils\event.py", line 323, in connect_pub
    self.subscriber = salt.utils.asynchronous.SyncWrapper(

  File "C:\src\salt\salt\utils\asynchronous.py", line 77, in __init__
    self.obj = cls(*args, **kwargs)

  File "C:\src\salt\salt\transport\base.py", line 210, in ipc_publish_client
    return publish_client(opts, io_loop, **kwargs)

  File "C:\src\salt\salt\transport\base.py", line 152, in publish_client
    return salt.transport.tcp.PublishClient(

  File "C:\src\salt\salt\transport\tcp.py", line 219, in __init__
    super().__init__(opts, io_loop, **kwargs)

  File "C:\src\salt\salt\transport\base.py", line 398, in __init__
    super().__init__()

[WARNING ] TCP Publish Client encountered an exception while connecting to 127.0.0.1:4512: TimeoutError(), will reconnect in 1 seconds -   File "C:\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,

  File "C:\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)

  File "C:\src\salt\venv\Scripts\salt.exe\__main__.py", line 7, in <module>
    sys.exit(salt_main())

  File "C:\src\salt\salt\scripts.py", line 532, in salt_main
    client.run()

  File "C:\src\salt\salt\cli\salt.py", line 192, in run
    for full_ret in cmd_func(**kwargs):

  File "C:\src\salt\salt\client\__init__.py", line 816, in cmd_cli
    self.pub_data = self.run_job(

  File "C:\src\salt\salt\client\__init__.py", line 388, in run_job
    pub_data = self.pub(

  File "C:\src\salt\salt\client\__init__.py", line 1905, in pub
    if listen and not self.event.connect_pub(timeout=timeout):

  File "C:\src\salt\salt\utils\event.py", line 323, in connect_pub
    self.subscriber = salt.utils.asynchronous.SyncWrapper(

  File "C:\src\salt\salt\utils\asynchronous.py", line 77, in __init__
    self.obj = cls(*args, **kwargs)

  File "C:\src\salt\salt\transport\base.py", line 210, in ipc_publish_client
    return publish_client(opts, io_loop, **kwargs)

  File "C:\src\salt\salt\transport\base.py", line 152, in publish_client
    return salt.transport.tcp.PublishClient(

  File "C:\src\salt\salt\transport\tcp.py", line 219, in __init__
    super().__init__(opts, io_loop, **kwargs)

  File "C:\src\salt\salt\transport\base.py", line 398, in __init__
    super().__init__()

[WARNING ] TCP Publish Client encountered an exception while connecting to 127.0.0.1:4512: TimeoutError(), will reconnect in 1 seconds -   File "C:\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,

  File "C:\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)

  File "C:\src\salt\venv\Scripts\salt.exe\__main__.py", line 7, in <module>
    sys.exit(salt_main())

  File "C:\src\salt\salt\scripts.py", line 532, in salt_main
    client.run()

  File "C:\src\salt\salt\cli\salt.py", line 192, in run
    for full_ret in cmd_func(**kwargs):

  File "C:\src\salt\salt\client\__init__.py", line 816, in cmd_cli
    self.pub_data = self.run_job(

  File "C:\src\salt\salt\client\__init__.py", line 388, in run_job
    pub_data = self.pub(

  File "C:\src\salt\salt\client\__init__.py", line 1905, in pub
    if listen and not self.event.connect_pub(timeout=timeout):

  File "C:\src\salt\salt\utils\event.py", line 323, in connect_pub
    self.subscriber = salt.utils.asynchronous.SyncWrapper(

  File "C:\src\salt\salt\utils\asynchronous.py", line 77, in __init__
    self.obj = cls(*args, **kwargs)

  File "C:\src\salt\salt\transport\base.py", line 210, in ipc_publish_client
    return publish_client(opts, io_loop, **kwargs)

  File "C:\src\salt\salt\transport\base.py", line 152, in publish_client
    return salt.transport.tcp.PublishClient(

  File "C:\src\salt\salt\transport\tcp.py", line 219, in __init__
    super().__init__(opts, io_loop, **kwargs)

  File "C:\src\salt\salt\transport\base.py", line 398, in __init__
    super().__init__()

[ERROR   ] Request client send timedout
Salt request timed out. The master is not responding. You may need to run your command with `--async` in order to bypass the congested event bus. With `--async`, the CLI tool will print the job id (jid) and exit immediately without listening for responses. You can then use `salt-run jobs.lookup_jid` to look up the results of the job in the job cache later.

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)

Head of 3007.x

Salt Version:
          Salt: 3007.0rc1+295.g9777612cfdf

Python Version:
        Python: 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]

Dependency Versions:
          cffi: 1.16.0
      cherrypy: unknown
      dateutil: 2.8.2
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 3.1.3
       libgit2: Not Installed
  looseversion: 1.3.0
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 1.0.7
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     packaging: 23.1
     pycparser: 2.21
      pycrypto: Not Installed
  pycryptodome: 3.19.1
        pygit2: Not Installed
  python-gnupg: 0.5.1
        PyYAML: 6.0.1
         PyZMQ: 25.1.1
        relenv: Not Installed
         smmap: Not Installed
       timelib: 0.3.0
       Tornado: 6.3.3
           ZMQ: 4.3.4

Salt Package Information:
  Package Type: pip

System Versions:
          dist:
        locale: utf-8
       machine: AMD64
       release: 10
        system: Windows
       version: 10 10.0.22631 SP0 Multiprocessor Free```
</details>
@twangboy twangboy added Bug broken, incorrect, or confusing behavior needs-triage labels Feb 8, 2024
@twangboy twangboy self-assigned this Feb 8, 2024
@twangboy twangboy changed the title [BUG] Salt show stacktrace when master not started [BUG] Salt shows stacktrace when master not started Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior needs-triage
Projects
None yet
Development

No branches or pull requests

1 participant