The Fix
pip install celery==4.4.0rc5
Based on closed celery/celery issue #5808 · PR/commit linked
Production note: This usually shows up under retries/timeouts. Treat it as a side-effect risk until you can verify behavior with a canary + real traffic.
@@ -1045,7 +1045,13 @@ def link(self, sig):
def link_error(self, sig):
- sig = sig.clone().set(immutable=True)
+ try:
+ sig = sig.clone().set(immutable=True)
[2019-10-31 15:35:07,882: ERROR/ForkPoolWorker-8] Task cancel[5eaedd7c-9d11-42e6-88fd-952b2526ab2a] raised unexpected: AttributeError("'dict' object has no attribute 'link'")
Traceback (most recent call last):
File "/home/[...]/python3.7/site-packages/celery/app/trace.py", line 385, in trace_task
R = retval = fun(*args, **kwargs)
File "/home/[...]/venv/lib/python3.7/site-packages/celery/app/trace.py", line 650, in __protected_call__
return self.run(*args, **kwargs)
[...]
File "/home/[...]/venv/lib/python3.7/site-packages/celery/canvas.py", line 1351, in link
self.body.link(callback)
File "/home/[...]/venv/lib/python3.7/site-packages/celery/canvas.py", line 1041, in link
return self.tasks[0].link(sig)
AttributeError: 'dict' object has no attribute 'link'
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==4.4.0rc5\nWhen NOT to use: Do not apply this fix if the signature is expected to be immutable and built correctly.\n\n
Why This Fix Works in Production
- Trigger: [2019-10-31 15:35:07,882: ERROR/ForkPoolWorker-8] Task cancel[5eaedd7c-9d11-42e6-88fd-952b2526ab2a] raised unexpected: AttributeError("'dict' object has no…
- Mechanism: Fixes an AttributeError when the signature is built with the from_dict class method.
- Why the fix works: Fixes an AttributeError when the signature is built with the from_dict class method. (first fixed release: 4.4.0rc5).
Why This Breaks in Prod
- Shows up under Python 3.7 in real deployments (not just unit tests).
- Surfaces as: [2019-10-31 15:35:07,882: ERROR/ForkPoolWorker-8] Task cancel[5eaedd7c-9d11-42e6-88fd-952b2526ab2a] raised unexpected: AttributeError("'dict' object has no attribute 'link'")
Proof / Evidence
- GitHub issue: #5808
- Fix PR: https://github.com/celery/celery/pull/5297
- First fixed release: 4.4.0rc5
- 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.34
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“so https://github.com/celery/celery/pull/5297 didn't fix it fully? can you provide fix with test?”
Failure Signature (Search String)
- [2019-10-31 15:35:07,882: ERROR/ForkPoolWorker-8] Task cancel[5eaedd7c-9d11-42e6-88fd-952b2526ab2a] raised unexpected: AttributeError("'dict' object has no attribute 'link'")
Error Message
Stack trace
Error Message
-------------
[2019-10-31 15:35:07,882: ERROR/ForkPoolWorker-8] Task cancel[5eaedd7c-9d11-42e6-88fd-952b2526ab2a] raised unexpected: AttributeError("'dict' object has no attribute 'link'")
Traceback (most recent call last):
File "/home/[...]/python3.7/site-packages/celery/app/trace.py", line 385, in trace_task
R = retval = fun(*args, **kwargs)
File "/home/[...]/venv/lib/python3.7/site-packages/celery/app/trace.py", line 650, in __protected_call__
return self.run(*args, **kwargs)
[...]
File "/home/[...]/venv/lib/python3.7/site-packages/celery/canvas.py", line 1351, in link
self.body.link(callback)
File "/home/[...]/venv/lib/python3.7/site-packages/celery/canvas.py", line 1041, in link
return self.tasks[0].link(sig)
AttributeError: 'dict' object has no attribute 'link'
Minimal Reproduction
[2019-10-31 15:35:07,882: ERROR/ForkPoolWorker-8] Task cancel[5eaedd7c-9d11-42e6-88fd-952b2526ab2a] raised unexpected: AttributeError("'dict' object has no attribute 'link'")
Traceback (most recent call last):
File "/home/[...]/python3.7/site-packages/celery/app/trace.py", line 385, in trace_task
R = retval = fun(*args, **kwargs)
File "/home/[...]/venv/lib/python3.7/site-packages/celery/app/trace.py", line 650, in __protected_call__
return self.run(*args, **kwargs)
[...]
File "/home/[...]/venv/lib/python3.7/site-packages/celery/canvas.py", line 1351, in link
self.body.link(callback)
File "/home/[...]/venv/lib/python3.7/site-packages/celery/canvas.py", line 1041, in link
return self.tasks[0].link(sig)
AttributeError: 'dict' object has no attribute 'link'
Environment
- Python: 3.7
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install celery==4.4.0rc5
Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.
Fix reference: https://github.com/celery/celery/pull/5297
First fixed release: 4.4.0rc5
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- Do not apply this fix if the signature is expected to be immutable and built correctly.
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 |
|---|---|
| 4.4.0rc5 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.