Exit Codes and Statuses

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

CodeCause
- 0-Returned by MongoDB applications upon successful exit.
- 2-The specified options are in error or are incompatiblewith other options.
- 3-Returned by mongod if there is a mismatchbetween hostnames specified on the command line and in thelocal.sources collection, in master/slave mode.
- 4-The version of the database is different from the versionsupported by the mongod (ormongod.exe) instance. The instance exitscleanly.
- 5-Returned by mongos if a problem is encounteredduring initialization.
- 12-Returned by the mongod.exe process on Windowswhen it receives a Control-C, Close, Break or Shutdown event.
- 14-Returned by MongoDB applications which encounter anunrecoverable 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 errorin the WSAStartup function, used to initialize the networkingsubsystem.Message: NT Service ErrorReturned by MongoDB applications for Windows due to failuresinstalling, starting or removing the NT Service for theapplication.
- 48-A newly started mongod or mongoscould not start listening for incoming connections, due to anerror.
- 62-Returned by mongod if the datafiles in—dbpath are incompatible with theversion of mongod currently running.
- 100-Returned by mongod when the process throws anuncaught exception.