{
  "id": "database/redis-cluster-moved-redirect",
  "signature": "redis.exceptions.ResponseError: MOVED 12345 192.168.1.10:6379",
  "signature_zh": "redis.exceptions.ResponseError：MOVED 12345 192.168.1.10:6379",
  "regex": "MOVED \\d+ \\d+\\.\\d+\\.\\d+\\.\\d+:\\d+",
  "domain": "database",
  "category": "protocol_error",
  "subcategory": null,
  "root_cause": "A Redis cluster client sent a command to the wrong node; the cluster slot is owned by a different node, requiring a redirect.",
  "root_cause_type": "generic",
  "root_cause_zh": "Redis集群客户端将命令发送到了错误的节点；该集群槽位由另一个节点拥有，需要重定向。",
  "versions": [
    {
      "version": "Redis 6.2",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Redis 7.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Redis 7.2",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Ignore the MOVED error and retry the same node",
      "why_fails": "The cluster topology is static for that slot; retrying the same node will always fail because the slot is not hosted there.",
      "fail_rate": 1.0,
      "condition": "",
      "sources": []
    },
    {
      "action": "Manually update the client's cluster slots map by hardcoding IP addresses",
      "why_fails": "Cluster nodes can change IPs or rebalance slots; hardcoding breaks when the cluster topology changes.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Use a Redis cluster-aware client (e.g., redis-py-cluster) that automatically follows MOVED redirects: from rediscluster import RedisCluster; rc = RedisCluster(startup_nodes=[{'host':'192.168.1.10','port':6379}], decode_responses=True)",
      "success_rate": 0.95,
      "how": "Use a Redis cluster-aware client (e.g., redis-py-cluster) that automatically follows MOVED redirects: from rediscluster import RedisCluster; rc = RedisCluster(startup_nodes=[{'host':'192.168.1.10','port':6379}], decode_responses=True)",
      "condition": "",
      "sources": []
    },
    {
      "action": "Execute the command on the node specified in the MOVED error: redis-cli -h 192.168.1.10 -p 6379 GET mykey",
      "success_rate": 0.9,
      "how": "Execute the command on the node specified in the MOVED error: redis-cli -h 192.168.1.10 -p 6379 GET mykey",
      "condition": "",
      "sources": []
    },
    {
      "action": "Refresh the cluster slots map in the client: rc.cluster_slots = rc.cluster_slots() to force a re-fetch of slot assignments.",
      "success_rate": 0.85,
      "how": "Refresh the cluster slots map in the client: rc.cluster_slots = rc.cluster_slots() to force a re-fetch of slot assignments.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Use a Redis cluster-aware client (e.g., redis-py-cluster) that automatically follows MOVED redirects: from rediscluster import RedisCluster; rc = RedisCluster(startup_nodes=[{'host':'192.168.1.10','port':6379}], decode_responses=True)",
    "Execute the command on the node specified in the MOVED error: redis-cli -h 192.168.1.10 -p 6379 GET mykey",
    "Refresh the cluster slots map in the client: rc.cluster_slots = rc.cluster_slots() to force a re-fetch of slot assignments."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://redis.io/docs/latest/operate/oss_and_stack/management/scaling/",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2024-01-18",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}