How to fix ERR Can't SYNC while not connected in Redis
This error occurs when a Redis replica attempts to synchronize with a master that is itself a replica but has lost its own master connection. Fixing it requires ensuring proper master configuration and network connectivity in your replication topology.
Quick fix
Fixes ERR Can't SYNC while not connected
redis-cli -h <master-host> -p <master-port> INFO replication- Verify the master-replica connection status
- Ensure direct master connectivity from the failing replica
- Disconnect the replica from its previous master (if needed)
- Reconfigure the replica to sync from the correct master
redis-cli -h <master-host> -p <master-port> INFO replicationERR Can't SYNC while not connected
What this error means
In Redis replication, replicas sync data from a master node. This error specifically indicates that a replica is trying to execute a SYNC command against a node that is configured as a replica but is not currently connected to its own master. This creates a broken synchronization chain where data cannot flow properly. The replica cannot sync because the node it's trying to sync from is in an invalid state—it's a slave without an active connection to its master, making it unable to provide consistent data.
Typical symptoms
- Replicas fail to sync with master and continuously retry SYNC commands
- Log messages showing "Master does not support PSYNC or is in error state"
- Replication lag increases indefinitely
- Data inconsistency between nodes in a multi-tier replication setup
- Sentinel failover or manual failover operations fail to complete
Common causes
- Master connection lost in chained replication topology (A → B → C) where B loses connection to A, preventing C from syncing with B
- Improper failover configuration where a promoted replica is not fully disconnected from its previous master
- Network connectivity issues between the replica and its configured master
- Redis version mismatch or replication protocol incompatibility
- Misconfigured slaveof/replicaof directive pointing to an invalid master
How to fix "ERR Can't SYNC while not connected"
Check the replication status of all nodes using the INFO replication command:
redis-cli -h <master-host> -p <master-port> INFO replicationLook for "role" field. The master should show "role:master" and replicas should show "role:slave" or "role:replica" with a connected master link. If "master_link_status:down", the replica has lost connection to its master.
Verify network connectivity from the replica to its configured master:
redis-cli -h <replica-host> -p <replica-port> ping
redis-cli -h <replica-host> -p <replica-port> CLIENT LIST | grep MASTER
netcat -zv <master-host> <master-port>If the replica cannot reach the master, check firewall rules, security groups, DNS resolution, and network routing.
If you recently performed a failover and the replica is still trying to connect to a dead master, disconnect it first:
redis-cli -h <replica-host> -p <replica-port> REPLICAOF NO ONEWait a few seconds, then verify it is now standalone:
redis-cli -h <replica-host> -p <replica-port> INFO replicationOnce the replica is standalone, point it to the correct master:
redis-cli -h <replica-host> -p <replica-port> REPLICAOF <new-master-host> <new-master-port>Verify the connection is now established:
redis-cli -h <replica-host> -p <replica-port> INFO replicationLook for "master_link_status:up" and "connected_slaves" on the master side.
Examine the Redis server logs on both master and replica for the specific sync failure:
redis-cli -h <host> -p <port> --latency-history
redis-cli -h <host> -p <port> --statFor Docker containers:
docker logs <container-id> | grep -i "sync\|repl\|connect"Common issues: replication ID mismatches, insufficient backlog, or TLS/authentication failures.
If using a multi-tier replication chain (A → B → C), consider flattening it so all replicas connect directly to the master:
Before:
A (master)
└── B (replica of A)
└── C (replica of B)After:
A (master)
├── B (replica of A)
└── C (replica of A)This eliminates the single point of failure and the "not connected" error cascade.
Advanced notes
In Kubernetes environments using the redis-operator or bitnami/redis Helm chart, ensure the service endpoints are correctly configured and network policies allow pod-to-pod communication. When using Sentinel for automatic failover, verify that down-after-milliseconds and failover-timeout are properly tuned to avoid cascading failures during master elections. If you see this error during a failover, check that the SLAVEOF NO ONE command on the promoted node completes before replicas attempt to resync. For very large datasets, the RDB transfer itself can take considerable time—increase timeout values accordingly. Additionally, some older Redis versions had bugs in PSYNC negotiation; upgrade to Redis 6.0+ if possible.
Frequently asked questions
- What does "ERR Can't SYNC while not connected" mean?
- In Redis replication, replicas sync data from a master node. This error specifically indicates that a replica is trying to execute a SYNC command against a node that is configured as a replica but is not currently connected to its own master. This creates a broken synchronization chain where data cannot flow properly.
- How do I fix "ERR Can't SYNC while not connected"?
- This error occurs when a Redis replica attempts to synchronize with a master that is itself a replica but has lost its own master connection. Fixing it requires ensuring proper master configuration and network connectivity in your replication topology.
- What causes "ERR Can't SYNC while not connected"?
- Master connection lost in chained replication topology (A → B → C) where B loses connection to A, preventing C from syncing with B Improper failover configuration where a promoted replica is not fully disconnected from its previous master Network connectivity issues between the replica and its configured master
- Is the "ERR Can't SYNC while not connected" error serious?
- Yes. This is a high-severity error that usually blocks work until it is fixed, but the steps above resolve it.
Official resources & further reading
- 📚Redis Official Documentation
- 📖Redis Official - Replication Documentation(Official Docs)
- 📖Redis Official - SYNC Command Reference(Official Docs)
- 🐙
- 🐙
- 🐙