The Fix
pip install celery==4.4.0rc5
Based on closed celery/celery issue #4309 · PR/commit linked
@@ -180,6 +180,7 @@ def __repr__(self):
),
persistent=Option(None, type='bool'),
+ extended=Option(False, type='bool'),
serializer=Option('json'),
backend_transport_options=Option({}, type='dict'),
from datetime import datetime
from celery import Celery
from celery.backends.redis import RedisBackend
from celery.result import AsyncResult
from kombu.utils.encoding import bytes_to_str
from kombu.utils.objects import cached_property
from tzlocal import get_localzone
class ExtendedCelery(Celery):
@cached_property
def AsyncResult(self): # noqa: N802
"""
Override the default result class of Celery
"""
return self.subclass_with_self('path.to.your.module:ExtendedAsyncResult')
class ExtendedRedisBackend(RedisBackend):
def _store_result(self, task_id, result, state,
traceback=None, request=None, **kwargs):
if state in self.READY_STATES:
date_done = datetime.now(get_localzone()).isoformat()
else:
date_done = None
meta = {
'status': state,
'result': result,
'traceback': traceback,
'children': self.current_task_children(request),
'task_id': bytes_to_str(task_id),
'task': request.task,
'date_done': date_done,
}
self.set(self.get_key_for_task(task_id), self.encode(meta))
return result
class ExtendedAsyncResult(AsyncResult):
@property
def task(self):
return self._get_task_meta().get('task')
@property
def date_done(self):
return self._get_task_meta().get('date_done')
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: This fix is not suitable if minimal metadata is desired for performance reasons.\n\n
Why This Fix Works in Production
- Trigger: 'traceback': traceback,
- Mechanism: The results backend does not store sufficient metadata about task execution
- Why the fix works: Extends AsyncResult and Backend to store additional properties of task execution in the results backend. (first fixed release: 4.4.0rc5).
- If left unfixed, this can cause silent data inconsistencies that propagate (bad cache entries, incorrect downstream decisions).
Why This Breaks in Prod
- The results backend does not store sufficient metadata about task execution
- Production symptom (often without a traceback): 'traceback': traceback,
Proof / Evidence
- GitHub issue: #4309
- Fix PR: https://github.com/celery/celery/pull/4490
- First fixed release: 4.4.0rc5
- Reproduced locally: No (not executed)
- Last verified: 2026-02-09
- Confidence: 0.70
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.36
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“We subclassed some Celery classes to have more info in our redis result backend. More particularly the name of the task and when it finished.…”
“Other than a bit of backend storage space, is there a good reason NOT to include all the task "event" metadata by default? The thing…”
“is it issue of celery or flower? or both?”
“@auvipy This issue is specifically for celery”
Failure Signature (Search String)
- 'traceback': traceback,
- Are there any comments on generally changing celery to store the same metadata that it sends out in events?
Copy-friendly signature
Failure Signature
-----------------
'traceback': traceback,
Are there any comments on generally changing celery to store the same metadata that it sends out in events?
Error Message
Signature-only (no traceback captured)
Error Message
-------------
'traceback': traceback,
Are there any comments on generally changing celery to store the same metadata that it sends out in events?
Minimal Reproduction
from datetime import datetime
from celery import Celery
from celery.backends.redis import RedisBackend
from celery.result import AsyncResult
from kombu.utils.encoding import bytes_to_str
from kombu.utils.objects import cached_property
from tzlocal import get_localzone
class ExtendedCelery(Celery):
@cached_property
def AsyncResult(self): # noqa: N802
"""
Override the default result class of Celery
"""
return self.subclass_with_self('path.to.your.module:ExtendedAsyncResult')
class ExtendedRedisBackend(RedisBackend):
def _store_result(self, task_id, result, state,
traceback=None, request=None, **kwargs):
if state in self.READY_STATES:
date_done = datetime.now(get_localzone()).isoformat()
else:
date_done = None
meta = {
'status': state,
'result': result,
'traceback': traceback,
'children': self.current_task_children(request),
'task_id': bytes_to_str(task_id),
'task': request.task,
'date_done': date_done,
}
self.set(self.get_key_for_task(task_id), self.encode(meta))
return result
class ExtendedAsyncResult(AsyncResult):
@property
def task(self):
return self._get_task_meta().get('task')
@property
def date_done(self):
return self._get_task_meta().get('date_done')
What Broke
Inconsistent task state information leads to unreliable task tracking in Flower.
Why It Broke
The results backend does not store sufficient metadata about task execution
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/4490
First fixed release: 4.4.0rc5
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- This fix is not suitable if minimal metadata is desired for performance reasons.
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.