The Fix
pip install celery==5.3.0b2
Based on closed celery/celery issue #5958 · 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.
@@ -916,6 +916,10 @@ def __or__(self, other):
# If the chain is empty, return the group
return other
+ if isinstance(tasks[-1], chord):
+ # CHAIN [last item is chord] | GROUP -> chain with chord body.
+ tasks[-1].body = tasks[-1].body | other
software -> celery:4.4.0 (cliffs) kombu:4.6.7 py:3.6.9
billiard:3.6.1.0 py-amqp:2.5.2
platform -> system:Linux arch:64bit, ELF
kernel version:4.15.0-76-generic imp:CPython
loader -> celery.loaders.default.Loader
settings -> transport:amqp results:disabled
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.3.0b2\nWhen NOT to use: Do not use this fix if your workflow relies on the previous behavior of task execution.\n\nOption C — Workaround\nadd dummy task after group (than it is converted into chord correctly)\nWhen NOT to use: Do not use this fix if your workflow relies on the previous behavior of task execution.\n\n
Why This Fix Works in Production
- Trigger: * [x] I have included all related issues and possible duplicate issues
- Mechanism: A bug caused tasks to execute before the group/chord was fully defined
- Why the fix works: Fixed a bug when chaining a chord with a group, ensuring that tasks execute correctly without duplication. (first fixed release: 5.3.0b2).
- If left unfixed, the same config can fail only in production (env differences), causing startup failures or partial feature outages.
Why This Breaks in Prod
- Shows up under Python 3.6 in real deployments (not just unit tests).
- A bug caused tasks to execute before the group/chord was fully defined
- Production symptom (often without a traceback): * [x] I have included all related issues and possible duplicate issues
Proof / Evidence
- GitHub issue: #5958
- Fix PR: https://github.com/celery/celery/pull/7919
- First fixed release: 5.3.0b2
- Reproduced locally: No (not executed)
- Last verified: 2026-02-09
- Confidence: 0.95
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.61
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“Unsure but there is a bug around group/chord such that for long canvas the tasks may start before the group/chord has been fully defined. I…”
“I could quite easily run my testcase from the google groups post but I'm not sure if that's the kind of test you need”
“Checking the result from task.delay() i see the correct tree. An AsyncResult with 1 result, a parent to a GroupResult: 3 and this parent with…”
“Tryed this: !aa and this: !aa2 With same results launched with tasks = chain(*tasks).delay() BUT this: works fine.”
Failure Signature (Search String)
- * [x] I have included all related issues and possible duplicate issues
- Please include a backtrace and surround it with triple backticks (```).
Copy-friendly signature
Failure Signature
-----------------
* [x] I have included all related issues and possible duplicate issues
Please include a backtrace and surround it with triple backticks (```).
Error Message
Signature-only (no traceback captured)
Error Message
-------------
* [x] I have included all related issues and possible duplicate issues
Please include a backtrace and surround it with triple backticks (```).
Minimal Reproduction
software -> celery:4.4.0 (cliffs) kombu:4.6.7 py:3.6.9
billiard:3.6.1.0 py-amqp:2.5.2
platform -> system:Linux arch:64bit, ELF
kernel version:4.15.0-76-generic imp:CPython
loader -> celery.loaders.default.Loader
settings -> transport:amqp results:disabled
Environment
- Python: 3.6
What Broke
Tasks executed multiple times instead of once, leading to incorrect results.
Why It Broke
A bug caused tasks to execute before the group/chord was fully defined
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install celery==5.3.0b2
Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.
Option C — Workaround Temporary workaround
add dummy task after group (than it is converted into chord correctly)
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/7919
First fixed release: 5.3.0b2
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- Do not use this fix if your workflow relies on the previous behavior of task execution.
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.3.0b2 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.