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.
| Code | codeName | When it appears |
|---|---|---|
| 1 | Internal | An unexpected internal failure. |
| 2 | Bad | An option or a value is not valid. |
| 4 | No | A cluster parameter or an option that does not exist. |
| 5 | Graph | A view that reaches itself. |
| 8 | Unknown | A search error with no code of its own, for example in the definition of a search index. |
| 9 | Failed | The command is malformed. |
| 11 | User | The user does not exist. |
| 12 | Unsupported | A $clusterTime signature whose hash is not 20 bytes. |
| 13 | Unauthorized | The user lacks the privilege the command needs, or the OP_MSG carries a security token section. |
| 14 | Type | A field of the command has the wrong BSON type. |
| 15 | Overflow | A document goes past MongoDB's nesting limit. |
| 16 | Invalid | A write batch with no operations or too many. |
| 17 | Protocol | A SASL conversation that does not exist. |
| 18 | Authentication | Authentication failed. |
| 20 | Illegal | The target does not allow the operation, such as renaming a collection to itself. |
| 22 | Invalid | The BSON is not valid. |
| 23 | Already | Something is already set up another way, such as shardCollection with another key. |
| 26 | Namespace | The collection is missing where one is required. |
| 27 | Index | An index the query needs does not exist, such as $text without a text index. |
| 28 | Path | An update cannot create that path in the document. |
| 31 | Role | The role does not exist. |
| 40 | Conflicting | Two update operators on the same path, or on a path and its prefix. |
| 43 | Cursor | The cursor expired, was killed or belongs to another node. |
| 47 | No | A change stream lacks a pre- or post-image it requires. |
| 48 | Namespace | create of a collection that already exists. |
| 49 | Invalid | A role change MongoDB refuses, such as a cycle or a privilege outside the role's database. |
| 50 | Max | maxTimeMS expired. |
| 52 | Dollar | A field name starting with $ where it is not allowed. |
| 53 | Invalid | An _id of a type a stored document cannot have. |
| 54 | Not | An upsert whose filter sets the same path twice. |
| 56 | Empty | An empty field name in a path. |
| 59 | Command | The command does not exist. |
| 61 | Shard | A document whose shard key holds an array. |
| 66 | Immutable | A change of _id. |
| 67 | Cannot | An index specification with a version or an option that cannot be created. |
| 68 | Index | A search index with the same name and another definition. |
| 70 | Shard | killOp naming a shard. TeselaDB has no shards. |
| 72 | Invalid | An invalid combination of options. |
| 73 | Invalid | An invalid database or collection name. |
| 79 | Unknown | A write concern mode that does not exist. |
| 89 | Network | A request forwarded to another node timed out. |
| 91 | Shutdown | The node is shutting down. |
| 96 | Operation | A command could not do what it was asked, such as getLog of an unknown log. |
| 100 | Unsatisfiable | A w larger than the number of replicas of the range. |
| 112 | Write | A conflict between transactions. |
| 115 | Command | The command exists but is not taken this way. |
| 117 | Conflicting | startTransaction with the running txnNumber, or a transaction another command holds. |
| 118 | Namespace | A sharding command on a collection without a shard key. |
| 121 | Document | The document fails schema validation. |
| 125 | Command | Search refused the command, such as updateSearchIndex with a wrong definition. |
| 133 | Failed | No replica satisfies the read preference. |
| 136 | Capped | A capped collection evicted the next document of a tailable cursor. |
| 140 | Invalid | The node's TLS settings could not be loaded, for example in rotateCertificates. |
| 160 | Max | A maxStalenessSeconds under 90. |
| 163 | Zone | The last shard of a zone that still has intervals. |
| 165 | View | A view on too many views. |
| 166 | Command | A command that needs a collection, run on a view. |
| 167 | Option | An option or a stage a view does not take. |
| 168 | Invalid | A pipeline operator or cursor option the pipeline does not take, such as a tailable cursor on a view or a time series. |
| 171 | Cannot | Two fields of a compound index go through different arrays. |
| 177 | Zone | A zone no shard is in. |
| 178 | Range | A zone interval that overlaps another one of the collection. |
| 183 | Client | Client metadata without driver or os. |
| 184 | Client | An application.name over 128 bytes. |
| 185 | Client | Client metadata over 512 bytes. |
| 186 | Client | Client metadata sent after the first hello. |
| 189 | Primary | The leader changed during the operation. |
| 197 | Invalid | An index specification with an option that index cannot have. |
| 204 | Time | A $clusterTime whose signature does not match it. |
| 207 | Invalid | A UUID that is not 16 bytes of subtype 4. |
| 211 | Key | A $clusterTime signed with a key the node does not have for that time. |
| 224 | Query | An operator the context does not take, such as $expr in the filter of a partial index. |
| 225 | Transaction | A txnNumber below the highest of the session. |
| 239 | Snapshot | A read below the garbage collection threshold of the range. |
| 251 | No | The transaction does not exist. |
| 256 | Transaction | abortTransaction of a committed transaction. |
| 257 | Transaction | The state of a transaction went past the memory budget of the coordinator. |
| 260 | Invalid | resumeAfter from an invalidate event. |
| 262 | Exceeded | The node is overloaded. |
| 263 | Operation | A command a transaction cannot run. |
| 266 | Fail | configureFailPoint of a failpoint that does not exist. |
| 272 | Migration | A snapshot read from before its database was added. |
| 280 | Change | A change stream event lost its _id in the pipeline, or the stream cannot go on. |
| 286 | Change | A change stream resumes from a point older than what the cluster keeps. |
| 291 | No | $near or $nearSphere without a geospatial index. |
| 292 | Query | A sort over 100 MiB without allowDiskUse. |
| 334 | Mechanism | A SASL mechanism that is unknown, not enabled or without credentials. |
| 339 | No | No resharding of that namespace is running. |
| 341 | Reshard | The resharding was aborted. |
| 344 | Auditing | A command about the audit log on a node without one. |
| 345 | Runtime | A change of auditConfig on a node without auditLog.runtimeConfiguration. |
| 352 | Unsupported | An OP_QUERY command other than hello or isMaster. |
| 359 | Cannot | collMod to unique: true of an index whose entries have duplicates. |
| 361 | Collection | A collection whose UUID is not the one the command names. |
| 371 | User | A write to a user database while setUserWriteBlockMode blocks them. |
| 378 | Non | A BSON column (binary subtype 7) that does not follow the column layout. |
| 411 | Query | A query its shape's settings reject. |
| 491 | Command | A command on a system.buckets.* namespace, which MongoDB 9.0 no longer serves. |
| 509 | Too | A transaction that would go past maxConcurrentMultiDocumentTransactions. |
| 510 | Geo | A value of a 2dsphere field that is not a valid geometry. |
| 511 | Geo | A geometry of a time series measurement that the 2dsphere index of its bucket cannot take. |
| 10065 | Location10065 | A value that is not the object MongoDB reads there, such as a readConcern.afterOpTime or a field of a stored user or role. |
| 10107 | Not | The leader of the range is not reachable after the internal retries. |
| 10270 | Location10270 | A SASL payload that is not Base64. |
| 10334 | BSONObject | A document over 16 MiB. |
| 11000 | Duplicate | A unique index is violated. |
| 11600 | Interrupted | The node shuts down while the operation runs. |
| 11601 | Interrupted | killOp interrupted the operation. |
| 11602 | Interrupted | A primary change in replica set mode. |
| 13026 | Location13026 | A 2d value that is neither an array nor a document of two numbers. |
| 13027 | Location13027 | A 2d point outside the grid of the index. |
| 13068 | Location13068 | A 2d value with one element. |
| 13297 | Database | A new database whose name differs only in case from an existing one. |
| 13388 | Stale | A 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. |
| 13436 | Not | A node without an authorization lease, whose copy of the users and roles may be behind. |
| 16634 | Location16634 | Intervals of one namespace with other fields. |
| 16764 | Location16764 | A unique hashed index. |
| 16766 | Location16766 | A hashed field with an array on its path. |
| 16804 | Location16804 | A 2d location in no known format. |
| 17501 | Location17501 | A stored SCRAM credential without a valid iteration count. |
| 17502 | Location17502 | A stored SCRAM credential without its salt. |
| 17503 | Location17503 | A stored SCRAM credential without its server key. |
| 17504 | Location17504 | A stored SCRAM credential without its stored key. |
| 26823 | Location26823 | killOp with a number op that does not fit 32 bits. |
| 28625 | Location28625 | killOp with a text op that is not shardid:opid. |
| 28747 | Location28747 | A sample size that is not a positive integer, such as the numInitialChunks of a resharding. |
| 31250 | Location31250 | A projection path that collides with another one. |
| 31253 | Location31253 | An inclusion in an exclusion projection. |
| 31254 | Location31254 | An exclusion in an inclusion projection. |
| 31303 | Location31303 | More than one hashed field in an index key. |
| 31441 | Location31441 | A writing stage inside the sub-pipeline of $unionWith. |
| 40323 | Location40323 | A pipeline stage with more or fewer than one field. |
| 40324 | Location40324 | A pipeline stage MongoDB does not know. |
| 40413 | IDLDuplicate | A field given twice where it may appear once. |
| 40414 | IDLFailed | A required field is missing in the command. |
| 40415 | IDLUnknown | An unknown field in the command. |
| 40430 | Location40430 | An OP_MSG with two body sections. |
| 40431 | Location40431 | An OP_MSG with two document sequences of the same name. |
| 40432 | Location40432 | An OP_MSG with an unknown section kind. |
| 40433 | Location40433 | A field both in the body and as a document sequence. |
| 40587 | Location40587 | An OP_MSG without a body. |
| 40600 | Location40600 | A writing stage inside $facet. |
| 40602 | Location40602 | $changeStream is not the first stage of the pipeline. |
| 40647 | Location40647 | A resume token without a string _data. |
| 40674 | Location40674 | A resume token and startAtOperationTime together. |
| 50684 | Location50684 | A stored SCRAM credential that is not Base64 of the right length. |
| 50687 | Location50687 | An empty password, which MongoDB's SASLprep refuses. |
| 50736 | Location50736 | getMore in a session on a cursor opened outside any, on a member of a replica set. |
| 50737 | Location50737 | getMore without a session on the cursor of a session, on a member of a replica set. |
| 50738 | Location50738 | getMore in a session other than the one of its cursor, on a member of a replica set. |
| 50759 | Location50759 | killOp without op. |
| 50760 | Location50760 | killOp with an op of a type it does not take. |
| 50768 | Not | A txnNumber without autocommit: false on a command that is not a retryable write. |
| 50865 | Location50865 | Both resumeAfter and startAfter. |
| 50889 | Location50889 | A txnNumber on a command that takes none, such as hello. |
| 50933 | Location50933 | $planCacheStats of a collection that does not exist. |
| 50940 | Location50940 | The commit of a transaction the node has no record of, without its recoveryToken. |
| 51002 | Location51002 | createRole of a role that already exists. |
| 51003 | Location51003 | createUser of a user that already exists. |
| 51047 | Location51047 | A writing stage inside the sub-pipeline of $lookup. |
| 51091 | Location51091 | A regular expression that does not compile. |
| 51108 | Location51108 | An unknown regular expression option. |
| 51198 | Location51198 | An update statement with constants (c) that is not a pipeline. |
| 51758 | Location51758 | A negative topologyVersion.counter. |
| 51760 | Location51760 | topologyVersion without maxAwaitTimeMS, or the other way round. |
| 51761 | Location51761 | A topologyVersion.counter greater than the one of the node. |
| 51769 | Location51769 | speculativeAuthenticate with a command other than saslStart or authenticate. |
| 4848401 | Location4848401 | A count on a view whose pipeline fails on the shard, as mongos relays it. |
| 4926900 | Location4926900 | A feature compatibility version that does not exist. |
| 4952606 | Location4952606 | A new shard key without the cardinality for the chunks asked. |
| 5147403 | Location5147403 | A change of the feature compatibility version MongoDB does not allow from the current one. |
| 5491300 | Location5491300 | A stage MongoDB keeps for its own pipelines. |
| 5579202 | Location5579202 | A clusterAuthMode that is not the next step from the one of the node. |
| 5739101 | Location5739101 | OP_QUERY on something other than a command namespace. |
| 5916301 | Location5916301 | A partial filter of a time series index that has no form over the buckets. |
| 5979700 | Location5979700 | A clustered index without unique: true. |
| 5979703 | Location5979703 | clusteredIndex: <bool>. |
| 5979704 | Location5979704 | A clustered index of a version other than 2. |
| 6026500 | Location6026500 | clusteredIndex on a view. |
| 6049200 | Location6049200 | A clustered collection with capped and size. |
| 6127800 | Location6127800 | A clustered capped collection, which in MongoDB is a test feature. |
| 6188500 | Location6188500 | $changeStream with an argument that is not a document. |
| 6243700 | Location6243700 | A clustered index specification on a collection that is not clustered. |
| 7182800 | Location7182800 | $changeStreamSplitLargeEvent with an argument that is not an empty document. |
| 7182802 | Location7182802 | $changeStreamSplitLargeEvent is not the last stage. |
| 7246301 | Location7246301 | A regular field of a compound wildcard index holding an array. |
| 7369100 | Location7369100 | A change of the feature compatibility version without confirm: true. |
| 7746402 | Location7746402 | A query settings target that has no query shape. |
| 7746604 | Location7746604 | setQuerySettings whose merged settings are only defaults. |
| 8727500 | Location8727500 | An index hint of query settings without its database. |
| 8727501 | Location8727501 | An index hint of query settings without its namespace. |
| 8727502 | Location8727502 | setQuerySettings with no setting it knows. |
| 9621301 | Location9621301 | $listClusterCatalog on a collection. |
| 12194501 | Location12194501 | A query knob that query settings cannot set. |
| 12370902 | Location12370902 | collMod to validationLevel: "constraint" on a collection with invalid documents. |
See also
- Multi-document transactions, with the transient errors.
- Differences with MongoDB