Docs Menu
Docs Home
/
MongoDB Manual
/

Exit Codes and Statuses

MongoDB will return one of the following codes and statuses when exiting. Use this guide to interpret logs and when troubleshooting issues with mongod and mongos instances.

Code
Cause
0
Returned by MongoDB applications upon successful exit.
1
Returned by mongod as a generic failure when no other error codes apply.
2
The specified options are in error or are incompatible with other options.
3
Returned by mongod if there is a mismatch between hostnames specified on the command line and in the local.sources collection when running a replica set.
4
The version of the database is different from the version supported by the mongod (or mongod.exe) instance. The instance exits cleanly.
5
Returned by mongos if a problem is encountered during initialization.
12
Returned by the mongod.exe process on Windows when it receives a Control-C, Close, Break or Shutdown event.
14
Returned by MongoDB applications which encounter an unrecoverable error, an uncaught exception or uncaught signal. The system exits without performing a clean shutdown.
20

Message: ERROR: wsastartup failed <reason>

Returned by MongoDB applications on Windows following an error in the WSAStartup function, used to initialize the networking subsystem.

Message: NT Service Error

Returned by MongoDB applications for Windows due to failures installing, starting or removing the NT Service for the application.

48
Returned by mongod or mongos when an error prevents a newly started instance from listening for incoming connections.
50
Returned by mongod during server initialization if it fails to fork the process.
51
Returned by mongod during server initialization if the daemon fails to send a ready signal. The process exits cleanly.
61
Returned by the Storage Node Watchdog if any of the filesystems with monitored directories are unresponsive.
62

Returned by mongod when the datafiles in --dbpath are incompatible with the version of mongod currently running.

To resolve data incompatibility issues after upgrading, please refer to the release notes for your version of MongoDB and search for "Changes Affecting Compatibility."

87
Returned by mongod or mongos when the process health check triggers a crash.
100
Returned by mongod when the process throws an uncaught exception.
102
Returned by mongod or mongos when the process fails to rotate audit logs on startup.

Back

Default MongoDB Read Concerns/Write Concerns