Jump to solution
Verify

The Fix

pip install redis==7.1.0

Based on closed redis/redis-py issue #2472 · PR/commit linked

Jump to Verify Open PR/Commit
@@ -134,6 +134,14 @@ class RedisCluster(AbstractRedis, AbstractRedisCluster, AsyncRedisClusterCommand strategy that will be used for cluster node selection. The data read from replicas is eventually consistent with the data in primary nodes. + :param dynamic_startup_nodes: + | Set the RedisCluster's startup nodes to all the discovered nodes. + If true (default value), the cluster's discovered nodes will be used to
repro.py
from redis.asyncio import RedisCluster client = RedisCluster.from_url('redis://redis-cluster-headless:6379/0') print(client.nodes_manager.startup_nodes) # outputs {'redis-cluster-headless:6379': [host=redis-cluster-headless, port=6379, name=redis-cluster-headless:6379, server_type=None]} await client # initialization print(client.nodes_manager.startup_nodes) # outputs something like this # {'<ip1>:6379': [host=<ip1>, port=6379, name=<ip1>:6379, server_type=primary], # '<ip2>:6379': [host=<ip2>, port=6379, name=<ip2>:6379, server_type=primary], # '<ip3>:6379': [host=<ip3>, port=6379, name=<ip3>:6379, server_type=primary]}
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 is not suitable if static IP addresses are required for startup nodes.\n\n

Why This Fix Works in Production

  • Trigger: When deployed in dynamic systems like Kubernetes your shards may sometimes change their IP addresses.
  • Mechanism: AsyncRedisCluster overwrites initial startup nodes during reinitialization, leading to invalid nodes after failover
  • Why the fix works: Adds the dynamic_startup_nodes parameter to the async RedisCluster, which resolves the issue of invalid startup nodes during reinitialization. (first fixed release: 7.1.0).
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.7 in real deployments (not just unit tests).
  • AsyncRedisCluster overwrites initial startup nodes during reinitialization, leading to invalid nodes after failover
  • Production symptom (often without a traceback): When deployed in dynamic systems like Kubernetes your shards may sometimes change their IP addresses.

Proof / Evidence

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

Discussion

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

“Seems like adding dynamic_startup_nodes=False in cluster constructor solves the problem, at least for sync client.”
@andr-c · 2024-05-21 · source
“I'll be happy to review any PRs with a fix.”
@utkarshgupta137 · 2022-11-29 · source
“Hi! Is there any update on this? I got the same issue when I use AWS MemoryDB. got below exception(the same one mentioned above) when…”
@jiyeonseo · 2023-02-12 · source
“Hi! I got the same issue too when I use AWS redis. Exactly the same exception as Jiyeonseo posted: Is there any updates on this…”
@shuyingz · 2023-02-20 · source

Failure Signature (Search String)

  • When deployed in dynamic systems like Kubernetes your shards may sometimes change their IP addresses.
  • now image your python client is idle for some time without requests, and during that period K8S have recreated each redis container due to whatever reason (crash, or moved to
Copy-friendly signature
signature.txt
Failure Signature ----------------- When deployed in dynamic systems like Kubernetes your shards may sometimes change their IP addresses. now image your python client is idle for some time without requests, and during that period K8S have recreated each redis container due to whatever reason (crash, or moved to another node by autoscaler for example).

Error Message

Signature-only (no traceback captured)
error.txt
Error Message ------------- When deployed in dynamic systems like Kubernetes your shards may sometimes change their IP addresses. now image your python client is idle for some time without requests, and during that period K8S have recreated each redis container due to whatever reason (crash, or moved to another node by autoscaler for example).

Minimal Reproduction

repro.py
from redis.asyncio import RedisCluster client = RedisCluster.from_url('redis://redis-cluster-headless:6379/0') print(client.nodes_manager.startup_nodes) # outputs {'redis-cluster-headless:6379': [host=redis-cluster-headless, port=6379, name=redis-cluster-headless:6379, server_type=None]} await client # initialization print(client.nodes_manager.startup_nodes) # outputs something like this # {'<ip1>:6379': [host=<ip1>, port=6379, name=<ip1>:6379, server_type=primary], # '<ip2>:6379': [host=<ip2>, port=6379, name=<ip2>:6379, server_type=primary], # '<ip3>:6379': [host=<ip3>, port=6379, name=<ip3>:6379, server_type=primary]}

Environment

  • Python: 3.7

What Broke

Clients cannot connect to any Redis nodes after a failover, causing service outages.

Why It Broke

AsyncRedisCluster overwrites initial startup nodes during reinitialization, leading to invalid nodes after failover

Fix Options (Details)

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

pip install redis==7.1.0

When NOT to use: This fix is not suitable if static IP addresses are required for startup nodes.

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

First fixed release: 7.1.0

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 suitable if static IP addresses are required for startup nodes.

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.