{"record":{"id":"17b996b1abe0786a","repo":"garrytan/gstack","slug":"xvfb-on-display-never-became-reachable-within-3","errorCode":null,"errorMessage":"Xvfb on ${display} never became reachable within 3s timeout","messagePattern":"Xvfb on (.+?) never became reachable within 3s timeout","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"browse/src/xvfb.ts","lineNumber":155,"sourceCode":"    stdio: ['ignore', 'ignore', 'ignore'],\n  });\n  proc.unref();\n\n  // Wait for the X server to become reachable — Xvfb takes a few hundred ms\n  // to bind. Probe via xdpyinfo with retries.\n  const deadline = Date.now() + 3000;\n  let ready = false;\n  while (Date.now() < deadline) {\n    await Bun.sleep(100);\n    if (!isDisplayFree(displayNum)) { ready = true; break; }\n    // If Xvfb crashed during startup, fail fast.\n    if (proc.exitCode != null) {\n      throw new Error(`Xvfb on ${display} exited during startup (code ${proc.exitCode}). Hint: install xvfb (apt-get install xvfb / yum install xorg-x11-server-Xvfb).`);\n    }\n  }\n  if (!ready) {\n    try { proc.kill('SIGKILL'); } catch { /* ignore */ }\n    throw new Error(`Xvfb on ${display} never became reachable within 3s timeout`);\n  }\n\n  const startTime = readPidStartTime(proc.pid);\n  return {\n    pid: proc.pid,\n    startTime,\n    display,\n    close: () => cleanupXvfb({ pid: proc.pid, startTime, display }),\n  };\n}\n\n/**\n * Cleanup an Xvfb child if it's still ours. Validates ownership first; if\n * the PID has been recycled or the cmdline doesn't match, leave it alone.\n *\n * Best-effort: never throws.\n */\nexport function cleanupXvfb(state: { pid: number; startTime: string; display: string }): void {","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/garrytan/gstack/blob/94993f74012782fd94416dd44b8314f6363a13a4/browse/src/xvfb.ts#L137-L173","documentation":"Error \"Xvfb on ${display} never became reachable within 3s timeout\" thrown in garrytan/gstack.","triggerScenarios":"Thrown at browse/src/xvfb.ts:155 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"94993f74012782fd94416dd44b8314f6363a13a4","analyzedAt":"2026-08-12T04:06:23.140Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}