diegosouzapw/OmniRoute · error · Error

CDP endpoint returned HTTP

Error message

CDP endpoint returned HTTP ${response.status}

What it means

Thrown by fetchJson when a CDP HTTP endpoint (e.g. /json/version or /json/targets) answers with a non-2xx status. Means the debug port is reachable but the browser rejected the request — commonly a 5xx from a Chromium instance that is shutting down, or a port that now serves something else after a container restart. The status code is embedded in the message.

Solutions

  1. Retry after a short delay — transient 5xx during browser startup/shutdown is the common case
  2. Verify the cdpPort still belongs to this session's container (docker port <name>)
  3. Restart the browser-login session if the container's CDP endpoint is persistently unhealthy
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at src/lib/vncSession/harvest.ts:408 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/7641aba1d4e5f7ea. Report an issue: GitHub.

Appendix: source

Thrown at src/lib/vncSession/harvest.ts:408

): CdpTargetInfo {
  const pages = targetInfos.filter((target) => target.type === "page");
  const matching = pages.find((target) => safeOrigin(target.url) === targetOrigin);
  if (matching) return matching;
  throw new Error(`No browser page is open for ${targetOrigin}`);
}

function safeOrigin(value: string | undefined): string | null {
  if (!value) return null;
  try {
    return new URL(value).origin;
  } catch {
    return null;
  }
}

async function fetchJson(url: string, signal: AbortSignal): Promise<any> {
  const response = await fetch(url, { signal });
  if (!response.ok) throw new Error(`CDP endpoint returned HTTP ${response.status}`);
  return response.json();
}

function domainMatches(cookieDomain: string, origin: string): boolean {
  try {
    const host = new URL(origin).hostname;
    const domain = cookieDomain.startsWith(".") ? cookieDomain.slice(1) : cookieDomain;
    return host === domain || host.endsWith(`.${domain}`);
  } catch {
    return false;
  }
}

function delay(ms: number): Promise<void> {
  return new Promise((resolve) => setTimeout(resolve, ms));
}

function toError(error: unknown, fallback: string): Error {

View on GitHub (pinned to a179ffed5b)