Jump to solution
Verify

The Fix

pip install celery==4.4.7

Based on closed celery/celery issue #6285 · 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
[2020-08-10 06:11:51,832: CRITICAL/MainProcess] Unrecoverable error: AccessRefused(403, 'ACCESS_REFUSED - Login was refused using authentication mechanism AMQPLAIN. For details see the broker logfile.', (0, 0), '') Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/celery/worker/worker.py", line 208, in start self.blueprint.start(self) File "/usr/local/lib/python3.8/dist-packages/celery/bootsteps.py", line 119, in start step.start(parent) File "/usr/local/lib/python3.8/dist-packages/celery/bootsteps.py", line 369, in start return self.obj.start() File "/usr/local/lib/python3.8/dist-packages/celery/worker/consumer/consumer.py", line 318, in start blueprint.start(self) File "/usr/local/lib/python3.8/dist-packages/celery/bootsteps.py", line 119, in start step.start(parent) File "/usr/local/lib/python3.8/dist-packages/celery/worker/consumer/connection.py", line 23, in start c.connection = c.connect() File "/usr/local/lib/python3.8/dist-packages/celery/worker/consumer/consumer.py", line 405, in connect conn = self.connection_for_read(heartbeat=self.amqheartbeat) File "/usr/local/lib/python3.8/dist-packages/celery/worker/consumer/consumer.py", line 411, in connection_for_read return self.ensure_connected( File "/usr/local/lib/python3.8/dist-packages/celery/worker/consumer/consumer.py", line 437, in ensure_connected conn = conn.ensure_connection( File "/usr/local/lib/python3.8/dist-packages/kombu/connection.py", line 389, in ensure_connection self._ensure_connection(*args, **kwargs) File "/usr/local/lib/python3.8/dist-packages/kombu/connection.py", line 441, in _ensure_connection return retry_over_time( File "/usr/local/lib/python3.8/dist-packages/kombu/utils/functional.py", line 344, in retry_over_time return fun(*args, **kwargs) File "/usr/local/lib/python3.8/dist-packages/kombu/connection.py", line 874, in _connection_factory self._connection = self._establish_connection() File "/usr/local/lib/python3.8/dist-packages/kombu/connection.py", line 809, in _establish_connection conn = self.transport.establish_connection() File "/usr/local/lib/python3.8/dist-packages/kombu/transport/pyamqp.py", line 130, in establish_connection conn.connect() File "/usr/local/lib/python3.8/dist-packages/amqp/connection.py", line 320, in connect self.drain_events(timeout=self.connect_timeout) File "/usr/local/lib/python3.8/dist-packages/amqp/connection.py", line 508, in drain_events while not self.blocking_read(timeout): File "/usr/local/lib/python3.8/dist-packages/amqp/connection.py", line 514, in blocking_read return self.on_inbound_frame(frame) File "/usr/local/lib/python3.8/dist-packages/amqp/method_framing.py", line 55, in on_frame callback(channel, method_sig, buf, None) File "/usr/local/lib/python3.8/dist-packages/amqp/connection.py", line 520, in on_inbound_method return self.channels[channel_id].dispatch_method( File "/usr/local/lib/python3.8/dist-packages/amqp/abstract_channel.py", line 145, in dispatch_method listener(*args) File "/usr/local/lib/python3.8/dist-packages/amqp/connection.py", line 650, in _on_close raise error_for_code(reply_code, reply_text, amqp.exceptions.AccessRefused: (0, 0): (403) ACCESS_REFUSED - Login was refused using authentication mechanism AMQPLAIN. For details see the broker logfile.
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.7\nWhen NOT to use: This fix should not be applied if the application relies on the behavior of the previous version.\n\n

Why This Fix Works in Production

  • Trigger: [2020-08-10 06:11:51,832: CRITICAL/MainProcess] Unrecoverable error: AccessRefused(403, 'ACCESS_REFUSED - Login was refused using authentication mechanism…
  • Mechanism: Fixes the issue where the -A and --args options do not behave the same in Celery, which caused configuration problems in Django setups.
  • Why the fix works: Fixes the issue where the -A and --args options do not behave the same in Celery, which caused configuration problems in Django setups. (first fixed release: 4.4.7).
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

  • Triggered by an upgrade/regression window: 4.4.7–5.0.2 breaks; 4.4.7 is the first fixed release.
  • Shows up under Python 3.8 in real deployments (not just unit tests).
  • Surfaces as: [2020-08-10 06:11:51,832: CRITICAL/MainProcess] Unrecoverable error: AccessRefused(403, 'ACCESS_REFUSED - Login was refused using authentication mechanism AMQPLAIN. For details…

Proof / Evidence

  • GitHub issue: #6285
  • Fix PR: https://github.com/celery/celery/pull/6223
  • First fixed release: 4.4.7
  • Affected versions: 4.4.7–5.0.2
  • Reproduced locally: No (not executed)
  • Last verified: 2026-02-09
  • Confidence: 0.75
  • Did this fix it?: Yes (upstream fix exists)
  • Own content ratio: 0.22

Discussion

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

“The symptom in my case is that messages are received, but rejected because the called task is not registered. What was really confusing is that…”
@dratchkov · 2020-08-04 · confirmation · source
“This is not a Django issue”
@bsolomon1124 · 2020-09-30 · source
“> Additionally, adding a CELERY_APP environment variable provides a **workaround** for this issue on my end”
@leonardoarroyo · 2020-08-19 · source
“4.4.7 broke my django site. Just reverted to 4.4.6. Did not investigate further but jobs were not being processed. Assume it is related to this…”
@pg1671 · 2020-08-04 · source

Failure Signature (Search String)

  • [2020-08-10 06:11:51,832: CRITICAL/MainProcess] Unrecoverable error: AccessRefused(403, 'ACCESS_REFUSED - Login was refused using authentication mechanism AMQPLAIN. For details

Error Message

Stack trace
error.txt
Error Message ------------- [2020-08-10 06:11:51,832: CRITICAL/MainProcess] Unrecoverable error: AccessRefused(403, 'ACCESS_REFUSED - Login was refused using authentication mechanism AMQPLAIN. For details see the broker logfile.', (0, 0), '') Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/celery/worker/worker.py", line 208, in start self.blueprint.start(self) File "/usr/local/lib/python3.8/dist-packages/celery/bootsteps.py", line 119, in start step.start(parent) File "/usr/local/lib/python3.8/dist-packages/celery/bootsteps.py", line 369, in start return self.obj.start() File "/usr/local/lib/python3.8/dist-packages/celery/worker/consumer/consumer.py", line 318, in start blueprint.start(self) File "/usr/local/lib/python3.8/dist-packages/celery/bootsteps.py", line 119, in start step.start(parent) File "/usr/local/lib/python3.8/dist-packages/celery/worker/consumer/connection.py", line 23, in start c.connection = c.connect() File "/usr/local/lib/python3.8/dist-packages/celery/worker/consumer/consumer.py", line 405, in connect conn = self.connection_for_read(heartbeat=self.amqheartbeat) File "/usr/local/lib/python3.8/dist-packages/celery/worker/consumer/consumer.py", line 411, in connection_for_read return self.ensure_connected( File "/usr/local/lib/python3.8/dist-packages/celery/worker/consumer/consumer.py", line 437, in ensure_ ... (truncated) ...
Stack trace
error.txt
Error Message ------------- Traceback (most recent call last): File "/home/vishal/dev/ecbe-n/.venv/lib/python3.7/site-packages/kombu/utils/functional.py", line 30, in __call__ return self.__value__ AttributeError: 'ChannelPromise' object has no attribute '__value__' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/vishal/dev/ecbe-n/.venv/lib/python3.7/site-packages/django/core/handlers/exception.py", line 34, in inner response = get_response(request) File "/home/vishal/dev/ecbe-n/.venv/lib/python3.7/site-packages/django/core/handlers/base.py", line 126, in _get_response response = self.process_exception_by_middleware(e, request) File "/home/vishal/dev/ecbe-n/.venv/lib/python3.7/site-packages/django/core/handlers/base.py", line 124, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/home/vishal/dev/ecbe-n/.venv/lib/python3.7/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view return view_func(request, *args, **kwargs) File "/home/vishal/dev/ecbe-n/website/report/backend.py", line 277, in compile compile_report.delay(report.pk, language=language) File "/home/vishal/dev/ecbe-n/.venv/lib/python3.7/site-packages/celery/app/task.py", line 425, in delay return self.apply_async(args, kwargs) File "/home/vishal/dev/ecbe-n/.venv/lib/pyth ... (truncated) ...

Minimal Reproduction

repro.py
[2020-08-10 06:11:51,832: CRITICAL/MainProcess] Unrecoverable error: AccessRefused(403, 'ACCESS_REFUSED - Login was refused using authentication mechanism AMQPLAIN. For details see the broker logfile.', (0, 0), '') Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/celery/worker/worker.py", line 208, in start self.blueprint.start(self) File "/usr/local/lib/python3.8/dist-packages/celery/bootsteps.py", line 119, in start step.start(parent) File "/usr/local/lib/python3.8/dist-packages/celery/bootsteps.py", line 369, in start return self.obj.start() File "/usr/local/lib/python3.8/dist-packages/celery/worker/consumer/consumer.py", line 318, in start blueprint.start(self) File "/usr/local/lib/python3.8/dist-packages/celery/bootsteps.py", line 119, in start step.start(parent) File "/usr/local/lib/python3.8/dist-packages/celery/worker/consumer/connection.py", line 23, in start c.connection = c.connect() File "/usr/local/lib/python3.8/dist-packages/celery/worker/consumer/consumer.py", line 405, in connect conn = self.connection_for_read(heartbeat=self.amqheartbeat) File "/usr/local/lib/python3.8/dist-packages/celery/worker/consumer/consumer.py", line 411, in connection_for_read return self.ensure_connected( File "/usr/local/lib/python3.8/dist-packages/celery/worker/consumer/consumer.py", line 437, in ensure_connected conn = conn.ensure_connection( File "/usr/local/lib/python3.8/dist-packages/kombu/connection.py", line 389, in ensure_connection self._ensure_connection(*args, **kwargs) File "/usr/local/lib/python3.8/dist-packages/kombu/connection.py", line 441, in _ensure_connection return retry_over_time( File "/usr/local/lib/python3.8/dist-packages/kombu/utils/functional.py", line 344, in retry_over_time return fun(*args, **kwargs) File "/usr/local/lib/python3.8/dist-packages/kombu/connection.py", line 874, in _connection_factory self._connection = self._establish_connection() File "/usr/local/lib/python3.8/dist-packages/kombu/connection.py", line 809, in _establish_connection conn = self.transport.establish_connection() File "/usr/local/lib/python3.8/dist-packages/kombu/transport/pyamqp.py", line 130, in establish_connection conn.connect() File "/usr/local/lib/python3.8/dist-packages/amqp/connection.py", line 320, in connect self.drain_events(timeout=self.connect_timeout) File "/usr/local/lib/python3.8/dist-packages/amqp/connection.py", line 508, in drain_events while not self.blocking_read(timeout): File "/usr/local/lib/python3.8/dist-packages/amqp/connection.py", line 514, in blocking_read return self.on_inbound_frame(frame) File "/usr/local/lib/python3.8/dist-packages/amqp/method_framing.py", line 55, in on_frame callback(channel, method_sig, buf, None) File "/usr/local/lib/python3.8/dist-packages/amqp/connection.py", line 520, in on_inbound_method return self.channels[channel_id].dispatch_method( File "/usr/local/lib/python3.8/dist-packages/amqp/abstract_channel.py", line 145, in dispatch_method listener(*args) File "/usr/local/lib/python3.8/dist-packages/amqp/connection.py", line 650, in _on_close raise error_for_code(reply_code, reply_text, amqp.exceptions.AccessRefused: (0, 0): (403) ACCESS_REFUSED - Login was refused using authentication mechanism AMQPLAIN. For details see the broker logfile.

Environment

  • Python: 3.8

What Broke

Django applications fail to connect to the specified broker, causing task execution issues.

Fix Options (Details)

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

pip install celery==4.4.7

When NOT to use: This fix should not be applied if the application relies on the behavior of the previous version.

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

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 the application relies on the behavior of the previous version.

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.7 Broken
5.0 Broken
5.0.2 Broken
4.4.7 Fixed

Related Issues

No related fixes found.

Sources

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