MongoNetworkTimeoutError

Node.jsMongoNetworkErrorconnectivitynetworkingtimeout

A network operation timed out (socket timeout or connect timeout exceeded)

What is happening?

MongoNetworkTimeoutError is a subclass of MongoNetworkError that specifically indicates a timeout — either a socket read/write timeout or a connection establishment timeout. The driver closes the connection when this occurs.

Common causes

  1. socketTimeoutMS too low for long-running operations
  2. connectTimeoutMS too low for distant or slow servers
  3. Server overloaded and not responding within the timeout
  4. Network latency spike
  5. Large query result causing slow transfer
  6. Server-side operation blocking (e.g. lock contention)

Diagnostic Steps

Related Jira Issues