Jump to solution
Verify

The Fix

pip install celery==4.4.0rc5

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

Production note: Most teams hit this during upgrades or environment changes. Roll out with a canary and smoke critical endpoints (health, OpenAPI/docs) before 100%.

Jump to Verify Open PR/Commit
@@ -319,6 +319,10 @@ def tick(self, event_t=event_t, min=min, heappop=heapq.heappop, def schedules_equal(self, old_schedules, new_schedules): + if old_schedules is new_schedules is None: + return True + if old_schedules is None or new_schedules is None:
repro.py
def schedules_equal(self, old_schedules, new_schedules): if set(old_schedules.keys()) != set(new_schedules.keys()): return False for name, old_entry in old_schedules.items(): new_entry = new_schedules.get(name) if not new_entry: return False return True
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: This fix is not applicable if the logic for handling None schedules is intentionally designed.\n\n

Why This Fix Works in Production

  • Trigger: Error `AttributeError 'NoneType' object has no attribute 'keys'`
  • Mechanism: The schedules_equal function did not handle the case where old_schedules is None
  • Why the fix works: Handles the case where old_schedules can be None to prevent an AttributeError in the schedules_equal function. (first fixed release: 4.4.0rc5).
Production impact:
  • 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

  • The schedules_equal function did not handle the case where old_schedules is None
  • Surfaces as: Error `AttributeError 'NoneType' object has no attribute 'keys'`

Proof / Evidence

  • GitHub issue: #5104
  • Fix PR: https://github.com/celery/celery/pull/5116
  • 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.60

Discussion

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

“Hi it's quite unrevelant to close this issue and ask to try django-celery-beats. I only use celery and the error is resolved if i modify…”
@maximekl · 2018-10-13 · confirmation · source
“I've had the same exception suddenly pop up since yesterday”
@HugoArts · 2018-10-11 · source
“please try the django-celery-beats from master branch”
@auvipy · 2018-10-13 · source
“I got confused with the last comment pointing to Django-celery-beat actually”
@auvipy · 2018-10-14 · source

Failure Signature (Search String)

  • Error `AttributeError 'NoneType' object has no attribute 'keys'`

Error Message

Stack trace
error.txt
Error Message ------------- Error `AttributeError 'NoneType' object has no attribute 'keys'`

Minimal Reproduction

repro.py
def schedules_equal(self, old_schedules, new_schedules): if set(old_schedules.keys()) != set(new_schedules.keys()): return False for name, old_entry in old_schedules.items(): new_entry = new_schedules.get(name) if not new_entry: return False return True

What Broke

Celery beat fails to start, resulting in an outage for scheduled tasks.

Why It Broke

The schedules_equal function did not handle the case where old_schedules is None

Fix Options (Details)

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

pip install celery==4.4.0rc5

When NOT to use: This fix is not applicable if the logic for handling None schedules is intentionally designed.

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

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

  • This fix is not applicable if the logic for handling None schedules is intentionally designed.

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.