Jump to solution
Verify

The Fix

pip install celery==4.4.0rc5

Based on closed celery/celery issue #5714 · PR/commit linked

Jump to Verify Open PR/Commit
@@ -132,7 +132,7 @@ def _update_result(self, task, result, state, traceback=None, task.traceback = traceback if self.app.conf.find_value_for_key('extended', 'result'): - task.name = getattr(request, 'task_name', None) + task.name = getattr(request, 'task', None) task.args = ensure_bytes(
repro.py
def _update_result(self, task, result, state, traceback=None, request=None): task.result = result task.status = state task.traceback = traceback if self.app.conf.find_value_for_key('extended', 'result'): - task.name = getattr(request, 'task_name', None) + task.name = getattr(request, 'task', None) task.args = ensure_bytes( self.encode(getattr(request, 'args', None)) ) task.kwargs = ensure_bytes( self.encode(getattr(request, 'kwargs', None)) ) task.worker = getattr(request, 'hostname', None) task.retries = getattr(request, 'retries', None) task.queue = ( request.delivery_info.get("routing_key") if hasattr(request, "delivery_info") and request.delivery_info else None )
verify
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
fix.md
Option A — Upgrade to fixed release\npip install celery==4.4.0rc5\nWhen NOT to use: Do not apply this fix if using a backend other than MySQL.\n\n

Why This Fix Works in Production

  • Trigger: DatabaseBackend._update_result() have an error property.
  • Mechanism: The task name was incorrectly referenced as 'task_name' instead of 'task'
  • Why the fix works: Corrects the attribute name for the task name in the database backend, resolving issue #5714 where None was stored instead of the actual task name. (first fixed release: 4.4.0rc5).
Production impact:
  • If left unfixed, this can cause silent data inconsistencies that propagate (bad cache entries, incorrect downstream decisions).

Why This Breaks in Prod

  • Shows up under Python 3.7 in real deployments (not just unit tests).
  • The task name was incorrectly referenced as 'task_name' instead of 'task'
  • Production symptom (often without a traceback): DatabaseBackend._update_result() have an error property.

Proof / Evidence

  • GitHub issue: #5714
  • Fix PR: https://github.com/celery/celery/pull/5752
  • 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.43

Discussion

High-signal excerpts from the issue thread (symptoms, repros, edge-cases).

“python 3.7 celery 4.4.0rc3 The result has an error value NULL for the name in my backend(mysql), but it's work well when I use redis as my backend. After I change this error in backends/database/__init__.py [135], alter 'task_name' to 'task”
Issue thread · issue description · source

Failure Signature (Search String)

  • DatabaseBackend._update_result() have an error property.
  • The result has an error value NULL for the name in my backend(mysql), but it's work well when I use redis as my backend.
Copy-friendly signature
signature.txt
Failure Signature ----------------- DatabaseBackend._update_result() have an error property. The result has an error value NULL for the name in my backend(mysql), but it's work well when I use redis as my backend.

Error Message

Signature-only (no traceback captured)
error.txt
Error Message ------------- DatabaseBackend._update_result() have an error property. The result has an error value NULL for the name in my backend(mysql), but it's work well when I use redis as my backend.

Minimal Reproduction

repro.py
def _update_result(self, task, result, state, traceback=None, request=None): task.result = result task.status = state task.traceback = traceback if self.app.conf.find_value_for_key('extended', 'result'): - task.name = getattr(request, 'task_name', None) + task.name = getattr(request, 'task', None) task.args = ensure_bytes( self.encode(getattr(request, 'args', None)) ) task.kwargs = ensure_bytes( self.encode(getattr(request, 'kwargs', None)) ) task.worker = getattr(request, 'hostname', None) task.retries = getattr(request, 'retries', None) task.queue = ( request.delivery_info.get("routing_key") if hasattr(request, "delivery_info") and request.delivery_info else None )

Environment

  • Python: 3.7

What Broke

The result stored in the database backend was NULL for the task name.

Why It Broke

The task name was incorrectly referenced as 'task_name' instead of 'task'

Fix Options (Details)

Option A — Upgrade to fixed release Safe default (recommended)

pip install celery==4.4.0rc5

When NOT to use: Do not apply this fix if using a backend other than MySQL.

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/5752

First fixed release: 4.4.0rc5

Last verified: 2026-02-09. Validate in your environment.

Get updates

We publish verified fixes weekly. No spam.

Subscribe

When NOT to Use This Fix

  • Do not apply this fix if using a backend other than MySQL.

Verify Fix

verify
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

VersionStatus
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.