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

  1. All replica set members are in an election and no primary exists yet
  2. Primary is down and the driver cannot find a replacement
  3. Server selection timeout expired before a primary was found
  4. Network partition isolating the client from the primary

Diagnostic Steps