{"record":{"id":"3a9aa3f571049f3b","repo":"mongodb/node-mongodb-native","slug":"unreachable-if-you-are-seeing-this-error-please","errorCode":null,"errorMessage":"Unreachable. If you are seeing this error, please file a ticket on the NODE driver project on Jira","messagePattern":"Unreachable\\. If you are seeing this error, please file a ticket on the NODE driver project on Jira","errorType":"exception","errorClass":"MongoRuntimeError","httpStatus":null,"severity":"error","filePath":"src/timeout.ts","lineNumber":272,"sourceCode":"        } else {\n          this._serverSelectionTimeout = null;\n        }\n      }\n    }\n\n    return this._serverSelectionTimeout;\n  }\n\n  get connectionCheckoutTimeout(): Timeout | null {\n    if (\n      typeof this._connectionCheckoutTimeout !== 'object' ||\n      this._connectionCheckoutTimeout?.cleared\n    ) {\n      if (typeof this._serverSelectionTimeout === 'object') {\n        // null or Timeout\n        this._connectionCheckoutTimeout = this._serverSelectionTimeout;\n      } else {\n        throw new MongoRuntimeError(\n          'Unreachable. If you are seeing this error, please file a ticket on the NODE driver project on Jira'\n        );\n      }\n    }\n    return this._connectionCheckoutTimeout;\n  }\n\n  get timeoutForSocketWrite(): Timeout | null {\n    const { remainingTimeMS } = this;\n    if (!Number.isFinite(remainingTimeMS)) return null;\n    if (remainingTimeMS > 0) return Timeout.expires(remainingTimeMS);\n    return Timeout.reject(new MongoOperationTimeoutError('Timed out before socket write'));\n  }\n\n  get timeoutForSocketRead(): Timeout | null {\n    const { remainingTimeMS } = this;\n    if (!Number.isFinite(remainingTimeMS)) return null;\n    if (remainingTimeMS > 0) return Timeout.expires(remainingTimeMS);","sourceCodeStart":254,"sourceCodeEnd":290,"githubUrl":"https://github.com/mongodb/node-mongodb-native/blob/dce7939f86fb283e167ad709955abedb7bf23124/src/timeout.ts#L254-L290","documentation":"Thrown in the CSOTTimeoutContext.connectionCheckoutTimeout getter in a branch the driver authors believe is unreachable: it fires only when _serverSelectionTimeout is neither an object (Timeout) nor null after the server selection timeout was already accessed. The message explicitly asks for a Jira ticket because it indicates an internal invariant violation.","triggerScenarios":"An internal driver race or logic error where the serverSelectionTimeout getter was not invoked or was cleared in an unexpected order before connectionCheckoutTimeout is read. This is not triggered by user configuration; it signals a driver bug under CSOT (Client-Side Operation Timeouts).","commonSituations":"Almost never seen. If encountered, it is typically during heavy concurrent use of CSOT-enabled transactions or when an operation is retried across a refreshed/cloned timeout context in an unexpected sequence.","solutions":["Upgrade to the latest driver patch release, as this indicates a bug that may already be fixed.","File a Jira ticket at https://jira.mongodb.org/projects/NODE with the full stack trace, driver version, and a reproduction.","As a temporary workaround, disable CSOT (remove timeoutMS from client/transaction options) to use legacy timeout mode."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await session.withTransaction(async (session) => {\n    await collection.findOne({}, { session });\n  }, { timeoutMS: 5000 });\n} catch (e) {\n  if (e instanceof MongoRuntimeError && /Unreachable/.test(e.message)) {\n    // disable CSOT and retry, or report a bug\n  } else throw e;\n}","preventionTips":["Keep the driver on the latest patch release to pick up CSOT bug fixes.","If you see this, file a NODE Jira ticket with the stack trace and a minimal reproduction.","As a workaround, disable timeoutMS/CSOT on transactions to avoid the affected code path."],"tags":["timeout","internal","bug","csot"],"backgroundTag":null,"analyzedSha":"dce7939f86fb283e167ad709955abedb7bf23124","analyzedAt":"2026-08-11T04:54:53.215Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}