# redis.exceptions.ResponseError: MOVED 1234 192.168.1.1:6379

- **ID:** `database/redis-cluster-slot-migration`
- **Domain:** database
- **Category:** protocol_error
- **Verification:** ai_generated
- **Fix Rate:** 90%

## Root Cause

Redis Cluster client sent a request to the wrong node for a given hash slot; the node responds with MOVED redirection indicating the correct node, but the client is not using cluster-aware routing or the cluster topology has changed.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Redis 6.2 | active | — | — |
| Redis 7.0 | active | — | — |
| Redis 7.2 | active | — | — |

## Workarounds

1. **Switch from redis.StrictRedis to redis.cluster.RedisCluster: from redis.cluster import RedisCluster; rc = RedisCluster(host='mycluster', port=6379). This handles MOVED redirections automatically.** (95% success)
   ```
   Switch from redis.StrictRedis to redis.cluster.RedisCluster: from redis.cluster import RedisCluster; rc = RedisCluster(host='mycluster', port=6379). This handles MOVED redirections automatically.
   ```
2. **Call rc.cluster_slots() or use the CLUSTER SLOTS command to get current slot-to-node mapping, then update client routing table.** (85% success)
   ```
   Call rc.cluster_slots() or use the CLUSTER SLOTS command to get current slot-to-node mapping, then update client routing table.
   ```
3. **Run redis-cli -h any_node CLUSTER NODES to see all nodes and slots. If slots are missing, rebalance: redis-cli --cluster rebalance 192.168.1.1:6379.** (80% success)
   ```
   Run redis-cli -h any_node CLUSTER NODES to see all nodes and slots. If slots are missing, rebalance: redis-cli --cluster rebalance 192.168.1.1:6379.
   ```

## Dead Ends

- **** — The client will keep hitting the same wrong node and get MOVED errors repeatedly; the slots must be refreshed. (95% fail)
- **** — This can break cluster consistency; the slot might be owned by another node, causing data loss or split-brain. (80% fail)
- **** — This treats the cluster as a standalone instance; MOVED errors will still occur for keys in non-local slots. (100% fail)
