{"record":{"id":"ddbb0887997461f7","repo":"diegosouzapw/OmniRoute","slug":"provider-connection-not-found","errorCode":null,"errorMessage":"Provider connection not found","messagePattern":"Provider connection not found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/lib/vncSession/service.ts","lineNumber":163,"sourceCode":"  if (result.code !== 0) {\n    throw new Error(result.err.trim() || `Could not resolve published port ${containerPort}`);\n  }\n\n  for (const line of result.out.split(/\\r?\\n/)) {\n    const match = line.trim().match(/:(\\d+)$/);\n    if (match) return Number(match[1]);\n  }\n  throw new Error(`Docker did not publish container port ${containerPort}`);\n}\n\nexport async function startSession(connectionId: string): Promise<VncSession> {\n  if (await isConnectionUnavailableToAuxiliaryActivity(connectionId))\n    throw new Error(\"Browser login is unavailable for managed lease connections\");\n\n  await reconcileStaleContainers();\n\n  const connection = await getProviderConnectionById(connectionId);\n  if (!connection) throw new Error(\"Provider connection not found\");\n  const providerId = typeof connection.provider === \"string\" ? connection.provider : \"\";\n  const provider = getVncProvider(providerId);\n  if (!provider) {\n    throw new Error(`Browser login is not supported for provider '${providerId || \"unknown\"}'`);\n  }\n\n  const existing = findActiveSessionForConnection(connectionId);\n  if (existing) return existing;\n  if (SESSIONS.size >= VNC_CONFIG.maxSessions) {\n    throw new Error(`Maximum ${VNC_CONFIG.maxSessions} concurrent browser-login sessions reached`);\n  }\n\n  const sessionId = randomUUID();\n  const containerName = sessionKey(sessionId);\n  const profileDir = createProfileDir(connectionId, sessionId);\n  const state: VncSession = {\n    sessionId,\n    connectionId,","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/vncSession/service.ts#L145-L181","documentation":"Lookup failure in startSession: getProviderConnectionById returned nothing for the supplied connectionId. Means the provider connection record was deleted (or never existed) between the API call and this point — commonly a stale dashboard entry or a concurrent deletion. The connectionId at fault is the caller's path/request parameter.","triggerScenarios":"Thrown at src/lib/vncSession/service.ts:163 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Refresh the connections list in the UI and retry with a current connectionId","Verify the connection exists via the provider-connections API before starting browser login","Surface as a 404-style user error, not a server fault"],"exampleFix":null,"handlingStrategy":"validation","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"}