The Fix
pip install celery==5.5.0
Based on closed celery/celery issue #9140 · PR/commit linked
@@ -1,5 +1,5 @@
@@ -1,5 +1,5 @@
[bumpversion]
-current_version = 5.5.0rc5
+current_version = 5.5.0
commit = True
from celery_app import app
import time
@app.task(bind=True)
def long_running_task(self):
try:
for i in range(100):
print(f'Working on {i}...')
except Exception as e:
return str(e)
return 'Task completed'
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
Option A — Upgrade to fixed release\npip install celery==5.5.0\nWhen NOT to use: This fix should not be used if the release process is not ready.\n\nOption C — Workaround\nfor this issue? https://github.com/celery/celery/discussions/7276#discussion-3851077\nWhen NOT to use: This fix should not be used if the release process is not ready.\n\n
Why This Fix Works in Production
- Trigger: [2024-10-09 22:02:56,726: ERROR/MainProcess] pidbox command error: AttributeError("'gevent._gevent_cgreenlet.Greenlet' object has no attribute 'terminate'")
- Mechanism: Prepared for the release of Celery v5.5.0, including updates to the changelog and version bump.
- Why the fix works: Prepared for the release of Celery v5.5.0, including updates to the changelog and version bump. (first fixed release: 5.5.0).
Why This Breaks in Prod
- Shows up under Python 3.8 in real deployments (not just unit tests).
- Surfaces as: [2024-10-09 22:02:56,726: ERROR/MainProcess] pidbox command error: AttributeError("'gevent._gevent_cgreenlet.Greenlet' object has no attribute 'terminate'")
Proof / Evidence
- GitHub issue: #9140
- Fix PR: https://github.com/celery/celery/pull/9644
- First fixed release: 5.5.0
- Reproduced locally: No (not executed)
- Last verified: 2026-02-09
- Confidence: 0.85
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.18
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“> Celery v5.5.0b1 released. Celery v5.5.0b2 released.”
“Celery v5.5.0b4 will be released this week. RC -> Final will be done during October. The due date for Python 3.8/3.13 is the 1st of…”
“> The release will be postponed to next year so I can also rest and recharge during the upcoming holidays”
“I also want to apologize for the very long release process”
Failure Signature (Search String)
- [2024-10-09 22:02:56,726: ERROR/MainProcess] pidbox command error: AttributeError("'gevent._gevent_cgreenlet.Greenlet' object has no attribute 'terminate'")
Error Message
Stack trace
Error Message
-------------
[2024-10-09 22:02:56,726: ERROR/MainProcess] pidbox command error: AttributeError("'gevent._gevent_cgreenlet.Greenlet' object has no attribute 'terminate'")
Traceback (most recent call last):
File "/home/savvym/venv/lib/python3.12/site-packages/kombu/pidbox.py", line 102, in dispatch
reply = handle(method, arguments)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/savvym/venv/lib/python3.12/site-packages/kombu/pidbox.py", line 124, in handle_cast
return self.handle(method, arguments)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/savvym/venv/lib/python3.12/site-packages/kombu/pidbox.py", line 118, in handle
return self.handlers[method](self.state, **arguments)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/savvym/venv/lib/python3.12/site-packages/celery/worker/control.py", line 149, in revoke
task_ids = _revoke(state, task_ids, terminate, signal, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/savvym/venv/lib/python3.12/site-packages/celery/worker/control.py", line 224, in _revoke
request.terminate(state.consumer.pool, signal=signum)
File "/home/savvym/venv/lib/python3.12/site-packages/celery/worker/request.py", line 423, in terminate
obj.terminate(signal)
^^^^^^^^^^^^^
AttributeError: 'gevent._gevent_cgreenlet.Greenlet' object has no attribute 'terminate'
Stack trace
Error Message
-------------
Traceback (most recent call last):
File \"/opt/webapp/api/.venv/lib/python3.11/site-packages/celery/worker/consumer/consumer.py\", line 340, in start
blueprint.start(self)
File \"/opt/webapp/api/.venv/lib/python3.11/site-packages/celery/bootsteps.py\", line 116, in start
step.start(parent)
File \"/opt/webapp/api/.venv/lib/python3.11/site-packages/celery/worker/consumer/consumer.py\", line 759, in start
c.loop(*c.loop_args())
File \"/opt/webapp/api/.venv/lib/python3.11/site-packages/celery/worker/loops.py\", line 97, in asynloop
next(loop)
File \"/opt/webapp/api/.venv/lib/python3.11/site-packages/kombu/asynchronous/hub.py\", line 308, in create_loop
poll_timeout = fire_timers(propagate=propagate) if scheduled else 1
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File \"/opt/webapp/api/.venv/lib/python3.11/site-packages/kombu/asynchronous/hub.py\", line 149, in fire_timers
entry()
File \"/opt/webapp/api/.venv/lib/python3.11/site-packages/kombu/asynchronous/timer.py\", line 70, in __call__
return self.fun(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File \"/opt/webapp/api/.venv/lib/python3.11/site-packages/kombu/asynchronous/timer.py\", line 137, in _reschedules
return fun(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^
File \"/opt/webapp/api/.venv/lib/python3.11/site-packages/kombu/transport/redi
... (truncated) ...
Stack trace
Error Message
-------------
Traceback (most recent call last):
File \"/usr/python39/lib/python3.9/site-packages/celery/worker/worker.py\", line 203, in start
self.blueprint.start(self)
File \"/usr/python39/lib/python3.9/site-packages/celery/bootsteps.py\", line 116, in start
step.start(parent)
File \"/usr/python39/lib/python3.9/site-packages/celery/bootsteps.py\", line 365, in start
return self.obj.start()
File \"/usr/python39/lib/python3.9/site-packages/celery/worker/consumer/consumer.py\", line 341, in start
blueprint.start(self)
File \"/usr/python39/lib/python3.9/site-packages/celery/bootsteps.py\", line 116, in start
step.start(parent)
File \"/usr/python39/lib/python3.9/site-packages/celery/worker/consumer/delayed_delivery.py\", line 34, in start
bind_queue_to_native_delayed_delivery_exchange(connection, queue)
File \"/usr/python39/lib/python3.9/site-packages/kombu/transport/native_delayed_delivery.py\", line 94, in bind_queue_to_native_delayed_delivery_exchange
queue.bind_to(exchange.name, routing_key=routing_key)
File \"/usr/python39/lib/python3.9/site-packages/kombu/entity.py\", line 681, in bind_to
return (channel or self.channel).queue_bind(
File \"/usr/python39/lib/python3.9/site-packages/amqp/channel.py\", line 939, in queue_bind
return self.send_method(
File \"/usr/python39/lib/python3.9/site-packages/amqp/abstract_channel.py\", line 79,
... (truncated) ...
Minimal Reproduction
from celery_app import app
import time
@app.task(bind=True)
def long_running_task(self):
try:
for i in range(100):
print(f'Working on {i}...')
except Exception as e:
return str(e)
return 'Task completed'
Environment
- Python: 3.8
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install celery==5.5.0
Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.
Option C — Workaround Temporary workaround
for this issue? https://github.com/celery/celery/discussions/7276#discussion-3851077
Use only if you cannot change versions today. Treat this as a stopgap and remove once upgraded.
Fix reference: https://github.com/celery/celery/pull/9644
First fixed release: 5.5.0
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- This fix should not be used if the release process is not ready.
Verify Fix
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
Did This Fix Work in Your Case?
Quick signal helps us prioritize which fixes to verify and improve.
Prevention
- Capture the exact failing error string in logs and tests so you can reproduce via a minimal script.
- Pin production dependencies and upgrade only with a reproducible test that hits the failing path.
Version Compatibility Table
| Version | Status |
|---|---|
| 5.5.0 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.