Jump to solution
Verify

The Fix

pip install celery==4.4.7

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

Production note: This usually shows up under retries/timeouts. Treat it as a side-effect risk until you can verify behavior with a canary + real traffic.

Jump to Verify Open PR/Commit
@@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@ -FROM ubuntu:focal +FROM ubuntu:bionic
repro.py
... Collecting couchbase<3.0.0 Using cached couchbase-2.5.12.tar.gz (665 kB) ERROR: Command errored out with exit status 1: command: /home/developer/.pyenv/versions/python3.6/bin/python3.6 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-attw80li/couchbase/setup.py'"'"'; __file__='"'"'/tmp/pip-install-attw80li/couchbase/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-gwqx89jd cwd: /tmp/pip-install-attw80li/couchbase/ Complete output (44 lines): WARNING: The wheel package is not available. ERROR: Command errored out with exit status 1: command: /home/developer/.pyenv/versions/python3.6/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-wheel-_tz3wd9p/typing/setup.py'"'"'; __file__='"'"'/tmp/pip-wheel-_tz3wd9p/typing/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-gbnmjqhh cwd: /tmp/pip-wheel-_tz3wd9p/typing/ Complete output (6 lines): usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: setup.py --help [cmd1 cmd2 ...] or: setup.py --help-commands or: setup.py cmd --help error: invalid command 'bdist_wheel' ---------------------------------------- ERROR: Failed building wheel for typing ERROR: Failed to build one or more wheels Traceback (most recent call last): File "/home/developer/.pyenv/versions/python3.6/lib/python3.6/site-packages/setuptools/installer.py", line 128, in fetch_build_egg subprocess.check_call(cmd) File "/home/developer/.pyenv/versions/python3.6/lib/python3.6/subprocess.py", line 311, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['/home/developer/.pyenv/versions/python3.6/bin/python3.6', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpvavyptki', '--quiet', 'typing']' returned non-zero exit status 1. The above exception was the direct cause of the following exception: Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-install-attw80li/couchbase/setup.py", line 245, in <module> **setup_kw File "/home/developer/.pyenv/versions/python3.6/lib/python3.6/site-packages/setuptools/__init__.py", line 164, in setup _install_setup_requires(attrs) File "/home/developer/.pyenv/versions/python3.6/lib/python3.6/site-packages/setuptools/__init__.py", line 159, in _install_setup_requires dist.fetch_build_eggs(dist.setup_requires) File "/home/developer/.pyenv/versions/python3.6/lib/python3.6/site-packages/setuptools/dist.py", line 702, in fetch_build_eggs replace_conflicting=True, File "/home/developer/.pyenv/versions/python3.6/lib/python3.6/site-packages/pkg_resources/__init__.py", line 781, in resolve replace_conflicting=replace_conflicting File "/home/developer/.pyenv/versions/python3.6/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1064, in best_match return self.obtain(req, installer) File "/home/developer/.pyenv/versions/python3.6/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1076, in obtain return installer(requirement) File ... (truncated) ...
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 is not applicable if the couchbase package is updated to support focal.\n\n

Why This Fix Works in Production

  • Mechanism: The Docker image base was changed to ubuntu:focal, which is incompatible with the couchbase package
  • Why the fix works: Changes the Docker image base back to `ubuntu:bionic` to ensure compatibility with the couchbase package, which does not yet support focal. (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

  • Shows up under Python 3.6 in real deployments (not just unit tests).
  • The Docker image base was changed to ubuntu:focal, which is incompatible with the couchbase package
  • Surfaces as: ...

Proof / Evidence

  • GitHub issue: #6227
  • Fix PR: https://github.com/celery/celery/pull/6246
  • 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.31

Discussion

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

“I should point out that I'm using podman (per the output I copied under actual behaviour) but that shouldn't make a different AFAIK”
@maybe-sybr · 2020-07-14 · source
“Actually, changing the base image back to bionic failed when trying to install the couchbase Python package: In lines above, it does look like wheel…”
@maybe-sybr · 2020-07-14 · source
“My main question prior to sending a PR would be how this hasn't broken in a CI or release process yet”
@maybe-sybr · 2020-07-15 · source
“thats for development docker for celery!”
@auvipy · 2020-07-15 · source

Error Message

Stack trace
error.txt
Error Message ------------- ... Collecting couchbase<3.0.0 Using cached couchbase-2.5.12.tar.gz (665 kB) ERROR: Command errored out with exit status 1: command: /home/developer/.pyenv/versions/python3.6/bin/python3.6 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-attw80li/couchbase/setup.py'"'"'; __file__='"'"'/tmp/pip-install-attw80li/couchbase/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-gwqx89jd cwd: /tmp/pip-install-attw80li/couchbase/ Complete output (44 lines): WARNING: The wheel package is not available. ERROR: Command errored out with exit status 1: command: /home/developer/.pyenv/versions/python3.6/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-wheel-_tz3wd9p/typing/setup.py'"'"'; __file__='"'"'/tmp/pip-wheel-_tz3wd9p/typing/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-gbnmjqhh cwd: /tmp/pip-wheel-_tz3wd9p/typing/ Complete output (6 lines): usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: setup.py --help [cmd1 cm ... (truncated) ...

Minimal Reproduction

repro.py
... Collecting couchbase<3.0.0 Using cached couchbase-2.5.12.tar.gz (665 kB) ERROR: Command errored out with exit status 1: command: /home/developer/.pyenv/versions/python3.6/bin/python3.6 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-attw80li/couchbase/setup.py'"'"'; __file__='"'"'/tmp/pip-install-attw80li/couchbase/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-gwqx89jd cwd: /tmp/pip-install-attw80li/couchbase/ Complete output (44 lines): WARNING: The wheel package is not available. ERROR: Command errored out with exit status 1: command: /home/developer/.pyenv/versions/python3.6/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-wheel-_tz3wd9p/typing/setup.py'"'"'; __file__='"'"'/tmp/pip-wheel-_tz3wd9p/typing/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-gbnmjqhh cwd: /tmp/pip-wheel-_tz3wd9p/typing/ Complete output (6 lines): usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: setup.py --help [cmd1 cmd2 ...] or: setup.py --help-commands or: setup.py cmd --help error: invalid command 'bdist_wheel' ---------------------------------------- ERROR: Failed building wheel for typing ERROR: Failed to build one or more wheels Traceback (most recent call last): File "/home/developer/.pyenv/versions/python3.6/lib/python3.6/site-packages/setuptools/installer.py", line 128, in fetch_build_egg subprocess.check_call(cmd) File "/home/developer/.pyenv/versions/python3.6/lib/python3.6/subprocess.py", line 311, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['/home/developer/.pyenv/versions/python3.6/bin/python3.6', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpvavyptki', '--quiet', 'typing']' returned non-zero exit status 1. The above exception was the direct cause of the following exception: Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-install-attw80li/couchbase/setup.py", line 245, in <module> **setup_kw File "/home/developer/.pyenv/versions/python3.6/lib/python3.6/site-packages/setuptools/__init__.py", line 164, in setup _install_setup_requires(attrs) File "/home/developer/.pyenv/versions/python3.6/lib/python3.6/site-packages/setuptools/__init__.py", line 159, in _install_setup_requires dist.fetch_build_eggs(dist.setup_requires) File "/home/developer/.pyenv/versions/python3.6/lib/python3.6/site-packages/setuptools/dist.py", line 702, in fetch_build_eggs replace_conflicting=True, File "/home/developer/.pyenv/versions/python3.6/lib/python3.6/site-packages/pkg_resources/__init__.py", line 781, in resolve replace_conflicting=replace_conflicting File "/home/developer/.pyenv/versions/python3.6/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1064, in best_match return self.obtain(req, installer) File "/home/developer/.pyenv/versions/python3.6/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1076, in obtain return installer(requirement) File ... (truncated) ...

Environment

  • Python: 3.6

What Broke

Installing the couchbase package fails with an error during the build process.

Why It Broke

The Docker image base was changed to ubuntu:focal, which is incompatible with the couchbase package

Fix Options (Details)

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

pip install celery==4.4.7

When NOT to use: This fix is not applicable if the couchbase package is updated to support focal.

Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.

Option D — Guard side-effects with OnceOnly Guardrail for side-effects

Mitigate duplicate external side-effects under retries/timeouts/agent loops by gating the operation before calling external systems.

  • Place OnceOnly between your code/agent and real side-effects (Stripe, emails, CRM, APIs).
  • Use a stable key per side-effect (e.g., customer_id + action + idempotency_key).
  • Fail-safe: configure fail-open vs fail-closed based on blast radius and spend risk.
Show example snippet (optional)
onceonly.py
from onceonly import OnceOnly import os once = OnceOnly(api_key=os.environ["ONCEONLY_API_KEY"], fail_open=True) # Stable idempotency key per real side-effect. # Use a request id / job id / webhook delivery id / Stripe event id, etc. event_id = "evt_..." # replace key = f"stripe:webhook:{event_id}" res = once.check_lock(key=key, ttl=3600) if res.duplicate: return {"status": "already_processed"} # Safe to execute the side-effect exactly once. handle_event(event_id)

See OnceOnly SDK

When NOT to use: Do not use this to hide logic bugs or data corruption. Use it to block duplicate external side-effects and enforce tool permissions/spend caps.

Fix reference: https://github.com/celery/celery/pull/6246

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 is not applicable if the couchbase package is updated to support focal.
  • Do not use this to hide logic bugs or data corruption. Use it to block duplicate external side-effects and enforce tool permissions/spend caps.

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.

Version Compatibility Table

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