READONLY You can't write against a read only replica Redis Origin: Data OSI layer 7 · Application Last updated 14 Oct 2026

Redis: READONLY You can't write against a read only replica

The client is connected to a replica (or a failed-over node) and tried to write.

Exact message you may see READONLY You can't write against a read only replicaread only slave
Seen on: Redis

Meaning

After a failover the old primary becomes a replica, clients with stale connections or a hard-coded host keep writing to it. Use Sentinel/cluster-aware clients or the managed primary endpoint.

Common causes

  • Connected to a replica host/port
  • Failover happened, client still on old primary
  • Read-only endpoint used for writes (managed Redis)

⚡ Quick fix

  1. Use the primary/write endpoint
  2. Use Sentinel or cluster-aware client configuration
  3. Reconnect clients after failover

Detailed fix by platform

Shell

  1. redis-cli -h $HOST INFO replication | grep role

How to diagnose

  1. Role — master or slave/replica?
  2. Endpoint — Primary or reader?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Data. Errors that are often confused with or caused by this one (click to open):

1418 — MySQL ERROR 1418 (HY000): This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (MySQL)1418MASTERDOWN Link with MASTER is down and replica-serve-stale-data is set to no — Redis replica: (error) MASTERDOWN Link with MASTER is down and replica-serve-stale-data is set to 'no' (Redis)MASTERDOWN Link with …MISCONF — Redis: MISCONF Redis is configured to save RDB snapshots, but it's currently unable to persist to disk (Redis)MISCONFNOAUTH — ReplyError: NOAUTH Authentication required. (Node.js)NOAUTHNOPERM this user has no permissions to run the command — Redis ACL: (error) NOPERM this user has no permissions to run the 'flushall' command or its subcommand (Redis)NOPERM this user has …NotWritablePrimary: not primary and secondaryOk=false — MongoServerError: not primary and secondaryOk=false / NotWritablePrimary: not master (MongoDB)NotWritablePrimary: n…OOM command not allowed — Redis: OOM command not allowed when used memory > 'maxmemory' (Redis)OOM command not allow…Replica full resync loop (output buffer / timeout) — Redis: Client id=7 scheduled to be closed ASAP for overcoming of output buffer limits (replica) / MASTER <-> REPLICA sync: Timeout (Redis)Replica full resync l…READONLY …

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.