The Fix
pip install celery==4.4.7
Based on closed celery/celery issue #4558 · 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%.
@@ -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')
$ pip install celery
$ cat > foo.py
from celery import Celery
app = Celery("foo")
^D
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.7\nWhen NOT to use: Do not use this fix if you rely on the specific behavior of argument ordering in your application.\n\n
Why This Fix Works in Production
- Trigger: Unlike what doc states, --app does not behave like -A
- Mechanism: The argument parsing for --app does not handle positional arguments correctly compared to -A
- Why the fix works: Fixes the argument parsing issue where --app does not behave like -A, ensuring both options work consistently. (first fixed release: 4.4.7).
- 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 argument parsing for --app does not handle positional arguments correctly compared to -A
- Production symptom (often without a traceback): Unlike what doc states, --app does not behave like -A
Proof / Evidence
- GitHub issue: #4558
- Fix PR: https://github.com/celery/celery/pull/6223
- First fixed release: 4.4.7
- 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.70
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“There is in fact a behavioral difference that depends on arguments position: celery worker -A foo works celery worker --app foo works celery -A foo…”
“do you have any suggested improvement in mind?”
“(note that this bug is probably also affecting all other global options passed before the command name and that have arguments, like --broker BROKER, --result-backend…”
“(see https://github.com/celery/celery/blob/master/celery/bin/celery.py#L438:L473)”
Failure Signature (Search String)
- Unlike what doc states, --app does not behave like -A
- `celery --app foo worker` does not work and show celery usage
Copy-friendly signature
Failure Signature
-----------------
Unlike what doc states, --app does not behave like -A
`celery --app foo worker` does not work and show celery usage
Error Message
Signature-only (no traceback captured)
Error Message
-------------
Unlike what doc states, --app does not behave like -A
`celery --app foo worker` does not work and show celery usage
Minimal Reproduction
$ pip install celery
$ cat > foo.py
from celery import Celery
app = Celery("foo")
^D
What Broke
Using --app results in incorrect command output, leading to confusion and potential downtime.
Why It Broke
The argument parsing for --app does not handle positional arguments correctly compared to -A
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install celery==4.4.7
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.
When NOT to Use This Fix
- Do not use this fix if you rely on the specific behavior of argument ordering in your application.
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.7 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.