diegosouzapw/OmniRoute · error · HeadroomError

SPAWN_FAILED

SPAWN_FAILED

Error message

Failed to spawn headroom proxy

What it means

Error "Failed to spawn headroom proxy" thrown in diegosouzapw/OmniRoute.

Source

Thrown at src/lib/headroom/process.ts:115

  const existing = getManagedPid();
  if (existing) return { pid: existing, alreadyRunning: true };

  ensureDir();
  const outFd = fs.openSync(LOG_FILE, "a");

  // spawn (no shell) with array args — argv is passed directly to the
  // headroom binary, so no shell-metacharacter handling is needed.
  const child = spawn(binary, ["proxy", "--port", String(safePort(opts.port))], {
    stdio: ["ignore", outFd, outFd],
    detached: true,
    windowsHide: true,
    env: { ...process.env },
  });

  if (!child.pid) {
    fs.closeSync(outFd);
    throw new HeadroomError("Failed to spawn headroom proxy", "SPAWN_FAILED");
  }

  child.unref();
  writePid(child.pid);

  await new Promise<void>((resolve, reject) => {
    const timer = setTimeout(() => {
      if (isPidAlive(child.pid!)) resolve();
      else
        reject(
          new HeadroomError("headroom proxy exited during startup — see proxy.log", "EARLY_EXIT")
        );
    }, STARTUP_TIMEOUT_MS);

    child.once("exit", (code) => {
      clearTimeout(timer);
      clearPid();
      try {

View on GitHub (pinned to a179ffed5b)

When it happens

Trigger: Thrown at src/lib/headroom/process.ts:115 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/43ade9b7cdbed718. Report an issue: GitHub.