You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running arq with Python 3.14, the worker fails to start with a RuntimeError due to the deprecated asyncio.get_event_loop() behavior that is now enforced in Python 3.14.
Environment
arq version: 0.26.3
Python version: 3.14.2
OS: Linux (Docker container with python:3.14-slim)
Error
Traceback (most recent call last):
File "/app/.venv/bin/arq", line 10, in <module>
sys.exit(cli())
~~~^^
File "/app/.venv/lib/python3.14/site-packages/click/core.py", line 1485, in __call__
return self.main(*args, **kwargs)
~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.14/site-packages/click/core.py", line 1406, in main
rv = self.invoke(ctx)
File "/app/.venv/lib/python3.14/site-packages/click/core.py", line 1269, in invoke
return ctx.invoke(self.callback, **ctx.params)
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.14/site-packages/click/core.py", line 824, in invoke
return callback(*args, **kwargs)
File "/app/.venv/lib/python3.14/site-packages/arq/cli.py", line 54, in cli
run_worker(worker_settings_, **kwargs)
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.14/site-packages/arq/worker.py", line 893, in run_worker
worker = create_worker(settings_cls, **kwargs)
File "/app/.venv/lib/python3.14/site-packages/arq/worker.py", line 889, in create_worker
return Worker(**{**get_kwargs(settings_cls), **kwargs})
File "/app/.venv/lib/python3.14/site-packages/arq/worker.py", line 269, in __init__
self.loop = asyncio.get_event_loop()
~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.14/asyncio/events.py", line 715, in get_event_loop
raise RuntimeError('There is no current event loop in thread %r.'
% threading.current_thread().name)
RuntimeError: There is no current event loop in thread 'MainThread'.
Root Cause
In Python 3.14, asyncio.get_event_loop() now raises a RuntimeError when called from a thread without a running event loop. This behavior was deprecated since Python 3.10 and is now enforced.
This appears to be resolved in the current release. PR #522 was merged into v0.28.0 and changed Worker.__init__() to handle asyncio.get_event_loop() raising RuntimeError by creating and setting a new event loop; it also added Python 3.14 to the CI matrix. Since the reproduction above used v0.26.3, upgrading to v0.28.0 should include the fix.
Activity
feat(worker): TaskIQ worker skeleton + /health + /ready probes [RUS-71]
feat(worker): TaskIQ worker skeleton + /health + /ready probes [RUS-71](
Mirochill commentedon May 23, 2026
This appears to be resolved in the current release. PR #522 was merged into
v0.28.0and changedWorker.__init__()to handleasyncio.get_event_loop()raisingRuntimeErrorby creating and setting a new event loop; it also added Python 3.14 to the CI matrix. Since the reproduction above usedv0.26.3, upgrading tov0.28.0should include the fix.