> This page location: /docs.md > /docs/development.md

> For the complete MongoDB documentation index, see www.mongodb.com/docs/llms.txt

# Error Codes

MongoDB returns one of the following codes when an error occurs. Use this guide to interpret [log messages](https://www.mongodb.com/docs/manual/reference/log-messages.md#std-label-log-messages-ref) and troubleshoot issues with [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) and [`mongos`](https://www.mongodb.com/docs/manual/reference/program/mongos.md#mongodb-binary-bin.mongos) instances.

| Code | Cause |
| --- | --- |
|  | InternalError |
|  | BadValue |
|  | NoSuchKey |
|  | GraphContainsCycle |
|  | HostUnreachable |
|  | HostNotFound |
|  | UnknownError |
|  | FailedToParse |
|  | CannotMutateObject |
|  | UserNotFound |
|  | UnsupportedFormat |
|  | Unauthorized |
|  | TypeMismatch |
|  | Overflow |
|  | InvalidLength |
|  | ProtocolError |
|  | AuthenticationFailed |
|  | CannotReuseObject |
|  | IllegalOperation |
|  | EmptyArrayOperation |
|  | InvalidBSON |
|  | AlreadyInitialized |
|  | LockTimeout |
|  | RemoteValidationError |
|  | NamespaceNotFound |
|  | IndexNotFound |
|  | PathNotViable |
|  | NonExistentPath |
|  | InvalidPath |
|  | RoleNotFound |
|  | RolesNotRelated |
|  | PrivilegeNotFound |
|  | CannotBackfillArray |
|  | UserModificationFailed |
|  | RemoteChangeDetected |
|  | FileRenameFailed |
|  | FileNotOpen |
|  | FileStreamFailed |
|  | ConflictingUpdateOperators |
|  | FileAlreadyOpen |
|  | LogWriteFailed |
|  | CursorNotFound |
|  | UserDataInconsistent |
|  | LockBusy |
|  | NoMatchingDocument |
|  | NamespaceExists |
|  | InvalidRoleModification |
|  | MaxTimeMSExpired |
|  | ManualInterventionRequired |
|  | DollarPrefixedFieldName |
|  | InvalidIdField |
|  | NotSingleValueField |
|  | InvalidDBRef |
|  | EmptyFieldName |
|  | DottedFieldName |
|  | RoleModificationFailed |
|  | CommandNotFound |
|  | ShardKeyNotFound |
|  | OplogOperationUnsupported |
|  | StaleShardVersion (*deprecated starting in 6.0*) |
|  | WriteConcernTimeout |
|  | MultipleErrorsOccurred |
|  | ImmutableField |
|  | CannotCreateIndex |
|  | IndexAlreadyExists |
|  | AuthSchemaIncompatible |
|  | ShardNotFound |
|  | ReplicaSetNotFound |
|  | InvalidOptions |
|  | InvalidNamespace |
|  | NodeNotFound |
|  | WriteConcernLegacyOK |
|  | NoReplicationEnabled |
|  | OperationIncomplete |
|  | CommandResultSchemaViolation |
|  | UnknownReplWriteConcern |
|  | RoleDataInconsistent |
|  | NoMatchParseContext |
|  | NoProgressMade |
|  | RemoteResultsUnavailable |
|  | IndexOptionsConflict |
|  | IndexKeySpecsConflict |
|  | CannotSplit |
|  | NetworkTimeout |
|  | CallbackCanceled |
|  | ShutdownInProgress |
|  | SecondaryAheadOfPrimary |
|  | InvalidReplicaSetConfig |
|  | NotYetInitialized |
|  | NotSecondary |
|  | OperationFailed |
|  | NoProjectionFound |
|  | DBPathInUse |
|  | UnsatisfiableWriteConcern |
|  | OutdatedClient |
|  | IncompatibleAuditMetadata |
|  | NewReplicaSetConfigurationIncompatible |
|  | NodeNotElectable |
|  | IncompatibleShardingMetadata |
|  | DistributedClockSkewed |
|  | LockFailed |
|  | InconsistentReplicaSetNames |
|  | ConfigurationInProgress |
|  | CannotInitializeNodeWithData |
|  | NotExactValueField |
|  | WriteConflict |
|  | InitialSyncFailure |
|  | InitialSyncOplogSourceMissing |
|  | CommandNotSupported |
|  | DocTooLargeForCapped |
|  | ConflictingOperationInProgress |
|  | NamespaceNotSharded |
|  | InvalidSyncSource |
|  | OplogStartMissing |
|  | DocumentValidationFailure (only for the document validator on collections) |
|  | NotAReplicaSet |
|  | IncompatibleElectionProtocol |
|  | CommandFailed |
|  | RPCProtocolNegotiationFailed |
|  | UnrecoverableRollbackError |
|  | LockNotFound |
|  | LockStateChangeFailed |
|  | SymbolNotFound |
|  | FailedToSatisfyReadPreference |
|  | ReadConcernMajorityNotAvailableYet |
|  | StaleTerm |
|  | CappedPositionLost |
|  | IncompatibleShardingConfigVersion |
|  | RemoteOplogStale |
|  | JSInterpreterFailure |
|  | InvalidSSLConfiguration |
|  | SSLHandshakeFailed |
|  | JSUncatchableError |
|  | CursorInUse |
|  | IncompatibleCatalogManager |
|  | PooledConnectionsDropped |
|  | ExceededMemoryLimit |
|  | ZLibError |
|  | ReadConcernMajorityNotEnabled |
|  | NoConfigPrimary |
|  | StaleEpoch |
|  | OperationCannotBeBatched |
|  | OplogOutOfOrder |
|  | ChunkTooBig |
|  | InconsistentShardIdentity |
|  | CannotApplyOplogWhilePrimary |
|  | CanRepairToDowngrade |
|  | MustUpgrade |
|  | DurationOverflow |
|  | MaxStalenessOutOfRange |
|  | IncompatibleCollationVersion |
|  | CollectionIsEmpty |
|  | ZoneStillInUse |
|  | InitialSyncActive |
|  | ViewDepthLimitExceeded |
|  | CommandNotSupportedOnView |
|  | OptionNotSupportedOnView |
|  | InvalidPipelineOperator |
|  | CommandOnShardedViewNotSupportedOnMongod |
|  | TooManyMatchingDocuments |
|  | CannotIndexParallelArrays |
|  | TransportSessionClosed |
|  | TransportSessionNotFound |
|  | TransportSessionUnknown |
|  | QueryPlanKilled |
|  | FileOpenFailed |
|  | ZoneNotFound |
|  | RangeOverlapConflict |
|  | WindowsPdhError |
|  | BadPerfCounterPath |
|  | AmbiguousIndexKeyPattern |
|  | InvalidViewDefinition |
|  | ClientMetadataMissingField |
|  | ClientMetadataAppNameTooLarge |
|  | ClientMetadataDocumentTooLarge |
|  | ClientMetadataCannotBeMutated |
|  | LinearizableReadConcernError |
|  | IncompatibleServerVersion |
|  | PrimarySteppedDown |
|  | MasterSlaveConnectionFailure |
|  | FailPointEnabled |
|  | NoShardingEnabled (*deprecated starting in 6.0*) |
|  | BalancerInterrupted |
|  | ViewPipelineMaxSizeExceeded |
|  | InvalidIndexSpecificationOption |
|  | ReplicaSetMonitorRemoved |
|  | ChunkRangeCleanupPending |
|  | CannotBuildIndexKeys |
|  | NetworkInterfaceExceededTimeLimit |
|  | ShardingStateNotInitialized |
|  | TimeProofMismatch |
|  | ClusterTimeFailsRateLimiter |
|  | NoSuchSession |
|  | InvalidUUID |
|  | TooManyLocks |
|  | StaleClusterTime |
|  | CannotVerifyAndSignLogicalTime |
|  | KeyNotFound |
|  | IncompatibleRollbackAlgorithm |
|  | DuplicateSession |
|  | AuthenticationRestrictionUnmet |
|  | DatabaseDropPending |
|  | ElectionInProgress |
|  | IncompleteTransactionHistory |
|  | UpdateOperationFailed |
|  | FTDCPathNotSet |
|  | FTDCPathAlreadySet |
|  | IndexModified |
|  | CloseChangeStream |
|  | IllegalOpMsgFlag |
|  | QueryFeatureNotAllowed |
|  | TransactionTooOld |
|  | AtomicityFailure |
|  | CannotImplicitlyCreateCollection |
|  | SessionTransferIncomplete |
|  | MustDowngrade |
|  | DNSHostNotFound |
|  | DNSProtocolError |
|  | MaxSubPipelineDepthExceeded |
|  | TooManyDocumentSequences |
|  | RetryChangeStream |
|  | InternalErrorNotSupported |
|  | ForTestingErrorExtraInfo |
|  | CursorKilled |
|  | NotImplemented |
|  | SnapshotTooOld |
|  | DNSRecordTypeMismatch |
|  | ConversionFailure |
|  | CannotCreateCollection |
|  | IncompatibleWithUpgradedServer |
|  | BrokenPromise |
|  | SnapshotUnavailable |
|  | ProducerConsumerQueueBatchTooLarge |
|  | ProducerConsumerQueueEndClosed |
|  | StaleDbVersion |
|  | StaleChunkHistory |
|  | NoSuchTransaction |
|  | ReentrancyNotAllowed |
|  | FreeMonHttpInFlight (*deprecated starting in 7.1*) |
|  | FreeMonHttpTemporaryFailure (*deprecated starting in 7.1*) |
|  | FreeMonHttpPermanentFailure (*deprecated starting in 7.1*) |
|  | TransactionCommitted |
|  | TransactionTooLarge |
|  | UnknownFeatureCompatibilityVersion |
|  | KeyedExecutorRetry |
|  | InvalidResumeToken |
|  | TooManyLogicalSessions |
|  | ExceededTimeLimit |
|  | OperationNotSupportedInTransaction |
|  | TooManyFilesOpen |
|  | OrphanedRangeCleanUpFailed |
|  | FailPointSetFailed |
|  | PreparedTransactionInProgress |
|  | CannotBackup |
|  | DataModifiedByRepair |
|  | RepairedReplicaSetNode |
|  | JSInterpreterFailureWithStack |
|  | MigrationConflict |
|  | ProducerConsumerQueueProducerQueueDepthExceeded |
|  | ProducerConsumerQueueConsumed |
|  | ExchangePassthrough |
|  | IndexBuildAborted |
|  | AlarmAlreadyFulfilled |
|  | UnsatisfiableCommitQuorum |
|  | ClientDisconnect |
|  | ChangeStreamFatalError |
|  | TransactionCoordinatorSteppingDown |
|  | TransactionCoordinatorReachedAbortDecision |
|  | WouldChangeOwningShard |
|  | ForTestingErrorExtraInfoWithExtraInfoInNamespace |
|  | IndexBuildAlreadyInProgress |
|  | ChangeStreamHistoryLost |
|  | TransactionCoordinatorDeadlineTaskCanceled |
|  | ChecksumMismatch |
|  | WaitForMajorityServiceEarlierOpTimeAvailable |
|  | TransactionExceededLifetimeLimitSeconds |
|  | NoQueryExecutionPlans |
|  | QueryExceededMemoryLimitNoDiskUseAllowed |
|  | InvalidSeedList |
|  | InvalidTopologyType |
|  | InvalidHeartBeatFrequency |
|  | TopologySetNameRequired |
|  | HierarchicalAcquisitionLevelViolation |
|  | InvalidServerType |
|  | OCSPCertificateStatusRevoked |
|  | RangeDeletionAbandonedBecauseCollectionWithUUIDDoesNotExist |
|  | DataCorruptionDetected |
|  | OCSPCertificateStatusUnknown |
|  | SplitHorizonChange |
|  | ShardInvalidatedForTargeting (*deprecated starting in 7.1*) |
|  | ReadThroughCacheLookupCanceled |
|  | RangeDeletionAbandonedBecauseTaskDocumentDoesNotExist |
|  | CurrentConfigNotCommittedYet |
|  | ExhaustCommandFinished |
|  | PeriodicJobIsStopped |
|  | TransactionCoordinatorCanceled |
|  | OperationIsKilledAndDelisted |
|  | ResumableRangeDeleterDisabled |
|  | ObjectIsBusy |
|  | TooStaleToSyncFromSource |
|  | QueryTrialRunCompleted |
|  | ConnectionPoolExpired |
|  | ForTestingOptionalErrorExtraInfo |
|  | MovePrimaryInProgress |
|  | TenantMigrationConflict |
|  | TenantMigrationCommitted |
|  | APIVersionError |
|  | APIStrictError |
|  | APIDeprecationError |
|  | TenantMigrationAborted |
|  | OplogQueryMinTsMissing |
|  | NoSuchTenantMigration |
|  | TenantMigrationAccessBlockerShuttingDown |
|  | TenantMigrationInProgress |
|  | SkipCommandExecution |
|  | FailedToRunWithReplyBuilder |
|  | CannotDowngrade |
|  | ServiceExecutorInShutdown |
|  | MechanismUnavailable |
|  | TenantMigrationForgotten |
|  | TimeseriesBucketCleared |
|  | AuthenticationAbandoned |
|  | ReshardCollectionInProgress |
|  | NoSuchReshardCollection |
|  | ReshardCollectionCommitted |
|  | ReshardCollectionAborted |
|  | ReshardingCriticalSectionTimeout |
|  | ShardCannotRefreshDueToLocksHeld |
|  | AuditingNotEnabled |
|  | RuntimeAuditConfigurationNotEnabled |
|  | ChangeStreamInvalidated |
|  | APIMismatchError |
|  | ChangeStreamTopologyChange (*deprecated starting in 8.3*) |
|  | KeyPatternShorterThanBound |
|  | ReshardCollectionTruncatedError |
|  | ChangeStreamStartAfterInvalidate |
|  | UnsupportedOpQueryCommand |
|  | LoadBalancerSupportMismatch |
|  | InterruptedDueToStorageChange |
|  | TxnRetryCounterTooOld |
|  | InvalidBSONType |
|  | InternalTransactionNotSupported |
|  | CannotConvertIndexToUnique |
|  | PlacementVersionRefreshCanceled |
|  | CollectionUUIDMismatch |
|  | FutureAlreadyRetrieved |
|  | RetryableTransactionInProgress |
|  | TemporarilyUnavailable |
|  | WouldChangeOwningShardDeletedNoDocument |
|  | FLECompactionPlaceholder |
|  | FLETransactionAbort |
|  | CannotDropShardKeyIndex |
|  | UserWritesBlocked |
|  | CloseConnectionForShutdownCommand |
|  | InternalTransactionsExhaustiveFindHasMore |
|  | TransactionAPIMustRetryTransaction |
|  | TransactionAPIMustRetryCommit |
|  | ChangeStreamNotEnabled (*deprecated starting in 8.3*) |
|  | FLEMaxTagLimitExceeded |
|  | NonConformantBSON |
|  | DatabaseMetadataRefreshCanceled |
|  | RequestAlreadyFulfilled |
|  | ReshardingCoordinatorServiceConflictingOperationInProgress |
|  | RemoteCommandExecutionError |
|  | CollectionIsEmptyLocally |
|  | ConnectionError |
|  | ConflictingServerlessOperation |
|  | DuplicateKeyId |
|  | EncounteredFLEPayloadWhileApplyingHmac |
|  | TransactionTooLargeForCache |
|  | LibmongocryptError |
|  | InvalidSignature |
|  | ReauthenticationRequired |
|  | InvalidJWT |
|  | InvalidTenantId |
|  | TruncatedSerialization |
|  | IndexInformationTooLarge |
|  | StreamTerminated |
|  | CannotUpgrade |
|  | ResourceExhausted |
|  | UnsupportedShardingEventNotification |
|  | LDAPRoleAcquisitionError |
|  | CannotCreateChunkDistribution |
|  | MigrationBlockingOperationCoordinatorCleaningUp |
|  | PooledConnectionAcquisitionExceededTimeLimit |
|  | CannotInsertTimeseriesBucketsWithMixedSchema |
|  | TimeseriesBucketCompressionFailed |
|  | TimeseriesBucketFrozen |
|  | QueryRejectedBySettings |
|  | UpdatesStillPending |
|  | TransactionParticipantFailedUnyield |
|  | AddOrRemoveShardInProgress |
|  | StreamProcessorDoesNotExist |
|  | StreamProcessorAlreadyExists |
|  | StreamProcessorWorkerShuttingDown |
|  | StreamProcessorWorkerOutOfMemory |
|  | StreamProcessorKafkaConnectionError |
|  | StreamProcessorInvalidOptions |
|  | StreamProcessorAtlasConnectionError |
|  | StreamProcessorAtlasUnauthorizedError |
|  | StreamProcessorSourceDocTooLarge |
|  | StreamProcessorTooManyOutputTargets |
|  | StreamProcessorCannotResumeFromSource |
|  | IndexIsEmpty |
|  | DbCheckSecondaryBatchTimeout |
|  | DbCheckAttemptOnClusteredCollectionIdIndex |
|  | DbCheckInconsistentHash |
|  | IndexKeyOrderViolation |
|  | ChunkMetadataInconsistency |
|  | OfflineValidationFailedToComplete |
|  | AdmissionQueueOverflow |
|  | NoDistinctScansForDistinctEligibleQuery |
|  | QueryStatsFailedToRecord |
|  | StreamProcessorHTTPSConnectionError |
|  | StreamProcessorExternalFunctionConnectionError |
|  | RetryMultiPlanning |
|  | StreamProcessorS3ConnectionError |
|  | StreamProcessorS3Error |
|  | DatabaseMetadataRefreshCanceledDueToFCVTransition |
|  | ClusterUMCErrorWithWriteConcernError |
|  | ObjectAlreadyExists |
|  | StreamProcessorInvalidNamespace |
|  | RateLimitExceeded |
|  | PooledConnectionAcquisitionRejected |
|  | StreamProcessorS3TokenExpired |
|  | ReleaseMemoryShardError |
|  | InterruptedDueToReshardingCriticalSection |
|  | ReplayClientConfigurationError |
|  | ReplayClientNotConnected |
|  | ReplayClientFailedToProcessBSON |
|  | ReplayClientInternalError |
|  | ReplayClientSessionSchedulerError |
|  | ReplayClientSessionSimulationError |
|  | StreamProcessorKinesisConnectionError |
|  | StreamProcessorKinesisError |
|  | IngressRequestRateLimitExceeded |
|  | StreamProcessorKinesisRetryableError |
|  | ShardRemovedError |
|  | PlacementHistoryInitializationInProgress |
|  | SchemaRegistryNonRetryableError |
|  | StreamProcessorRetryableIcebergError |
|  | StreamProcessorStartupRetryableError |
|  | SchemaRegistryConnectionError |
|  | StreamProcessorAtlasConnectionErrorDuringFirstStart |
|  | InterruptedDueToAddShard |
|  | InvalidBSONColumn |
|  | MaxNumberOfOrPlansExceeded |
|  | TooManyOpenTransactions |
|  | GeoKeyExtractionFailed |
|  | GeoKeyExtractionFailedTimeseries |
|  | WriteConflictRetryLimitExceeded |
|  | SocketException |
|  | CannotGrowDocumentInCappedNamespace |
|  | LegacyNotPrimary |
|  | NotWritablePrimary |
|  | BSONObjectTooLarge |
|  | DuplicateKey |
|  | InterruptedAtShutdown |
|  | Interrupted |
|  | InterruptedDueToReplStateChange |
|  | BackgroundOperationInProgressForDatabase |
|  | BackgroundOperationInProgressForNamespace |
|  | MergeStageNoMatchingDocument |
|  | DatabaseDifferCase |
|  | StaleConfig |
|  | NotPrimaryNoSecondaryOk |
|  | NotPrimaryOrSecondary |
|  | OutOfDiskSpace |
|  | NamespaceCannotBeSharded |
|  | SearchNotEnabled |
|  | IDLDuplicateField |
|  | IDLFailedToParse |
|  | IDLUnknownField |
|  | ClientMarkedKilled |
|  | NotARetryableWriteCommand |
|  | BackupCursorOpenConflictWithCheckpoint |
|  | ConfigServerUnreachable |
|  | RetryableInternalTransactionNotSupported |
|  | RetriableRemoteCommandFailure |
|  | IllegalChangeToExpectedShardVersion |
|  | IllegalChangeToExpectedDatabaseVersion |
|  | RemoveShardDrainingInProgress |
|  | IDLUnknownFieldPossibleMongocryptd |
|  | IndexNotFoundCachedPlan |
|  | EncryptedFindAndModifyNewNotSupported |
|  | UnsupportedCbrNode |
|  | HistogramCEFailure |
|  | SamplingCEFailure |
|  | CEFailure |
|  | InterruptedDueToFCVChange |
|  | ReadThroughCacheTimeMonotonicityViolation |
