<!-- llms-explorer concept facts · https://llms-explorer.com/tree/error-codes-and-troubleshooting-failure-scenarios/ · pack 2026-10-15 · ~5814 tokens -->

# Error Codes and Troubleshooting Failure Scenarios

> Depth-first rabbithole dossier for Error Codes and Troubleshooting Failure Scenarios; source-anchored research pack.

Parent: [Error Codes and Troubleshooting](https://llms-explorer.com/tree/error-codes-and-troubleshooting/) · 5 facets · 56 facts · page: https://llms-explorer.com/tree/error-codes-and-troubleshooting-failure-scenarios/

## Definitions

- [low] If the operation to roll back is a collection drop or a document deletion, the rollback of that operation is not written to the rollback data directory. Sources: https://www.mongodb.com/docs/manual/core/replica-set-rollbacks.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`

## How it works

- [low] When the primary detects that it can only see a minority of voting nodes in the replica set, the primary steps down and becomes a secondary. Sources: https://www.mongodb.com/docs/manual/core/replica-set-elections.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [high] MongoDB attempts to avoid rollbacks, which should be rare, and when a rollback does occur, it is often the result of a network partition. Sources: https://www.mongodb.com/docs/manual/core/replica-set-rollbacks.md, https://www.percona.com/blog/mongodb-rollback-in-replicaset/ — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] Applications might encounter server selection timeout errors when attempting to connect to a MongoDB deployment. Sources: https://www.mongodb.com/docs/manual/troubleshooting/server-selection-timeout.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] Write-heavy workloads, too many indexes, or maintenance processes taking up significant disk space can overwhelm nodes and cause them to crash. Sources: https://www.mongodb.com/docs/manual/troubleshooting/replica-set-no-primary.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] In a three-member replica set, taking two members down for maintenance simultaneously causes the replica set to lose its majority and prevents electing a new primary until the third member is back up. Sources: https://www.mongodb.com/docs/manual/troubleshooting/replica-set-no-primary.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] Starting in version 4.2, MongoDB kills all in-progress user operations when a member enters the ROLLBACK state. (verified as of 2026-10-15) Sources: https://www.mongodb.com/docs/manual/core/replica-set-rollbacks.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`

## Measurements and reference values

- [high] When using the rollback algorithm that limits data size, MongoDB can only roll back up to 300 MB of data. Sources: https://www.mongodb.com/docs/manual/core/replica-set-rollbacks.md, https://www.percona.com/blog/mongodb-rollback-in-replicaset/ — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`

## Problems, failure modes and limitations

- [low] mongod returns a generic failure error code when no other specific error codes apply. Sources: https://www.mongodb.com/docs/manual/reference/exit-codes.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] mongod returns an error if there is a mismatch between hostnames specified on the command line and in the local.sources collection when running a replica set. Sources: https://www.mongodb.com/docs/manual/reference/exit-codes.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] MongoDB applications return an error and exit without a clean shutdown when encountering an unrecoverable error, uncaught exception, or uncaught signal. Sources: https://www.mongodb.com/docs/manual/reference/exit-codes.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] MongoDB applications for Windows return the message 'NT Service Error' due to failures installing, starting, or removing the NT Service for the application. Sources: https://www.mongodb.com/docs/manual/reference/exit-codes.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] Starting in MongoDB 9.0, if a query operation exceeds the per-operation memory limit and cannot spill to disk, MongoDB ends the operation with the ExceededMemoryLimit error. (verified as of 2026-10-15) Sources: https://www.mongodb.com/docs/manual/reference/log-messages.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] If a stage that can spill to disk exceeds the memory limit and allowDiskUse is false, MongoDB ends the operation with the QueryExceededMemoryLimitNoDiskUseAllowed error. Sources: https://www.mongodb.com/docs/manual/reference/log-messages.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] There is no specific error code for replication lag, and no immediate way to determine its cause. Sources: https://www.mongodb.com/docs/manual/troubleshooting/replication-lag.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] The error message 'MongoServerSelectionError: getaddrinfo ENOTFOUND' indicates a DNS resolution failure during server selection. Sources: https://www.mongodb.com/docs/manual/troubleshooting/server-selection-timeout.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] The error message 'No suitable servers found (serverSelectionTryOnce set): [Failed to resolve '<my-database-host>]' indicates a failure to resolve the database host. Sources: https://www.mongodb.com/docs/manual/troubleshooting/server-selection-timeout.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] mongos returns an error if a problem is encountered during initialization. Sources: https://www.mongodb.com/docs/manual/reference/exit-codes.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] The mongod.exe process on Windows returns an error when it receives a Control-C, Close, Break, or Shutdown event. Sources: https://www.mongodb.com/docs/manual/reference/exit-codes.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] MongoDB applications on Windows return the message 'ERROR: wsastartup failed <reason>' following an error in the WSAStartup function used to initialize the networking subsystem. Sources: https://www.mongodb.com/docs/manual/reference/exit-codes.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] mongod or mongos returns an error when an error prevents a newly started instance from listening for incoming connections. Sources: https://www.mongodb.com/docs/manual/reference/exit-codes.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] mongod returns an error during server initialization if it fails to fork the process. Sources: https://www.mongodb.com/docs/manual/reference/exit-codes.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] mongod returns an error during server initialization if the daemon fails to send a ready signal, causing the process to exit cleanly. Sources: https://www.mongodb.com/docs/manual/reference/exit-codes.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] The Storage Node Watchdog returns an error if any of the filesystems with monitored directories are unresponsive. Sources: https://www.mongodb.com/docs/manual/reference/exit-codes.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] mongod returns an error when the datafiles in --dbpath are incompatible. Sources: https://www.mongodb.com/docs/manual/reference/exit-codes.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] mongod or mongos returns an error when the process health check triggers a crash. Sources: https://www.mongodb.com/docs/manual/reference/exit-codes.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] mongod or mongos returns an error when the process fails to rotate audit logs on startup. Sources: https://www.mongodb.com/docs/manual/reference/exit-codes.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] Secondaries that cannot keep up with the throughput of operations on the former primary increase the size and impact of the rollback. Sources: https://www.mongodb.com/docs/manual/core/replica-set-rollbacks.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] Starting in MongoDB 6.2, the server does not retry the transaction if it receives a TransactionTooLargeForCache error. (verified as of 2026-10-15) Sources: https://www.mongodb.com/docs/manual/core/transactions-in-applications.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] The error message 'MongoTimeoutError: Server selection timed out after 30000 ms' indicates a server selection timeout. Sources: https://www.mongodb.com/docs/manual/troubleshooting/server-selection-timeout.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] The error message 'MongoServerSelectionError: connection timed out' indicates a connection timeout during server selection. Sources: https://www.mongodb.com/docs/manual/troubleshooting/server-selection-timeout.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] Replica sets can enter a state where no primary exists, typically during elections, and cannot accept writes if this state persists for an extended period. Sources: https://www.mongodb.com/docs/manual/troubleshooting/replica-set-no-primary.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] The error message 'we received insufficient votes' indicates that a majority of nodes did not respond to the election request, possibly due to down members or a network partition. Sources: https://www.mongodb.com/docs/manual/troubleshooting/replica-set-no-primary.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] The error message 'can't see a majority of the set, relinquishing primary' indicates that members might be down or a network partition might have occurred. Sources: https://www.mongodb.com/docs/manual/troubleshooting/replica-set-no-primary.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] In a deployment with two data-bearing members and one hidden non-voting node, if one data-bearing member fails, the remaining members cannot form a majority. Sources: https://www.mongodb.com/docs/manual/troubleshooting/replica-set-no-primary.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] The error 'connection refused because too many open connections' indicates that the maximum number of concurrent incoming connections per node has been reached. Sources: https://www.mongodb.com/docs/manual/troubleshooting/connection-storms.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] If a secondary node cannot flush dirty data to disk quickly enough, it falls behind the primary, a phenomenon that occurs when the volume of writes from the primary exceeds the secondary's disk write speed. Sources: https://www.mongodb.com/docs/manual/troubleshooting/replication-lag.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] If a deployment experiences a network partition, nodes cannot communicate with each other, preventing them from electing a primary. Sources: https://www.mongodb.com/docs/manual/troubleshooting/replica-set-no-primary.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] Without wtimeout set on write operations, writes block indefinitely if the write concern cannot be satisfied. Sources: https://www.mongodb.com/docs/manual/troubleshooting/replica-set-no-primary.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] In a primary-secondary-secondary-secondary-arbiter (PSSSA) topology, placing a majority of voting members in a single data center or disaster recovery site creates a risk of majority loss. Sources: https://www.mongodb.com/docs/manual/troubleshooting/replica-set-no-primary.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`

## Facts and statements

- [low] A rollback does not occur if the write operations replicate to another member of the replica set before the primary steps down and that member remains available and accessible to a majority of the replica set. Sources: https://www.mongodb.com/docs/manual/core/replica-set-rollbacks.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] Server selection timeouts commonly occur due to network connectivity issues, IP access restrictions, DNS SRV resolution failures, or TLS configuration issues. Sources: https://www.mongodb.com/docs/manual/troubleshooting/server-selection-timeout.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] If the client reports errors such as ENOTFOUND or fails during SRV lookup, the environment may be unable to resolve DNS SRV records. Sources: https://www.mongodb.com/docs/manual/troubleshooting/server-selection-timeout.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] If a replica set's primary goes down and no secondary is elected, check that the remaining nodes are not all priority 0 members. Sources: https://www.mongodb.com/docs/manual/troubleshooting/replica-set-no-primary.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] If multiple voting members go down and the replica set loses its majority, rs.status() output may show that all members are in the SECONDARY or RECOVERING state. Sources: https://www.mongodb.com/docs/manual/troubleshooting/replica-set-no-primary.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] Connection storms often appear as sudden spikes in connection count and can be misdiagnosed as database performance issues. Sources: https://www.mongodb.com/docs/manual/troubleshooting/connection-storms.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] If a heartbeat does not return within 10 seconds, other replica set members mark the delinquent member as inaccessible. Sources: https://www.mongodb.com/docs/manual/core/replica-set-elections.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] A network partition may segregate a primary into a partition with a minority of nodes, preventing it from maintaining primary status. Sources: https://www.mongodb.com/docs/manual/core/replica-set-elections.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] In a distributed replica set, the loss of a data center may affect the ability of remaining members in other data centers to elect a primary. Sources: https://www.mongodb.com/docs/manual/core/replica-set-elections.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] Network latency may extend the time required for replica set elections to complete, affecting the duration the cluster operates without a primary. Sources: https://www.mongodb.com/docs/manual/core/replica-set-elections.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] A rollback is necessary only if the primary had accepted write operations that the secondaries had not successfully replicated before the primary stepped down. Sources: https://www.mongodb.com/docs/manual/core/replica-set-rollbacks.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [high] Data may be rolled back if the primary steps down before the write operations have replicated to any of the secondaries. Sources: https://www.mongodb.com/docs/manual/core/replica-set-rollbacks.md, https://jepsen.io/analyses/mongodb-4.2.6 — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] Long-running operations on the primary can block replication on secondaries in some cases. Sources: https://www.mongodb.com/docs/manual/troubleshooting/replication-lag.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] Bulk write operations can exceed a replica set's ability to replicate in a timely manner, causing replication lag. Sources: https://www.mongodb.com/docs/manual/troubleshooting/replication-lag.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] If the oplog window is too small for the amount of data being synced, replication lag may occur. Sources: https://www.mongodb.com/docs/manual/troubleshooting/replication-lag.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`
- [low] In a primary-secondary-arbiter (PSA) topology using 'majority' write concern, if the secondary goes down for maintenance, writes stall. Sources: https://www.mongodb.com/docs/manual/troubleshooting/replica-set-no-primary.md — source: `~/.global-ai-hub/research/.pipeline/mongodb-2026-10-14/frb/error-codes-and-troubleshooting-failure-scenarios-e22cc9520f/rabbithole-synthesis.md#troubleshooting`

## Related concepts

- Troubleshooting — is a part of Error Codes and Troubleshooting Failure Scenarios
- Error — is a part of Error Codes and Troubleshooting Failure Scenarios
- and — is a part of Error Codes and Troubleshooting Failure Scenarios
- Failure — is a part of Error Codes and Troubleshooting Failure Scenarios
- Codes — is a part of Error Codes and Troubleshooting Failure Scenarios
