Skip to content

[Bug]: Ctrl+C throws stacktrace on state.event #70176

Open

Description

@twangboy

What happened?

running salt-run state.event pretty=True throws a stacktrace when you hit Ctrl+C.

Exception occurred in runner state.event: Traceback (most recent call last):
  File "/home/shane/src/salt/salt/utils/asynchronous.py", line 245, in wrap
    asyncio.get_running_loop()
RuntimeError: no running event loop

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/shane/src/salt/salt/client/mixins.py", line 387, in low
    data["return"] = func(*args, **kwargs)
                     ^^^^^^^^^^^^^^^^^^^^^
  File "/home/shane/src/salt/salt/loader/lazy.py", line 177, in __call__
    ret = self.loader.run(run_func, *args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/shane/src/salt/salt/loader/lazy.py", line 1480, in run
    return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/shane/src/salt/salt/loader/lazy.py", line 1495, in _run_as
    ret = _func_or_method(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/shane/src/salt/salt/runners/state.py", line 442, in event
    return statemod["state.event"](
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/shane/src/salt/salt/loader/lazy.py", line 177, in __call__
    ret = self.loader.run(run_func, *args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/shane/src/salt/salt/loader/lazy.py", line 1480, in run
    return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/shane/src/salt/salt/loader/lazy.py", line 1495, in _run_as
    ret = _func_or_method(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/shane/src/salt/salt/modules/state.py", line 2889, in event
    ret = sevent.get_event(full=True, auto_reconnect=True)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/shane/src/salt/salt/utils/event.py", line 837, in get_event
    ret = self._get_event(wait, tag, match_func, no_block)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/shane/src/salt/salt/utils/event.py", line 725, in _get_event
    raw = self.subscriber.recv(timeout=wait)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/shane/src/salt/salt/utils/asynchronous.py", line 252, in wrap
    return self.io_loop.run_sync(
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/shane/src/venv_3008.x/lib/python3.11/site-packages/tornado/ioloop.py", line 536, in run_sync
    self.start()
  File "/home/shane/src/venv_3008.x/lib/python3.11/site-packages/tornado/platform/asyncio.py", line 211, in start
    self.asyncio_loop.run_forever()
  File "/home/shane/.pyenv/versions/3.11.14/lib/python3.11/asyncio/base_events.py", line 608, in run_forever
    self._run_once()
  File "/home/shane/.pyenv/versions/3.11.14/lib/python3.11/asyncio/base_events.py", line 1898, in _run_once
    event_list = self._selector.select(timeout)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/shane/.pyenv/versions/3.11.14/lib/python3.11/selectors.py", line 468, in select
    fd_event_list = self._selector.poll(timeout, max_ev)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/shane/src/salt/salt/scripts.py", line 77, in _handle_signals
    sys.exit(salt.defaults.exitcodes.EX_OK)
SystemExit: 0

Type of salt install

Official deb

Major version

3008.x

What supported OS are you seeing the problem on? Can select multiple. (If bug appears on an unsupported OS, please open a GitHub Discussion instead)

ubuntu-24.04

salt --versions-report output

head of 3008.x branch (3008.2+393.g4ae4bf944f)

Activity

  1. changed the title [-][Bug]: Ctrl+C throws stacktrace on state.even[/-] [+][Bug]: Ctrl+C throws stacktrace on state.event[/+] on Aug 28, 2026
  2. self-assigned this
    on Aug 28, 2026
  3. added this to the Argon v3008.3 milestone on Aug 28, 2026
  4. added a commit that references this issue on Oct 21, 2026
    5cd7008
  5. added
    severity-low4th level, cosemtic problems, work around exists
    on Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugbroken, incorrect, or confusing behaviorseverity-low4th level, cosemtic problems, work around exists

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions