diegosouzapw/OmniRoute · error · Error

Failed to start browser login for connection

Error message

Failed to start browser login for connection ${connectionId}: ${state.error}

What it means

Terminal wrapper in startSession's catch path: any error raised during container start, port resolution, or CDP readiness was recorded on the session (status='error', state.error) and is rethrown prefixed with the connectionId. Means the browser-login session failed before reaching 'running'; the embedded state.error names the actual root cause (docker run failure, port resolution, CDP timeout). The profile dir is cleaned up before rethrow.

Solutions

  1. Read the trailing state.error portion — it identifies the real failing stage
  2. Retry startSession once transient Docker/CDP issues are resolved
  3. Check session cleanup happened (no orphan container/profile left behind)
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at src/lib/vncSession/service.ts:248 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/2511ce741d3b8cf8. Report an issue: GitHub.

Appendix: source

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

          ? " Build it with: docker build -t omniroute-vnc-chromium:local docker/vnc-browser/chromium"
          : "";
      throw new Error(`${message}${buildHint}`);
    }

    state.vncPort = await publishedPort(containerName, VNC_CONFIG.containerVncPort);
    state.cdpPort = await publishedPort(containerName, VNC_CONFIG.containerCdpPort);
    await waitForCdpReady(state.cdpPort, VNC_CONFIG.browserReadyTimeoutMs);

    state.status = "running";
    scheduleIdleSweep();
    return state;
  } catch (error) {
    state.status = "error";
    state.error = error instanceof Error ? error.message : String(error);
    SESSIONS.delete(sessionId);
    await docker(["rm", "-f", containerName], { timeoutMs: 20_000 });
    cleanupProfile(state);
    throw new Error(`Failed to start browser login for connection ${connectionId}: ${state.error}`);
  }
}

export function markViewerActive(connectionId: string, sessionId: string): void {
  const session = getSession(connectionId, sessionId);
  if (session) session.lastViewerAt = Date.now();
}

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

  const session = getSession(connectionId, sessionId);
  if (!session) throw new Error("Browser-login session not found");
  if (session.status !== "running") {

View on GitHub (pinned to a179ffed5b)