MongoDB Errors

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

531ExtensionUnsupportedCapabilityVersion
Extension Unsupported Capability Version — MongoDB error code 531
ExtensionError
532PrepareConflict
Prepare Conflict — MongoDB error code 532
concurrency
533StreamProcessorEventBridgeConnectionError
Stream Processor Event Bridge Connection Error — MongoDB error code 533
networking
534StreamProcessorPreviewSuperseded
Stream Processor Preview Superseded — MongoDB error code 534
StreamProcessorUserErrorStreamProcessorRetryableError
535ReshardingPreconditionFailure
Resharding Precondition Failure — MongoDB error code 535
sharding
536ReshardingPostconditionFailure
Resharding Postcondition Failure — MongoDB error code 536
sharding
537ChangeStreamEndOfTransactionBackfillRequired
Change Stream End Of Transaction Backfill Required — MongoDB error code 537
transaction
539ChangeStreamResumedTokenFilteredOut
Change Stream Resumed Token Filtered Out — MongoDB error code 539
540ChangeStreamErrorEventBypass
Change Stream Error Event Bypass — MongoDB error code 540
InternalOnly
9001SocketException
A TCP socket-level error occurred during network communication
networkingconnectivity
9996OBSOLETE_RecvStaleConfig
OBSOLETE Recv Stale Config — MongoDB error code 9996
sharding
10003CannotGrowDocumentInCappedNamespace
Cannot Grow Document In Capped Namespace — MongoDB error code 10003
10058LegacyNotPrimary
Legacy Not Primary — MongoDB error code 10058
replication
10107NotWritablePrimary
A write was attempted on a member that is not the primary
replicationwrite
10334BSONObjectTooLarge
The document exceeds the maximum BSON size (16 MB)
writestorage
11000DuplicateKey
An operation violated a unique index constraint
writeindexconstraint
11600InterruptedAtShutdown
The operation was interrupted because the server is shutting down
replicationconnectivity
11601Interrupted
The operation was interrupted by a killOp or similar mechanism
queryconcurrency
11602InterruptedDueToReplStateChange
The operation was interrupted by a replica set state change
replicationconnectivity
12586BackgroundOperationInProgressForDatabase
Background Operation In Progress For Database — MongoDB error code 12586
12587BackgroundOperationInProgressForNamespace
Background Operation In Progress For Namespace — MongoDB error code 12587
13104OBSOLETE_PrepareConfigsFailed
OBSOLETE Prepare Configs Failed — MongoDB error code 13104
13113MergeStageNoMatchingDocument
Merge Stage No Matching Document — MongoDB error code 13113
13297DatabaseDifferCase
Database Differ Case — MongoDB error code 13297
13388StaleConfig
The shard's cached routing information is stale
sharding
13435NotPrimaryNoSecondaryOk
A read was attempted that requires the primary, but none is available
replicationquery
13436NotPrimaryOrSecondary
The node is not primary or secondary — it cannot service requests
replicationconnectivity
14031OutOfDiskSpace
Out Of Disk Space — MongoDB error code 14031
17280OBSOLETE_KeyTooLong
OBSOLETE Key Too Long — MongoDB error code 17280
28769NamespaceCannotBeSharded
Namespace Cannot Be Sharded — MongoDB error code 28769
sharding
31082SearchNotEnabled
Search Not Enabled — MongoDB error code 31082
40413IDLDuplicateField
IDLDuplicate Field — MongoDB error code 40413
IDLParseError
40414IDLFailedToParse
IDLFailed To Parse — MongoDB error code 40414
IDLParseError
40415IDLUnknownField
IDLUnknown Field — MongoDB error code 40415
IDLParseError
46841ClientMarkedKilled
Client Marked Killed — MongoDB error code 46841
queryreplication
50768NotARetryableWriteCommand
Not ARetryable Write Command — MongoDB error code 50768
write
50915BackupCursorOpenConflictWithCheckpoint
Backup Cursor Open Conflict With Checkpoint — MongoDB error code 50915
concurrencyquery
56846ConfigServerUnreachable
Config Server Unreachable — MongoDB error code 56846
57986RetryableInternalTransactionNotSupported
Retryable Internal Transaction Not Supported — MongoDB error code 57986
transaction
91331RetriableRemoteCommandFailure
Retriable Remote Command Failure — MongoDB error code 91331
replication
640570IllegalChangeToExpectedShardVersion
Illegal Change To Expected Shard Version — MongoDB error code 640570
sharding
640571IllegalChangeToExpectedDatabaseVersion
Illegal Change To Expected Database Version — MongoDB error code 640571
1003141RemoveShardDrainingInProgress
Remove Shard Draining In Progress — MongoDB error code 1003141
shardingwrite
4662500IDLUnknownFieldPossibleMongocryptd
IDLUnknown Field Possible Mongocryptd — MongoDB error code 4662500
IDLParseError
4938500IndexNotFoundCachedPlan
Index Not Found Cached Plan — MongoDB error code 4938500
indexstorage
6371402EncryptedFindAndModifyNewNotSupported
Encrypted Find And Modify New Not Supported — MongoDB error code 6371402
query
9737301UnsupportedCbrNode
Unsupported Cbr Node — MongoDB error code 9737301
PlannerEstimationError
9751901HistogramCEFailure
Histogram CEFailure — MongoDB error code 9751901
PlannerEstimationError
9751902SamplingCEFailure
Sampling CEFailure — MongoDB error code 9751902
PlannerEstimationError
9751903CEFailure
CEFailure — MongoDB error code 9751903
PlannerEstimationError