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%.
@@ -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:
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
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 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).
- 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…”
“I've had the same exception suddenly pop up since yesterday”
“please try the django-celery-beats from master branch”
“I got confused with the last comment pointing to Django-celery-beat actually”
Failure Signature (Search String)
- Error `AttributeError 'NoneType' object has no attribute 'keys'`
Error Message
Stack trace
Error Message
-------------
Error `AttributeError 'NoneType' object has no attribute 'keys'`
Minimal Reproduction
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
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.
When NOT to Use This Fix
- This fix is not applicable if the logic for handling None schedules is intentionally designed.
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.