Error codes

Every error code TeselaDB can return, with its codeName and when each one appears.

The codes and codeName values are MongoDB's. The error document carries ok: 0, errmsg, code, codeName, the error's own fields and errorLabels when there are labels.

CodecodeNameWhen it appears
1InternalErrorAn unexpected internal failure.
2BadValueAn option or a value is not valid.
4NoSuchKeyA cluster parameter or an option that does not exist.
5GraphContainsCycleA view that reaches itself.
8UnknownErrorA search error with no code of its own, for example in the definition of a search index.
9FailedToParseThe command is malformed.
11UserNotFoundThe user does not exist.
12UnsupportedFormatA $clusterTime signature whose hash is not 20 bytes.
13UnauthorizedThe user lacks the privilege the command needs, or the OP_MSG carries a security token section.
14TypeMismatchA field of the command has the wrong BSON type.
15OverflowA document goes past MongoDB's nesting limit.
16InvalidLengthA write batch with no operations or too many.
17ProtocolErrorA SASL conversation that does not exist.
18AuthenticationFailedAuthentication failed.
20IllegalOperationThe target does not allow the operation, such as renaming a collection to itself.
22InvalidBSONThe BSON is not valid.
23AlreadyInitializedSomething is already set up another way, such as shardCollection with another key.
26NamespaceNotFoundThe collection is missing where one is required.
27IndexNotFoundAn index the query needs does not exist, such as $text without a text index.
28PathNotViableAn update cannot create that path in the document.
31RoleNotFoundThe role does not exist.
40ConflictingUpdateOperatorsTwo update operators on the same path, or on a path and its prefix.
43CursorNotFoundThe cursor expired, was killed or belongs to another node.
47NoMatchingDocumentA change stream lacks a pre- or post-image it requires.
48NamespaceExistscreate of a collection that already exists.
49InvalidRoleModificationA role change MongoDB refuses, such as a cycle or a privilege outside the role's database.
50MaxTimeMSExpiredmaxTimeMS expired.
52DollarPrefixedFieldNameA field name starting with $ where it is not allowed.
53InvalidIdFieldAn _id of a type a stored document cannot have.
54NotSingleValueFieldAn upsert whose filter sets the same path twice.
56EmptyFieldNameAn empty field name in a path.
59CommandNotFoundThe command does not exist.
61ShardKeyNotFoundA document whose shard key holds an array.
66ImmutableFieldA change of _id.
67CannotCreateIndexAn index specification with a version or an option that cannot be created.
68IndexAlreadyExistsA search index with the same name and another definition.
70ShardNotFoundkillOp naming a shard. TeselaDB has no shards.
72InvalidOptionsAn invalid combination of options.
73InvalidNamespaceAn invalid database or collection name.
79UnknownReplWriteConcernA write concern mode that does not exist.
89NetworkTimeoutA request forwarded to another node timed out.
91ShutdownInProgressThe node is shutting down.
96OperationFailedA command could not do what it was asked, such as getLog of an unknown log.
100UnsatisfiableWriteConcernA w larger than the number of replicas of the range.
112WriteConflictA conflict between transactions.
115CommandNotSupportedThe command exists but is not taken this way.
117ConflictingOperationInProgressstartTransaction with the running txnNumber, or a transaction another command holds.
118NamespaceNotShardedA sharding command on a collection without a shard key.
121DocumentValidationFailureThe document fails schema validation.
125CommandFailedSearch refused the command, such as updateSearchIndex with a wrong definition.
133FailedToSatisfyReadPreferenceNo replica satisfies the read preference.
136CappedPositionLostA capped collection evicted the next document of a tailable cursor.
140InvalidSSLConfigurationThe node's TLS settings could not be loaded, for example in rotateCertificates.
160MaxStalenessOutOfRangeA maxStalenessSeconds under 90.
163ZoneStillInUseThe last shard of a zone that still has intervals.
165ViewDepthLimitExceededA view on too many views.
166CommandNotSupportedOnViewA command that needs a collection, run on a view.
167OptionNotSupportedOnViewAn option or a stage a view does not take.
168InvalidPipelineOperatorA pipeline operator or cursor option the pipeline does not take, such as a tailable cursor on a view or a time series.
171CannotIndexParallelArraysTwo fields of a compound index go through different arrays.
177ZoneNotFoundA zone no shard is in.
178RangeOverlapConflictA zone interval that overlaps another one of the collection.
183ClientMetadataMissingFieldClient metadata without driver or os.
184ClientMetadataAppNameTooLargeAn application.name over 128 bytes.
185ClientMetadataDocumentTooLargeClient metadata over 512 bytes.
186ClientMetadataCannotBeMutatedClient metadata sent after the first hello.
189PrimarySteppedDownThe leader changed during the operation.
197InvalidIndexSpecificationOptionAn index specification with an option that index cannot have.
204TimeProofMismatchA $clusterTime whose signature does not match it.
207InvalidUUIDA UUID that is not 16 bytes of subtype 4.
211KeyNotFoundA $clusterTime signed with a key the node does not have for that time.
224QueryFeatureNotAllowedAn operator the context does not take, such as $expr in the filter of a partial index.
225TransactionTooOldA txnNumber below the highest of the session.
239SnapshotTooOldA read below the garbage collection threshold of the range.
251NoSuchTransactionThe transaction does not exist.
256TransactionCommittedabortTransaction of a committed transaction.
257TransactionTooLargeThe state of a transaction went past the memory budget of the coordinator.
260InvalidResumeTokenresumeAfter from an invalidate event.
262ExceededTimeLimitThe node is overloaded.
263OperationNotSupportedInTransactionA command a transaction cannot run.
266FailPointSetFailedconfigureFailPoint of a failpoint that does not exist.
272MigrationConflictA snapshot read from before its database was added.
280ChangeStreamFatalErrorA change stream event lost its _id in the pipeline, or the stream cannot go on.
286ChangeStreamHistoryLostA change stream resumes from a point older than what the cluster keeps.
291NoQueryExecutionPlans$near or $nearSphere without a geospatial index.
292QueryExceededMemoryLimitNoDiskUseAllowedA sort over 100 MiB without allowDiskUse.
334MechanismUnavailableA SASL mechanism that is unknown, not enabled or without credentials.
339NoSuchReshardCollectionNo resharding of that namespace is running.
341ReshardCollectionAbortedThe resharding was aborted.
344AuditingNotEnabledA command about the audit log on a node without one.
345RuntimeAuditConfigurationNotEnabledA change of auditConfig on a node without auditLog.runtimeConfiguration.
352UnsupportedOpQueryCommandAn OP_QUERY command other than hello or isMaster.
359CannotConvertIndexToUniquecollMod to unique: true of an index whose entries have duplicates.
361CollectionUUIDMismatchA collection whose UUID is not the one the command names.
371UserWritesBlockedA write to a user database while setUserWriteBlockMode blocks them.
378NonConformantBSONA BSON column (binary subtype 7) that does not follow the column layout.
411QueryRejectedBySettingsA query its shape's settings reject.
491CommandNotSupportedOnLegacyTimeseriesBucketsNamespaceA command on a system.buckets.* namespace, which MongoDB 9.0 no longer serves.
509TooManyOpenTransactionsA transaction that would go past maxConcurrentMultiDocumentTransactions.
510GeoKeyExtractionFailedA value of a 2dsphere field that is not a valid geometry.
511GeoKeyExtractionFailedTimeseriesA geometry of a time series measurement that the 2dsphere index of its bucket cannot take.
10065Location10065A value that is not the object MongoDB reads there, such as a readConcern.afterOpTime or a field of a stored user or role.
10107NotWritablePrimaryThe leader of the range is not reachable after the internal retries.
10270Location10270A SASL payload that is not Base64.
10334BSONObjectTooLargeA document over 16 MiB.
11000DuplicateKeyA unique index is violated.
11600InterruptedAtShutdownThe node shuts down while the operation runs.
11601InterruptedkillOp interrupted the operation.
11602InterruptedDueToReplStateChangeA primary change in replica set mode.
13026Location13026A 2d value that is neither an array nor a document of two numbers.
13027Location13027A 2d point outside the grid of the index.
13068Location13068A 2d value with one element.
13297DatabaseDifferCaseA new database whose name differs only in case from an existing one.
13388StaleConfigA write reached a range fenced by the critical section of a resharding. It is what a shard answers mongos, which refreshes its routing and sends the write again.
13436NotPrimaryOrSecondaryA node without an authorization lease, whose copy of the users and roles may be behind.
16634Location16634Intervals of one namespace with other fields.
16764Location16764A unique hashed index.
16766Location16766A hashed field with an array on its path.
16804Location16804A 2d location in no known format.
17501Location17501A stored SCRAM credential without a valid iteration count.
17502Location17502A stored SCRAM credential without its salt.
17503Location17503A stored SCRAM credential without its server key.
17504Location17504A stored SCRAM credential without its stored key.
26823Location26823killOp with a number op that does not fit 32 bits.
28625Location28625killOp with a text op that is not shardid:opid.
28747Location28747A sample size that is not a positive integer, such as the numInitialChunks of a resharding.
31250Location31250A projection path that collides with another one.
31253Location31253An inclusion in an exclusion projection.
31254Location31254An exclusion in an inclusion projection.
31303Location31303More than one hashed field in an index key.
31441Location31441A writing stage inside the sub-pipeline of $unionWith.
40323Location40323A pipeline stage with more or fewer than one field.
40324Location40324A pipeline stage MongoDB does not know.
40413IDLDuplicateFieldA field given twice where it may appear once.
40414IDLFailedToParseA required field is missing in the command.
40415IDLUnknownFieldAn unknown field in the command.
40430Location40430An OP_MSG with two body sections.
40431Location40431An OP_MSG with two document sequences of the same name.
40432Location40432An OP_MSG with an unknown section kind.
40433Location40433A field both in the body and as a document sequence.
40587Location40587An OP_MSG without a body.
40600Location40600A writing stage inside $facet.
40602Location40602$changeStream is not the first stage of the pipeline.
40647Location40647A resume token without a string _data.
40674Location40674A resume token and startAtOperationTime together.
50684Location50684A stored SCRAM credential that is not Base64 of the right length.
50687Location50687An empty password, which MongoDB's SASLprep refuses.
50736Location50736getMore in a session on a cursor opened outside any, on a member of a replica set.
50737Location50737getMore without a session on the cursor of a session, on a member of a replica set.
50738Location50738getMore in a session other than the one of its cursor, on a member of a replica set.
50759Location50759killOp without op.
50760Location50760killOp with an op of a type it does not take.
50768NotARetryableWriteCommandA txnNumber without autocommit: false on a command that is not a retryable write.
50865Location50865Both resumeAfter and startAfter.
50889Location50889A txnNumber on a command that takes none, such as hello.
50933Location50933$planCacheStats of a collection that does not exist.
50940Location50940The commit of a transaction the node has no record of, without its recoveryToken.
51002Location51002createRole of a role that already exists.
51003Location51003createUser of a user that already exists.
51047Location51047A writing stage inside the sub-pipeline of $lookup.
51091Location51091A regular expression that does not compile.
51108Location51108An unknown regular expression option.
51198Location51198An update statement with constants (c) that is not a pipeline.
51758Location51758A negative topologyVersion.counter.
51760Location51760topologyVersion without maxAwaitTimeMS, or the other way round.
51761Location51761A topologyVersion.counter greater than the one of the node.
51769Location51769speculativeAuthenticate with a command other than saslStart or authenticate.
4848401Location4848401A count on a view whose pipeline fails on the shard, as mongos relays it.
4926900Location4926900A feature compatibility version that does not exist.
4952606Location4952606A new shard key without the cardinality for the chunks asked.
5147403Location5147403A change of the feature compatibility version MongoDB does not allow from the current one.
5491300Location5491300A stage MongoDB keeps for its own pipelines.
5579202Location5579202A clusterAuthMode that is not the next step from the one of the node.
5739101Location5739101OP_QUERY on something other than a command namespace.
5916301Location5916301A partial filter of a time series index that has no form over the buckets.
5979700Location5979700A clustered index without unique: true.
5979703Location5979703clusteredIndex: <bool>.
5979704Location5979704A clustered index of a version other than 2.
6026500Location6026500clusteredIndex on a view.
6049200Location6049200A clustered collection with capped and size.
6127800Location6127800A clustered capped collection, which in MongoDB is a test feature.
6188500Location6188500$changeStream with an argument that is not a document.
6243700Location6243700A clustered index specification on a collection that is not clustered.
7182800Location7182800$changeStreamSplitLargeEvent with an argument that is not an empty document.
7182802Location7182802$changeStreamSplitLargeEvent is not the last stage.
7246301Location7246301A regular field of a compound wildcard index holding an array.
7369100Location7369100A change of the feature compatibility version without confirm: true.
7746402Location7746402A query settings target that has no query shape.
7746604Location7746604setQuerySettings whose merged settings are only defaults.
8727500Location8727500An index hint of query settings without its database.
8727501Location8727501An index hint of query settings without its namespace.
8727502Location8727502setQuerySettings with no setting it knows.
9621301Location9621301$listClusterCatalog on a collection.
12194501Location12194501A query knob that query settings cannot set.
12370902Location12370902collMod to validationLevel: "constraint" on a collection with invalid documents.

See also