{"record":{"id":"ec950ddfcd91d6a5","repo":"diegosouzapw/OmniRoute","slug":"loopback-not-ready-within-maxwaitms-ms-laster","errorCode":null,"errorMessage":"loopback not ready within ${maxWaitMs}ms: ${lastErr instanceof Error ? lastErr.message : String(lastErr)}","messagePattern":"loopback not ready within (.+?)ms: (.+?)","errorType":"error_code","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/shared/services/codexCatalogRevalidation.ts","lineNumber":193,"sourceCode":"  let lastErr: unknown;\n\n  while (Date.now() < deadline) {\n    try {\n      const res = await fetchModelSyncInternal(\n        `${baseUrl}/api/providers/__readiness_probe__/models`,\n        {\n          redirect: \"error\",\n          signal: AbortSignal.timeout(1_500),\n        }\n      );\n      if (res.status >= 200 && res.status < 600) return;\n    } catch (err) {\n      lastErr = err;\n    }\n    await new Promise((r) => setTimeout(r, pollMs));\n  }\n\n  throw new Error(\n    `loopback not ready within ${maxWaitMs}ms: ${\n      lastErr instanceof Error ? lastErr.message : String(lastErr)\n    }`\n  );\n}\n\nexport async function liveResyncCodexConnections(\n  apiBaseUrl?: string\n): Promise<{ attempted: number; succeeded: number }> {\n  const connections = await listActiveCodexConnectionIds();\n  if (connections.length === 0) {\n    return { attempted: 0, succeeded: 0 };\n  }\n\n  const { buildModelSyncInternalHeaders, fetchModelSyncInternal, resolveModelSyncInternalBaseUrl } =\n    await import(\"./modelSyncScheduler\");\n  const base = resolveModelSyncInternalBaseUrl(apiBaseUrl);\n  const results = await Promise.allSettled(","sourceCodeStart":175,"sourceCodeEnd":211,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/shared/services/codexCatalogRevalidation.ts#L175-L211","documentation":"Timeout error from the codex catalog revalidation readiness loop: the local loopback endpoint did not respond with any HTTP status within maxWaitMs despite repeated polling at pollMs intervals. lastErr holds the final fetch failure (connection refused, timeout, etc). It means model-sync cannot proceed because the internal server is not up.","triggerScenarios":"Thrown at src/shared/services/codexCatalogRevalidation.ts:193 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the OmniRoute server is running and reachable at the resolved loopback baseUrl before revalidation","Increase maxWaitMs or pollMs for slow startups","Inspect lastErr for the root cause (ECONNREFUSED vs timeout)","Verify port/hostname used by resolveModelSyncInternalBaseUrl is correct"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}