{"record":{"id":"e35e9f098c1533db","repo":"diegosouzapw/OmniRoute","slug":"startup-could-not-clear-stale-crash-cooldowns-n","errorCode":null,"errorMessage":"[STARTUP] Could not clear stale crash cooldowns (non-fatal):","messagePattern":"\\[STARTUP\\] Could not clear stale crash cooldowns \\(non-fatal\\):","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/instrumentation-node.ts","lineNumber":312,"sourceCode":"  ]);\n\n  // Clear stale transient connection cooldowns persisted from an unclean crash.\n  // A crash mid-burst can leave far-future `rate_limited_until` values in the DB\n  // that cause every connection to be skipped by getProviderCredentials(), making\n  // all subsequent requests time out at Bottleneck's maxWaitMs (120 s default).\n  // Terminal states (banned / expired / credits_exhausted) are intentionally kept.\n  // See: https://github.com/diegosouzapw/OmniRoute/issues/3625 (Part A)\n  try {\n    const { clearStaleCrashCooldowns } = await import(\"@/lib/db/providers\");\n    const { cleared } = clearStaleCrashCooldowns();\n    if (cleared > 0) {\n      console.log(\n        `[STARTUP] Cleared ${cleared} stale transient connection cooldown(s) from prior crash (#3625)`\n      );\n    }\n  } catch (err: unknown) {\n    const msg = err instanceof Error ? err.message : String(err);\n    console.warn(\"[STARTUP] Could not clear stale crash cooldowns (non-fatal):\", msg);\n  }\n\n  await scanComboModelNameCollisionsAtBoot();\n  await warmAdaptiveVirtualLanesIntoRuntime();\n\n  const [\n    { initGracefulShutdown },\n    { initApiBridgeServer },\n    { startBackgroundRefresh },\n    { ensureCloudSyncInitialized },\n    { startProviderLimitsSyncScheduler },\n    { getSettings },\n    { applyRuntimeSettings },\n    { startRuntimeConfigHotReload },\n    { startSpendBatchWriter },\n    { startCleanupScheduler },\n    { registerDefaultGuardrails },\n    { ensurePersistentManagementPasswordHash },","sourceCodeStart":294,"sourceCodeEnd":330,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/instrumentation-node.ts#L294-L330","documentation":"Error \"[STARTUP] Could not clear stale crash cooldowns (non-fatal):\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/instrumentation-node.ts:312 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}