MongoDB: We are too stale to use X as a sync source / replSet too stale to catch up — member in RECOVERING state
A secondary fell so far behind that the primary's oplog no longer covers the gap, so it can't resync by replaying.
We are too stale to use as a sync sourcetoo stale to catch up -- entering maintenance modereplSet too stale to catch upRECOVERING member too stale to catch upOur last optime fetched is stale Meaning
The member needs a full initial sync: stop it, delete its data directory, and restart so it resyncs from another member. Prevent it by sizing the oplog for your write rate and downtime window (replSetResizeOplog), and monitoring replication lag.
Common causes
- Oplog window too small for the outage duration
- Secondary offline for too long
- Heavy write bursts
- Slow disk/network on the secondary
- Delayed member misconfigured
⚡ Quick fix
- Stop the member, clear its dbPath, restart for initial sync
db.adminCommand({replSetResizeOplog: 1, size: 16384})on the primary- Alert on replication lag and oplog window
Detailed fix by platform
mongosh
rs.printReplicationInfo()andrs.printSecondaryReplicationInfo()
How to diagnose
- Lag — Seconds behind?
- Oplog — Window hours?
- Member — RECOVERING?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- AlreadyInitialized: already initialized MongoServerError: already initialized (rs.initiate on a configured replica set)
- Could not find host matching read preference MongoServerSelectionError: Could not find host matching read preference { mode: "secondary" } for set rs0
- No primary found in replica set / ReplicaSetNoPrimary MongoServerSelectionError: Server selection timed out after 30000 ms — topology type ReplicaSetNoPrimary
Most viewed in MongoDB
- Document failed validation MongoDB: MongoServerError: Document failed validation (code 121)
- MongoParseError MongoDB: MongoParseError: Invalid scheme, expected connection string to start with "mongodb://" or "mongodb+srv://"
- bad auth : Authentication failed MongoDB: MongoServerError: bad auth : Authentication failed (code 8000 / 18)
Other ways to find it
Where this error sits
Origin: Data. Errors that are often confused with or caused by this one (click to open):
🧠 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.
Report a correction or suggest an improvement
Last updated 5 Nov 2026