diegosouzapw/OmniRoute · error · Error

Provider connection not found

Error message

Provider connection not found

What it means

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.

Solutions

  1. Refresh the connections list in the UI and retry with a current connectionId
  2. Verify the connection exists via the provider-connections API before starting browser login
  3. Surface as a 404-style user error, not a server fault
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/lib/vncSession/service.ts:163 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/ddbb0887997461f7. Report an issue: GitHub.

Appendix: source

Thrown at src/lib/vncSession/service.ts:163

  if (result.code !== 0) {
    throw new Error(result.err.trim() || `Could not resolve published port ${containerPort}`);
  }

  for (const line of result.out.split(/\r?\n/)) {
    const match = line.trim().match(/:(\d+)$/);
    if (match) return Number(match[1]);
  }
  throw new Error(`Docker did not publish container port ${containerPort}`);
}

export async function startSession(connectionId: string): Promise<VncSession> {
  if (await isConnectionUnavailableToAuxiliaryActivity(connectionId))
    throw new Error("Browser login is unavailable for managed lease connections");

  await reconcileStaleContainers();

  const connection = await getProviderConnectionById(connectionId);
  if (!connection) throw new Error("Provider connection not found");
  const providerId = typeof connection.provider === "string" ? connection.provider : "";
  const provider = getVncProvider(providerId);
  if (!provider) {
    throw new Error(`Browser login is not supported for provider '${providerId || "unknown"}'`);
  }

  const existing = findActiveSessionForConnection(connectionId);
  if (existing) return existing;
  if (SESSIONS.size >= VNC_CONFIG.maxSessions) {
    throw new Error(`Maximum ${VNC_CONFIG.maxSessions} concurrent browser-login sessions reached`);
  }

  const sessionId = randomUUID();
  const containerName = sessionKey(sessionId);
  const profileDir = createProfileDir(connectionId, sessionId);
  const state: VncSession = {
    sessionId,
    connectionId,

View on GitHub (pinned to a179ffed5b)