Jump to solution
Verify

The Fix

pip install redis==7.1.0

Based on closed redis/redis-py issue #2754 · 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
@@ -1,3 +1,4 @@ @@ -1,3 +1,4 @@ + * Fix #2754, adding a missing argument to SentinelManagedConnection * Fix `xadd` command to accept non-negative `maxlen` including 0 * Revert #2104, #2673, add `disconnect_on_error` option to `read_response()` (issues #2506, #2624)
repro.py
08:24:16 .tox/_docker/py/lib/python3.8/site-packages/redis/client.py:1690: in get_message 08:24:16 response = self.parse_response(block=(timeout is None), timeout=timeout) 08:24:16 .tox/_docker/py/lib/python3.8/site-packages/redis/client.py:1542: in parse_response 08:24:16 response = self._execute(conn, try_read) 08:24:16 .tox/_docker/py/lib/python3.8/site-packages/redis/client.py:1518: in _execute 08:24:16 return conn.retry.call_with_retry( 08:24:16 .tox/_docker/py/lib/python3.8/site-packages/redis/retry.py:46: in call_with_retry 08:24:16 return do() 08:24:16 .tox/_docker/py/lib/python3.8/site-packages/redis/client.py:1519: in <lambda> 08:24:16 lambda: command(*args, **kwargs), 08:24:16 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 08:24:16 08:24:16 def try_read(): 08:24:16 if not block: 08:24:16 if not conn.can_read(timeout=timeout): 08:24:16 return None 08:24:16 else: 08:24:16 conn.connect() 08:24:16 > return conn.read_response(disconnect_on_error=False) 08:24:16 E TypeError: read_response() got an unexpected keyword argument 'disconnect_on_error' 08:24:16 08:24:16 .tox/_docker/py/lib/python3.8/site-packages/redis/client.py:1540: TypeError
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 redis==7.1.0\nWhen NOT to use: Do not use this fix if your application relies on the previous behavior of the `read_response` method.\n\n

Why This Fix Works in Production

  • Trigger: ... (truncated) ...
  • Mechanism: The method `read_response` was called with a non-existent keyword argument `disconnect_on_error`
  • Why the fix works: Adds a missing `disconnect_on_error` argument to the `SentinelManagedConnection.read_response()` method, fixing the issue where the method was called with a non-existent keyword argument. (first fixed release: 7.1.0).
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.8.16 in real deployments (not just unit tests).
  • The method `read_response` was called with a non-existent keyword argument `disconnect_on_error`
  • Surfaces as: Traceback (most recent call last):\n File "/usr/local/lib/python3.10/site-packages/celery/worker/worker.py", line 203, in start\n self.blueprint.start(self)\n File…

Proof / Evidence

  • GitHub issue: #2754
  • Fix PR: https://github.com/redis/redis-py/pull/2756
  • First fixed release: 7.1.0
  • Reproduced locally: No (not executed)
  • Last verified: 2026-02-08
  • Confidence: 0.85
  • Did this fix it?: Yes (upstream fix exists)
  • Own content ratio: 0.32

Discussion

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

“Hi! We hit the same issue. Is there any ETA on when will this fix be released to 4.5?”
@msingermann-domino · 2023-05-10 · confirmation · source
“@kristjanvalur Can you take a look here?”
@dvora-h · 2023-05-08 · source
“Folks, I can suggest using a little fix in your requirements.txt or pyproject.toml, construction like will work pretty well when you need the latest actual…”
@ArtsiomAntropau · 2023-05-23 · source
“self.connection is supposed to be an redis.Connection object. If it is something else, then someone must have injected that into the PubSub instance.”
@kristjanvalur · 2023-05-08 · source

Failure Signature (Search String)

  • ... (truncated) ...

Error Message

Stack trace
error.txt
Error Message ------------- Traceback (most recent call last):\n File "/usr/local/lib/python3.10/site-packages/celery/worker/worker.py", line 203, in start\n self.blueprint.start(self)\n File "/usr/local/lib/python3.10/site-packages/celery/bootsteps.py", line 116, in start\n step.start(parent)\n File "/usr/local/lib/python3.10/site-packages/celery/bootsteps.py", line 365, in start\n return self.obj.start()\n File "/usr/local/lib/python3.10/site-packages/celery/worker/consumer/consumer.py", line 332, in start\n blueprint.start(self)\n File "/usr/local/lib/python3.10/site-packages/celery/bootsteps.py", line 116, in start\n step.start(parent)\n File "/usr/local/lib/python3.10/site-packages/celery/worker/consumer/consumer.py", line 628, in start\n c.loop(*c.loop_args())\n File "/usr/local/lib/python3.10/site-packages/celery/worker/loops.py", line 97, in asynloop\n next(loop)\n File "/usr/local/lib/python3.10/site-packages/kombu/asynchronous/hub.py", line 362, in create_loop\n cb(*cbargs)\n File "/usr/local/lib/python3.10/site-packages/kombu/transport/redis.py", line 1326, in on_readable\n self.cycle.on_readable(fileno)\n File "/usr/local/lib/python3.10/site-packages/kombu/transport/redis.py", line 562, in on_readable\n chan.handlers[type]()\n File "/usr/local/lib/python3.10/site-packages/kombu/transport/redis.py", line 906, in _receive\n ret.append(self._receive_one ... (truncated) ...

Minimal Reproduction

repro.py
08:24:16 .tox/_docker/py/lib/python3.8/site-packages/redis/client.py:1690: in get_message 08:24:16 response = self.parse_response(block=(timeout is None), timeout=timeout) 08:24:16 .tox/_docker/py/lib/python3.8/site-packages/redis/client.py:1542: in parse_response 08:24:16 response = self._execute(conn, try_read) 08:24:16 .tox/_docker/py/lib/python3.8/site-packages/redis/client.py:1518: in _execute 08:24:16 return conn.retry.call_with_retry( 08:24:16 .tox/_docker/py/lib/python3.8/site-packages/redis/retry.py:46: in call_with_retry 08:24:16 return do() 08:24:16 .tox/_docker/py/lib/python3.8/site-packages/redis/client.py:1519: in <lambda> 08:24:16 lambda: command(*args, **kwargs), 08:24:16 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 08:24:16 08:24:16 def try_read(): 08:24:16 if not block: 08:24:16 if not conn.can_read(timeout=timeout): 08:24:16 return None 08:24:16 else: 08:24:16 conn.connect() 08:24:16 > return conn.read_response(disconnect_on_error=False) 08:24:16 E TypeError: read_response() got an unexpected keyword argument 'disconnect_on_error' 08:24:16 08:24:16 .tox/_docker/py/lib/python3.8/site-packages/redis/client.py:1540: TypeError

Environment

  • Python: 3.8.16

What Broke

This caused a TypeError, leading to failures in PubSub message retrieval.

Why It Broke

The method `read_response` was called with a non-existent keyword argument `disconnect_on_error`

Fix Options (Details)

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

pip install redis==7.1.0

When NOT to use: Do not use this fix if your application relies on the previous behavior of the `read_response` method.

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

Fix reference: https://github.com/redis/redis-py/pull/2756

First fixed release: 7.1.0

Last verified: 2026-02-08. Validate in your environment.

Get updates

We publish verified fixes weekly. No spam.

Subscribe

When NOT to Use This Fix

  • Do not use this fix if your application relies on the previous behavior of the `read_response` method.

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

  • Make timeouts explicit and test them (unit + integration) to avoid silent behavior changes.
  • Instrument retries (attempt count + reason) and alert on spikes to catch dependency slowdowns.

Version Compatibility Table

VersionStatus
7.1.0 Fixed

Related Issues

No related fixes found.

Sources

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