Jump to solution
Verify

The Fix

pip install celery==4.4

Based on closed celery/celery issue #6370 · 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
@@ -474,7 +474,7 @@ def prepare_parser(self, parser): def setup_app_from_commandline(self, argv): - preload_options = self.parse_preload_options(argv) + preload_options, remaining_options = self.parse_preload_options(argv) quiet = preload_options.get('quiet')
repro.py
import time from celery import Celery celery = Celery("hi") redis_host = "redis://127.0.0.1:6395/0" celery.conf.broker_url = redis_host celery.conf.result_backend = redis_host celery.conf.beat_schedule = { "update-foo": { "task": 'celeryfoo.update', "schedule": 15, "args": (1, 2, 3) }, } celery.conf.worker_redirect_stdouts = False celery.conf.worker_log_color = False @celery.task def update(a, b, c): with open("foo.log", "a") as f: f.write(str(time.time()) + "\n") return a, b, c
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\nWhen NOT to use: This fix should not be applied if using a different broker than Redis.\n\n

Why This Fix Works in Production

  • Trigger: [2020-09-28 11:01:51,908: ERROR/MainProcess] consumer: Cannot connect to amqp://guest:**@127.0.0.1:5672//: [Errno 61] Connection refused.
  • Mechanism: Fixes an issue where Celery 4.4.7 attempts to use AMQP despite being given Redis as the broker URL and result backend.
  • Why the fix works: Fixes an issue where Celery 4.4.7 attempts to use AMQP despite being given Redis as the broker URL and result backend. (first fixed release: 4.4).
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

  • Shows up under Python 3.8.5 in real deployments (not just unit tests).
  • Production symptom (often without a traceback): [2020-09-28 11:01:51,908: ERROR/MainProcess] consumer: Cannot connect to amqp://guest:**@127.0.0.1:5672//: [Errno 61] Connection refused.

Proof / Evidence

  • GitHub issue: #6370
  • Fix PR: https://github.com/celery/celery/pull/6223
  • First fixed release: 4.4
  • 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.53

Discussion

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

“closing as we do not support 4.x branch anymore and it doesn't happen in v5+”
@auvipy · 2021-09-16 · confirmation · source
“For any future readers, this is not a problem with 5.0.2.”
@iyawnis · 2020-11-17 · source
“This bug hit us many times, so we were forced to downgrade to 4.4.6 ... Decision not support the previous stable major branch is just…”
@dejlek · 2022-02-24 · source
“I am using version 5.1.2 which seems to still have the issue”
@brunerm99 · 2022-09-07 · source

Failure Signature (Search String)

  • [2020-09-28 11:01:51,908: ERROR/MainProcess] consumer: Cannot connect to amqp://guest:**@127.0.0.1:5672//: [Errno 61] Connection refused.
  • [2020-09-28 11:02:24,029: ERROR/MainProcess] consumer: Cannot connect to amqp://guest:**@127.0.0.1:5672//: [Errno 61] Connection refused.
Copy-friendly signature
signature.txt
Failure Signature ----------------- [2020-09-28 11:01:51,908: ERROR/MainProcess] consumer: Cannot connect to amqp://guest:**@127.0.0.1:5672//: [Errno 61] Connection refused. [2020-09-28 11:02:24,029: ERROR/MainProcess] consumer: Cannot connect to amqp://guest:**@127.0.0.1:5672//: [Errno 61] Connection refused.

Error Message

Signature-only (no traceback captured)
error.txt
Error Message ------------- [2020-09-28 11:01:51,908: ERROR/MainProcess] consumer: Cannot connect to amqp://guest:**@127.0.0.1:5672//: [Errno 61] Connection refused. [2020-09-28 11:02:24,029: ERROR/MainProcess] consumer: Cannot connect to amqp://guest:**@127.0.0.1:5672//: [Errno 61] Connection refused.

Minimal Reproduction

repro.py
import time from celery import Celery celery = Celery("hi") redis_host = "redis://127.0.0.1:6395/0" celery.conf.broker_url = redis_host celery.conf.result_backend = redis_host celery.conf.beat_schedule = { "update-foo": { "task": 'celeryfoo.update', "schedule": 15, "args": (1, 2, 3) }, } celery.conf.worker_redirect_stdouts = False celery.conf.worker_log_color = False @celery.task def update(a, b, c): with open("foo.log", "a") as f: f.write(str(time.time()) + "\n") return a, b, c

Environment

  • Python: 3.8.5

What Broke

Workers fail to start due to connection errors with the AMQP broker, leading to task processing failures.

Fix Options (Details)

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

pip install celery==4.4

When NOT to use: This fix should not be applied if using a different broker than Redis.

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

First fixed release: 4.4

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 should not be applied if using a different broker than Redis.

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

  • Add a TLS smoke test that performs a real handshake in CI (include CA bundle validation and hostname checks).
  • Alert on handshake failures by error string and endpoint to catch cert/CA changes quickly.
  • Make timeouts explicit and test them (unit + integration) to avoid silent behavior changes.
  • Instrument retries (attempt count + reason) and alert on spikes to catch dependency slowdowns.

Version Compatibility Table

VersionStatus
4.4 Fixed

Related Issues

No related fixes found.

Sources

We don’t republish the full GitHub discussion text. Use the links above for context.