Skip to content

Commit dc880dc

Browse files
author
Ed Costello
committed
DOCS-83 Document exit codes
1 parent fc65776 commit dc880dc

14 files changed

+256
-0
lines changed

source/reference/exit-codes.txt

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
============================
2+
MongoDB Exit and Error Codes
3+
============================
4+
5+
.. errors::
6+
7+
.. include:: /reference/exit-codes/exit_clean.txt
8+
:start-after: mongod
9+
10+
.. include:: /reference/exit-codes/exit_bad_options.txt
11+
:start-after: mongod
12+
13+
.. include:: /reference/exit-codes/exit_replication_error.txt
14+
:start-after: mongod
15+
16+
.. include:: /reference/exit-codes/exit_need_upgrade.txt
17+
:start-after: mongod
18+
19+
.. include:: /reference/exit-codes/exit_sharding_error.txt
20+
:start-after: mongod
21+
22+
.. include:: /reference/exit-codes/exit_kill.txt
23+
:start-after: mongod
24+
25+
.. include:: /reference/exit-codes/exit_abrupt.txt
26+
:start-after: mongod
27+
28+
.. include:: /reference/exit-codes/exit_ntservice_error.txt
29+
:start-after: mongod
30+
31+
.. include:: /reference/exit-codes/exit_ntservice_error.txt
32+
:start-after: mongod
33+
34+
.. include:: /reference/exit-codes/exit_fs.txt
35+
:start-after: mongod
36+
37+
.. include:: /reference/exit-codes/exit_clock_skew.txt
38+
:start-after: mongod
39+
40+
.. include:: /reference/exit-codes/exit_net_error.txt
41+
:start-after: mongod
42+
43+
.. include:: /reference/exit-codes/exit_windows_service_stop.txt
44+
:start-after: mongod
45+
46+
.. include:: /reference/exit-codes/exit_uncaught.txt
47+
:start-after: mongod
48+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
==============
2+
14 Abrupt Exit
3+
==============
4+
5+
.. default-domain:: mongodb
6+
7+
.. error:: 14
8+
9+
Returned by MongoDB applications which encounter an unrecoverable
10+
error, an uncaught exception or uncaught signal. The system exits
11+
without performing a clean shut down.
12+
13+
.. symbol: EXIT_ABRUPT = 14
14+
.. mongo/src/mongo/client/mongo_client_lib.cpp
15+
.. mongo/src/mongo/db/db.cpp
16+
.. mongo/src/mongo/s/server.cpp
17+
.. mongo/src/mongo/util/exit_code.h
18+
.. mongo/src/mongo/util/signal_handlers.cpp
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
========================
2+
2 Bad Options
3+
========================
4+
5+
.. default-domain:: mongodb
6+
7+
.. error:: 2
8+
9+
The specified options are in error or are incompatible
10+
with other options.
11+
12+
.. symbol: EXIT_BADOPTIONS 2
13+
14+
.. /Users/epc/Documents/github/epc/mongo/src/mongo/db/db.cpp
15+
.. /Users/epc/Documents/github/epc/mongo/src/mongo/db/repl.cpp
16+
.. /Users/epc/Documents/github/epc/mongo/src/mongo/dbtests/framework.cpp
17+
.. /Users/epc/Documents/github/epc/mongo/src/mongo/s/config.cpp
18+
.. /Users/epc/Documents/github/epc/mongo/src/mongo/shell/dbshell.cpp
19+
.. /Users/epc/Documents/github/epc/mongo/src/mongo/tools/tool.cpp
20+
.. /Users/epc/Documents/github/epc/mongo/src/mongo/util/ntservice.cpp
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
============
2+
0 Clean exit
3+
============
4+
5+
.. default-domain:: mongodb
6+
7+
.. error:: 0
8+
9+
Returned by MongoDB applications upon successful exit.
10+
11+
.. symbol: EXIT_CLEAN
12+
.. ./src/mongo/db/db.cpp
13+
.. ./src/mongo/db/dbcommands_generic.cpp
14+
.. ./src/mongo/dbtests/framework.cpp
15+
.. ./src/mongo/s/server.cpp
16+
.. ./src/mongo/shell/dbshell.cpp
17+
.. ./src/mongo/tools/restore.cpp
18+
.. ./src/mongo/tools/tool.cpp
19+
.. ./src/mongo/util/ntservice.cpp
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
===============
2+
47 Clock Skewed
3+
===============
4+
5+
.. default-domain:: mongodb
6+
7+
.. error:: 47
8+
9+
MongoDB applications exit cleanly if a large clock skew (32768
10+
milliseconds) occurs.
11+
12+
.. symbol: EXIT_CLOCK_SKEW
13+
.. mongo/src/mongo/db/db.cpp
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
===================
2+
45 Cannot open file
3+
===================
4+
5+
.. default-domain:: mongodb
6+
7+
.. error:: 45
8+
9+
Returned when a MongoDB application cannot open a file or cannot
10+
obtain a lock on a file.
11+
12+
.. Symbol: EXIT_FS
13+
.. found-in: mongo/db/namespace_details.cpp:192
14+
.. found-in: mongo/tools/tool.cpp:238
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
===================
2+
12 Killed (Windows)
3+
===================
4+
5+
.. default-domain:: mongodb
6+
7+
.. error: 12
8+
9+
Returned by the :program:`mongod.exe` process on Windows when it
10+
receives a Control-C, Close, Break or Shutdown event.
11+
12+
.. symbol: EXIT_KILL = 12
13+
.. mongo/src/mongo/db/db.cpp
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
================================
2+
4 Database Format Upgrade Needed
3+
================================
4+
5+
.. default-domain:: mongodb
6+
7+
.. error: 4
8+
9+
The version of the database is different from the version supported
10+
by the :program:`mongod` (or :program:`mongod.exe`) instance. The
11+
instance exits cleanly. Restart :program:`mongod` with the
12+
:option:`--upgrade <mongod --upgrade>` option to upgrade the
13+
database to the version supported by this :program:`mongod`
14+
instance.
15+
16+
.. symbol: EXIT_NEED_UPGRADE = 4
17+
.. mongo/src/mongo/db/db.cpp
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
================
2+
48 Network Error
3+
================
4+
5+
.. default-domain:: mongodb
6+
7+
.. error:: 48
8+
9+
:program:`mongod` exits cleanly if the server socket (either
10+
`27017` or the port specified with :option:`--port <mongod --port>`).
11+
12+
13+
.. symbol: EXIT_NET_ERROR = 48 ,
14+
.. mongo/src/mongo/s/server.cpp
15+
.. mongo/src/mongo/db/db.cpp
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
==============================
2+
20 NT Service Errors (Windows)
3+
==============================
4+
5+
.. default-domain:: mongodb
6+
7+
:program:`mongod.exe` returns this error code for multiple errors.
8+
9+
.. error:: 20 ERROR: wsastartup failed {reason}
10+
11+
Returned by MongoDB applications on Windows due to an error in the
12+
WSAStartup function.
13+
14+
.. error:: 20 NT Service Error
15+
16+
Returned by MongoDB applications for Windows due to failures installing,
17+
starting or removing the NT Service for the application.
18+
19+
.. symbol: EXIT_NTSERVICE_ERROR = 20
20+
21+
.. mongo/src/mongo/util/net/sock.cpp
22+
.. mongo/src/mongo/util/ntservice.cpp

0 commit comments

Comments
 (0)