43 — CursorNotFound
querytimeout
The server-side cursor has expired or does not exist
What is happening?
CursorNotFound is returned when the client tries to getMore from a cursor that the server no longer holds. Server-side cursors are cleaned up after the cursor lifetime expires (default 10 minutes of inactivity), after a primary failover, or when the cursor's originating mongos/mongod restarts. Long-running iteration, network interruptions, or replica set elections can all trigger this.
Common causes
- Iterating a large result set slower than the cursor timeout (default 10 min)
- Primary election or mongos restart invalidating open cursors
- Application paused (GC, deployment) between getMore calls
- Cursor was explicitly killed by another operation or db.killCursors()
- Using a cursor ID from a different connection or session