13435 — NotPrimaryNoSecondaryOk
replicationquery
A read was attempted that requires the primary, but none is available
What is happening?
NotPrimaryNoSecondaryOk is returned when a read operation with readPreference=primary (the default) is attempted but no primary is available. This differs from NotWritablePrimary (10107) which is about writes — this error is specifically about reads that require the primary.
Common causes
- All replica set members are in an election and no primary exists yet
- Primary is down and the driver cannot find a replacement
- Server selection timeout expired before a primary was found
- Network partition isolating the client from the primary