Jump to solution
Verify

The Fix

pip install celery==5.1.0b1

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

Jump to Verify Open PR/Commit
@@ -3,7 +3,7 @@ from collections import UserList from functools import partial -from itertools import chain, islice +from itertools import islice
repro.py
import celery app = celery.Celery(name="app") @app.task(bind=True) def noop(self): pass def gen(): #assert False yield from (noop.si() for i in range(10)) g = celery.group(gen()) # Uncomment this to see the correct behaviour - but you'll need a backend # running since that'll mean we acually have tasks to submit. #print(g.tasks) gs = g.skew() r = g() print(repr(r))
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==5.1.0b1\nWhen NOT to use: This fix should not be used if the generator behavior is intentionally required.\n\nOption C — Workaround\nis to either only pass lists and tuples to `group`, or if you're using something like `Task.chunks`, reassign `tasks` with a list, e.g.:\nWhen NOT to use: This fix should not be used if the generator behavior is intentionally required.\n\n

Why This Fix Works in Production

  • Trigger: 3. `group.apply_async()` or `group()` -> `<GroupResult: 66fd517e-123b-4299-8cbe-9183b3f02626 []>`
  • Mechanism: The regen function was too greedy, causing tasks to be removed when using a generator
  • Why the fix works: Makes the regen function less greedy, which might fix the issue where group.skew() removes all tasks if the group input is a generator. (first fixed release: 5.1.0b1).
Production impact:
  • If left unfixed, this can cause silent data inconsistencies that propagate (bad cache entries, incorrect downstream decisions).

Why This Breaks in Prod

  • Shows up under Python 3.6.2 in real deployments (not just unit tests).
  • The regen function was too greedy, causing tasks to be removed when using a generator
  • Production symptom (often without a traceback): 3. `group.apply_async()` or `group()` -> `<GroupResult: 66fd517e-123b-4299-8cbe-9183b3f02626 []>`

Proof / Evidence

  • GitHub issue: #4298
  • Fix PR: https://github.com/celery/celery/pull/6589
  • First fixed release: 5.1.0b1
  • 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.66

Discussion

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

“I traced this back to get repro on the originally reported versions as well as current master (420e3931a)”
@maybe-sybr · 2020-12-08 · confirmation · source
“could you plz check the master if it still exists?”
@auvipy · 2017-12-19 · source
“Yes. Still happening as of 2547666a1ea13b27bc13ef296ae43a163ecd4ab3”
@allanlei · 2017-12-28 · source
“@maybe-sybr would be great if you could also take a look here when possible”
@auvipy · 2020-11-20 · source

Failure Signature (Search String)

  • 3. `group.apply_async()` or `group()` -> `<GroupResult: 66fd517e-123b-4299-8cbe-9183b3f02626 []>`
  • <GroupResult: 66fd517e-123b-4299-8cbe-9183b3f02626 []>
Copy-friendly signature
signature.txt
Failure Signature ----------------- 3. `group.apply_async()` or `group()` -> `<GroupResult: 66fd517e-123b-4299-8cbe-9183b3f02626 []>` <GroupResult: 66fd517e-123b-4299-8cbe-9183b3f02626 []>

Error Message

Signature-only (no traceback captured)
error.txt
Error Message ------------- 3. `group.apply_async()` or `group()` -> `<GroupResult: 66fd517e-123b-4299-8cbe-9183b3f02626 []>` <GroupResult: 66fd517e-123b-4299-8cbe-9183b3f02626 []>

Minimal Reproduction

repro.py
import celery app = celery.Celery(name="app") @app.task(bind=True) def noop(self): pass def gen(): #assert False yield from (noop.si() for i in range(10)) g = celery.group(gen()) # Uncomment this to see the correct behaviour - but you'll need a backend # running since that'll mean we acually have tasks to submit. #print(g.tasks) gs = g.skew() r = g() print(repr(r))

Environment

  • Python: 3.6.2

What Broke

Tasks were removed from the group, resulting in empty group results.

Why It Broke

The regen function was too greedy, causing tasks to be removed when using a generator

Fix Options (Details)

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

pip install celery==5.1.0b1

When NOT to use: This fix should not be used if the generator behavior is intentionally required.

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

Option C — Workaround Temporary workaround

is to either only pass lists and tuples to `group`, or if you're using something like `Task.chunks`, reassign `tasks` with a list, e.g.:

When NOT to use: This fix should not be used if the generator behavior is intentionally required.

Use only if you cannot change versions today. Treat this as a stopgap and remove once upgraded.

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

First fixed release: 5.1.0b1

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 used if the generator behavior is intentionally required.

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
5.1.0b1 Fixed

Related Issues

No related fixes found.

Sources

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