mongodb connection_error ai_generated true

MongoNetworkTimeoutError: connection timed out

ID: mongodb/network-timeout

Also available as: JSON · Markdown
78%Fix Rate
82%Confidence
3Evidence
2023-01-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
7 active

Root Cause

Network timeout connecting to mongod/mongos.

generic

Workarounds

  1. 88% success Check network connectivity and DNS resolution to MongoDB host
  2. 85% success Tune connectTimeoutMS and serverSelectionTimeoutMS appropriately

Dead Ends

Common approaches that don't work:

  1. Set socketTimeoutMS to 0 (infinite) 85% fail

    Hangs forever on dead connections

  2. Retry immediately in loop 78% fail

    Overwhelms recovering server