MongoDB Errors

Browse server error codes and driver error classes with explanations and diagnostic guidance.

0OK
OK — MongoDB error code 0
1InternalError
Internal Error — MongoDB error code 1
2BadValue
A command argument or query operator has an invalid value
queryconfiguration
3OBSOLETE_DuplicateKey
OBSOLETE Duplicate Key — MongoDB error code 3
4NoSuchKey
No Such Key — MongoDB error code 4
5GraphContainsCycle
Graph Contains Cycle — MongoDB error code 5
6HostUnreachable
MongoDB cannot reach the target host
networkingconnectivity
7HostNotFound
DNS lookup failed for the target host
networkingconnectivity
8UnknownError
Unknown Error — MongoDB error code 8
9FailedToParse
Failed To Parse — MongoDB error code 9
10CannotMutateObject
Cannot Mutate Object — MongoDB error code 10
11UserNotFound
The specified user was not found in the database
authenticationauthorisation
12UnsupportedFormat
Unsupported Format — MongoDB error code 12
13Unauthorized
The client is not authorised to perform the requested operation
authenticationauthorisation
14TypeMismatch
A value has the wrong BSON type for the operation
queryconfiguration
15Overflow
Overflow — MongoDB error code 15
ValidationError
16InvalidLength
Invalid Length — MongoDB error code 16
17ProtocolError
Protocol Error — MongoDB error code 17
18AuthenticationFailed
Authentication credentials are invalid or the mechanism failed
authenticationauthorisation
19CannotReuseObject
Cannot Reuse Object — MongoDB error code 19
20IllegalOperation
The requested operation is not permitted in this context
configurationquery
21EmptyArrayOperation
Empty Array Operation — MongoDB error code 21
22InvalidBSON
Invalid BSON — MongoDB error code 22
ValidationErrorConnectionFatalMessageParseError
23AlreadyInitialized
Already Initialized — MongoDB error code 23
24LockTimeout
The operation could not acquire a lock within the timeout period
performanceconcurrency
25RemoteValidationError
Remote Validation Error — MongoDB error code 25
26NamespaceNotFound
The target collection or namespace does not exist
queryconfiguration
27IndexNotFound
Index Not Found — MongoDB error code 27
index
28PathNotViable
Path Not Viable — MongoDB error code 28
29NonExistentPath
Non Existent Path — MongoDB error code 29
30InvalidPath
Invalid Path — MongoDB error code 30
31RoleNotFound
Role Not Found — MongoDB error code 31
32RolesNotRelated
Roles Not Related — MongoDB error code 32
33PrivilegeNotFound
Privilege Not Found — MongoDB error code 33
authentication
34CannotBackfillArray
Cannot Backfill Array — MongoDB error code 34
35UserModificationFailed
User Modification Failed — MongoDB error code 35
36RemoteChangeDetected
Remote Change Detected — MongoDB error code 36
37FileRenameFailed
File Rename Failed — MongoDB error code 37
38FileNotOpen
File Not Open — MongoDB error code 38
39FileStreamFailed
File Stream Failed — MongoDB error code 39
40ConflictingUpdateOperators
Another conflicting operation is already in progress
configurationconcurrency
41FileAlreadyOpen
File Already Open — MongoDB error code 41
42LogWriteFailed
Log Write Failed — MongoDB error code 42
write
43CursorNotFound
The server-side cursor has expired or does not exist
querytimeout
45UserDataInconsistent
User Data Inconsistent — MongoDB error code 45
46LockBusy
A lock could not be acquired because it is already held
concurrencyperformance
47NoMatchingDocument
No Matching Document — MongoDB error code 47
48NamespaceExists
A collection or index with this name already exists
configurationwrite
49InvalidRoleModification
Invalid Role Modification — MongoDB error code 49
50MaxTimeMSExpired
The operation exceeded its maxTimeMS time limit
queryperformancetimeout