Jump to solution
Verify

The Fix

pip install redis==7.1.0

Based on closed redis/redis-py issue #3011 · 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
@@ -322,7 +322,7 @@ def float_or_none(response): -def bool_ok(response): +def bool_ok(response, **options): return str_if_bytes(response) == "OK"
repro.py
TypeError: bool_ok() got an unexpected keyword argument 'get' File "root/event_processing/unique_service/server/server/interceptors.py", line 51, in intercept result = method(request_or_iterator, context) File "root/event_processing/unique_service/server/monitoring.py", line 218, in wrapper return func(*args, **kwargs) File "root/event_processing/unique_service/server/server/routers.py", line 68, in RecordBatch responses = self.unique_service.record_or_get_event_batch(unique_service_requests) File "root/event_processing/unique_service/server/monitoring.py", line 218, in wrapper return func(*args, **kwargs) File "root/event_processing/unique_service/server/services/unique.py", line 312, in record_or_get_event_batch active_results = self._active_record_batch(active_requests) File "root/event_processing/unique_service/server/services/unique.py", line 158, in _active_record_batch response_batch = self.active.record_or_get_event_batch( File "root/event_processing/unique_service/server/monitoring.py", line 218, in wrapper return func(*args, **kwargs) File "root/event_processing/unique_service/server/repository/active.py", line 203, in record_or_get_event_batch return [self.record_or_get_event(request) for request in request_batch] File "root/event_processing/unique_service/server/repository/active.py", line 203, in <listcomp> return [self.record_or_get_event(request) for request in request_batch] File "root/event_processing/unique_service/server/monitoring.py", line 218, in wrapper return func(*args, **kwargs) File "root/event_processing/unique_service/server/repository/active.py", line 252, in record_or_get_event result = self._get_redis_cluster().set( File "redis/commands/core.py", line 2302, in set return self.execute_command("SET", *pieces, **options) File "/root/.pex/venvs/88a5344e0040931bbcf0ac82f021c059eb108950/779eb2cc0ca9e2fdd204774cbc41848e4e7c5055/lib/python3.10/site-packages/pex-ns-pkgs/14/opentelemetry/instrumentation/redis/__init__.py", line 162, in _traced_execute_command response = func(*args, **kwargs) File "redis/cluster.py", line 1074, in execute_command raise e File "redis/cluster.py", line 1060, in execute_command res[node.name] = self._execute_command(node, *args, **kwargs) File "root/event_processing/unique_service/server/tracing_redis_cluster.py", line 65, in _traced_execute_command response = func(*args, **kwargs) File "redis/cluster.py", line 1169, in _execute_command raise e File "redis/cluster.py", line 1106, in _execute_command redis_node.parse_response(connection, "ASKING", **kwargs) File "redis/client.py", line 1285, in parse_response return self.response_callbacks[command_name](response, **options)
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: This fix should not be applied if the application relies on the original function signature of bool_ok.\n\n

Why This Fix Works in Production

  • Trigger: TypeError: bool_ok() got an unexpected keyword argument 'get'
  • Mechanism: The bool_ok function did not accept additional keyword arguments, causing a TypeError during cluster rebalancing
  • Why the fix works: Allows the parsing of the asking command to forward original options, resolving a TypeError during redis cluster rebalance operations. (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.5.1 in real deployments (not just unit tests).
  • The bool_ok function did not accept additional keyword arguments, causing a TypeError during cluster rebalancing
  • Surfaces as: TypeError: bool_ok() got an unexpected keyword argument 'get'

Proof / Evidence

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

Discussion

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

“Solution for the 5.0.0 series: https://github.com/redis/redis-py/pull/3012”
@tbbream · 2023-10-16 · source
“Solution for the 4.6.0 series: https://github.com/redis/redis-py/pull/3013”
@tbbream · 2023-10-16 · source
“This issue is marked stale. It will be closed in 30 days if it is not updated.”
@github-actions · 2025-05-21 · source

Failure Signature (Search String)

  • TypeError: bool_ok() got an unexpected keyword argument 'get'

Error Message

Stack trace
error.txt
Error Message ------------- TypeError: bool_ok() got an unexpected keyword argument 'get' File "root/event_processing/unique_service/server/server/interceptors.py", line 51, in intercept result = method(request_or_iterator, context) File "root/event_processing/unique_service/server/monitoring.py", line 218, in wrapper return func(*args, **kwargs) File "root/event_processing/unique_service/server/server/routers.py", line 68, in RecordBatch responses = self.unique_service.record_or_get_event_batch(unique_service_requests) File "root/event_processing/unique_service/server/monitoring.py", line 218, in wrapper return func(*args, **kwargs) File "root/event_processing/unique_service/server/services/unique.py", line 312, in record_or_get_event_batch active_results = self._active_record_batch(active_requests) File "root/event_processing/unique_service/server/services/unique.py", line 158, in _active_record_batch response_batch = self.active.record_or_get_event_batch( File "root/event_processing/unique_service/server/monitoring.py", line 218, in wrapper return func(*args, **kwargs) File "root/event_processing/unique_service/server/repository/active.py", line 203, in record_or_get_event_batch return [self.record_or_get_event(request) for request in request_batch] File "root/event_processing/unique_service/server/repository/active.py", line 203, in <listcomp> retu ... (truncated) ...

Minimal Reproduction

repro.py
TypeError: bool_ok() got an unexpected keyword argument 'get' File "root/event_processing/unique_service/server/server/interceptors.py", line 51, in intercept result = method(request_or_iterator, context) File "root/event_processing/unique_service/server/monitoring.py", line 218, in wrapper return func(*args, **kwargs) File "root/event_processing/unique_service/server/server/routers.py", line 68, in RecordBatch responses = self.unique_service.record_or_get_event_batch(unique_service_requests) File "root/event_processing/unique_service/server/monitoring.py", line 218, in wrapper return func(*args, **kwargs) File "root/event_processing/unique_service/server/services/unique.py", line 312, in record_or_get_event_batch active_results = self._active_record_batch(active_requests) File "root/event_processing/unique_service/server/services/unique.py", line 158, in _active_record_batch response_batch = self.active.record_or_get_event_batch( File "root/event_processing/unique_service/server/monitoring.py", line 218, in wrapper return func(*args, **kwargs) File "root/event_processing/unique_service/server/repository/active.py", line 203, in record_or_get_event_batch return [self.record_or_get_event(request) for request in request_batch] File "root/event_processing/unique_service/server/repository/active.py", line 203, in <listcomp> return [self.record_or_get_event(request) for request in request_batch] File "root/event_processing/unique_service/server/monitoring.py", line 218, in wrapper return func(*args, **kwargs) File "root/event_processing/unique_service/server/repository/active.py", line 252, in record_or_get_event result = self._get_redis_cluster().set( File "redis/commands/core.py", line 2302, in set return self.execute_command("SET", *pieces, **options) File "/root/.pex/venvs/88a5344e0040931bbcf0ac82f021c059eb108950/779eb2cc0ca9e2fdd204774cbc41848e4e7c5055/lib/python3.10/site-packages/pex-ns-pkgs/14/opentelemetry/instrumentation/redis/__init__.py", line 162, in _traced_execute_command response = func(*args, **kwargs) File "redis/cluster.py", line 1074, in execute_command raise e File "redis/cluster.py", line 1060, in execute_command res[node.name] = self._execute_command(node, *args, **kwargs) File "root/event_processing/unique_service/server/tracing_redis_cluster.py", line 65, in _traced_execute_command response = func(*args, **kwargs) File "redis/cluster.py", line 1169, in _execute_command raise e File "redis/cluster.py", line 1106, in _execute_command redis_node.parse_response(connection, "ASKING", **kwargs) File "redis/client.py", line 1285, in parse_response return self.response_callbacks[command_name](response, **options)

Environment

  • Python: 3.5.1

What Broke

SET commands with GET option fail during cluster rebalancing, leading to operational disruptions.

Why It Broke

The bool_ok function did not accept additional keyword arguments, causing a TypeError during cluster rebalancing

Fix Options (Details)

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

pip install redis==7.1.0

When NOT to use: This fix should not be applied if the application relies on the original function signature of bool_ok.

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/3012

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

  • This fix should not be applied if the application relies on the original function signature of bool_ok.

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