Celery: Task executed twice / Restoring unacked messages — Redis broker visibility_timeout shorter than task ETA
Celery's Redis transport redelivers a task if it isn't acknowledged within visibility_timeout (1 hour by default).
Celery tasks run twice Redis visibility_timeoutRestoring 1 unacknowledged message(s) Celery RedisCelery task executed twice with Redis brokervisibility_timeout Celery Redis ETA task duplicatedCelery duplicate task execution redis Meaning
Tasks with ETA/countdown or runtime longer than visibility_timeout get redelivered, so they run again. Set broker_transport_options = {"visibility_timeout": 43200} larger than the longest ETA/runtime, make tasks idempotent, and use acks_late consciously.
Common causes
- ETA/countdown longer than visibility_timeout
- Long-running tasks with
acks_late=True - Worker restarts with unacked tasks
- Short visibility_timeout configured
- Multiple brokers/DBs mixing
⚡ Quick fix
app.conf.broker_transport_options = {"visibility_timeout": 43200}- Make tasks idempotent
- Avoid very long ETAs; use a scheduler (beat)
Detailed fix by platform
Python
app.conf.broker_transport_options = {"visibility_timeout": 3600 * 12}
How to diagnose
- ETA — Longer than timeout?
- Runtime — Task duration?
- Idempotent — Safe to rerun?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- BullMQ: Missing lock for job / job stalled more than allowable limit BullMQ: Error: Missing lock for job 42. moveToFinished / job stalled more than allowable limit
- BUSY Redis is busy running a script Redis: (error) BUSY Redis is busy running a script. You can only call SCRIPT KILL or SHUTDOWN NOSAVE
- Client output buffer limit reached (scheduled to be closed) Redis: Client id=12 addr=10.0.0.5:51234 scheduled to be closed ASAP for overcoming of output buffer limits
Most viewed in Redis
- READONLY You can't write against a read only replica Redis: READONLY You can't write against a read only replica
- MISCONF Redis: MISCONF Redis is configured to save RDB snapshots, but it's currently unable to persist to disk
- OOM command not allowed Redis: OOM command not allowed when used memory > 'maxmemory'
Other ways to find it
Where this error sits
Origin: Data. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 5 Nov 2026