Error Code Lookup
Parent: MongoDB KB Articles · Published reference · snapshot 2026-10-24 · skill mongodb-cohort-29539c2a7d1c
↓ Facts as markdownall context files
Source-anchored research for Error Code Lookup. Run status: COMPLETED.
These notes link each claim to its source. Some citations identify archived research reports that are no longer hosted on this site. A published reference means the content is available; it does not certify independent review or accuracy.Read the editorial policy and follow the sources before relying on a claim.
How it works
- A Payload issue filed on 2026-10-13 reports NoSuchTransaction (251) with a TransientTransactionError label when commands race at the start of a transaction. This is a reported reproduction, not evidence that every 251 has that cause. (low confidence) [source]
Problems, failure modes and limitations
- MongoDB provides a numeric server-error lookup for mongod and mongos. The reference and server definitions map 11000 to DuplicateKey, 251 to NoSuchTransaction, and 121 to DocumentValidationFailure. (high confidence) [source]
- E11000 indicates a duplicate-key failure, but does not by itself identify the workflow that caused it: Mongoose documents it during unique-index enforcement, while Percona reproduces it during oplog restoration with a compound unique index. (high confidence) [source]
- Classify the identifier before selecting a lookup table: MongoDB documents server error codes separately from process exit statuses. These references describe different events, so a bare number without its origin is insufficient. (high confidence) [source]
- MongoDB 9.0 release notes distinguish the ExceededMemoryLimit server error (146) from the associated logged message code 12932700. A KB should preserve whether a number is a returned error or a log-message identifier. (low confidence) (verified as of 2026-10-24) [source]
- MongoDB’s reference and server definitions map 11000 to DuplicateKey, 251 to NoSuchTransaction, and 112 to WriteConflict. These mappings identify an error class; they do not establish one universal root cause or repair. (high confidence) [source]
- Server error codes and process exit statuses use different namespaces. For example, server error 50 is MaxTimeMSExpired, while mongod exit status 50 indicates failure to fork during initialization. A lookup must retain the context in which the number appeared. (high confidence) [source]
- For E11000, inspect the collection, index name and duplicate key values in the complete message. Percona’s reproduction fails on a compound number/author index, so interpreting every DuplicateKey error as an _id collision is incorrect. (medium confidence) [source]
- Mongoose’s unique schema option builds a MongoDB unique index; it is not a Mongoose validator. The resulting duplicate-key error is distinct from Mongoose ValidationError. Its documentation also recommends waiting for index initialization in tests that drop the database. (low confidence) [source]
- Transaction retry decisions require error labels and operation context. TransientTransactionError permits retrying the whole transaction; UnknownTransactionCommitResult permits retrying commit. The callback API incorporates these retry paths, while the Core API requires application handling. (low confidence) [source]
- The collation limitation described in SERVER-94156 is historical: the ticket is Fixed and lists 8.1.0-rc0, 8.0.5 and 7.0.21 as fix versions. An article claiming that unique-index collation always prevents automatic upsert retries would omit those fixes. (low confidence) (verified as of 2025-05-12) [source]
Comparisons and alternatives
- Mongoose documents that unique is an index-building helper rather than a validator. Its duplicate-key example produces an error without the errors object used by Mongoose validation errors. (low confidence) [source]
- A historical Terraform-provider issue reports Atlas HTTP 409 with a message saying a cluster cannot be updated and paused simultaneously; the reporter says a pause-only API request worked. Treat this as a 2018 provider/API case rather than a current server-error mapping. (low confidence) [source]
- Percona’s March 27, 2023 reproduction shows that E11000 can arise during oplog replay when a unique compound-key value is already present. Treat this as a documented restore scenario, rather than proof that every E11000 comes from an application insert or that every modern restore has the same defect. (low confidence) [source]
- SERVER-14322 documents a specific automatic DuplicateKey retry path for upsert:true after a unique-index conflict when the operation is not a multi-update, the predicate is one equality or an AND of equalities over exactly the index fields, and the update leaves those fields unchanged. The ticket says this fix shipped in MongoDB 4.1.6 and later. SERVER-94156 reports a collation limitation in the behavior it tracks: the retry check compares the index key with the query predicate, and a collated index key is a CollationKey rather than a raw value. The ticket lists fixes in 8.1.0-rc0, 8.0.5, and 7.0.21. MongoDB's manual states that starting in 8.1, an upsert in a multi-document transaction does not retry after a duplicate key error. These scoped server behaviors do not justify blanket application retries for E11000. (medium confidence) [source]
- MongoDB 8.3 documentation lists parallel operations among operations disallowed in transactions. A troubleshooting entry should check transaction sequencing rather than endorse concurrent commands merely because a transaction has already started. (low confidence) (verified as of 2026-10-24) [source]
Facts and statements
- Code 121 applies specifically to the document validator on collections; a KB lookup should distinguish it from application or ODM validation errors. (high confidence) [source]
- For lookup and triage, retain the complete message and operation context alongside the numeric code; the same DuplicateKey mapping appears in application writes and restore operations that require different investigation. (high confidence) [source]
- Atlas overload guidance says SystemOverloadedError alone does not establish retry safety. Its example includes code, codeName and errorLabels; the guidance uses RetryableError and NoWritesPerformed to establish whether execution or writes occurred. (low confidence) (verified as of 2026-10-24) [source]
Children
- Server error code and symbolic-name mapping (frontier)
- Error labels and retry eligibility (frontier)
- Log identifiers versus exit statuses (frontier)
- DuplicateKey index diagnostics (frontier)
- Transaction error labels and retry scope (frontier)
- Server error codes versus process exit statuses (frontier)
Frontier under this node: DuplicateKey index diagnostics, Error labels and retry eligibility, Log identifiers versus exit statuses, Server error code and symbolic-name mapping, Server error codes versus process exit statuses, Transaction error labels and retry scope