# redis.exceptions.MasterDownError: Error: Master is down or unreachable

- **ID:** `database/redis-master-link-down`
- **Domain:** database
- **Category:** network_error
- **Verification:** ai_generated
- **Fix Rate:** 85%

## Root Cause

The Redis client cannot connect to the master node in a replication setup, often due to network partition, master crash, or misconfigured replicaof directive.

## Version Compatibility

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

## Workarounds

1. **Check master status from replica: redis-cli -h replica_host INFO replication | grep master_link_status; if down, check master: redis-cli -h master_host PING; restart master if needed: systemctl restart redis-server** (85% success)
   ```
   Check master status from replica: redis-cli -h replica_host INFO replication | grep master_link_status; if down, check master: redis-cli -h master_host PING; restart master if needed: systemctl restart redis-server
   ```
2. **Promote replica to master in a failover scenario: redis-cli -h replica_host SLAVEOF NO ONE; then reconfigure other replicas to point to the new master.** (90% success)
   ```
   Promote replica to master in a failover scenario: redis-cli -h replica_host SLAVEOF NO ONE; then reconfigure other replicas to point to the new master.
   ```

## Dead Ends

- **Restarting only the replica node** — If the master is down, restarting the replica does not fix the connection; the replica will still fail to sync. (90% fail)
- **Increasing replica timeout in redis.conf without checking master health** — Increasing timeout only delays the error; it does not address the root cause of master unavailability. (70% fail)
