{"record":{"id":"0fe851b258c45ccd","repo":"stablyai/orca","slug":"xvfb-run-did-not-return-a-pid","errorCode":null,"errorMessage":"xvfb-run did not return a PID","messagePattern":"xvfb-run did not return a PID","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"config/scripts/run-terminal-ibus-hangul-e2e.mjs","lineNumber":286,"sourceCode":"    {\n      cwd: projectDir,\n      detached: true,\n      env: {\n        ...process.env,\n        GTK_IM_MODULE: 'ibus',\n        IBUS_ENABLE_SYNC_MODE: '1',\n        LANG: process.env.LANG || 'C.UTF-8',\n        QT_IM_MODULE: 'ibus',\n        XDG_CACHE_HOME: path.join(evidenceDir, 'cache'),\n        XDG_CONFIG_HOME: path.join(evidenceDir, 'config'),\n        XDG_RUNTIME_DIR: runtimeDir,\n        XMODIFIERS: '@im=ibus'\n      },\n      stdio: 'inherit'\n    }\n  )\n  if (!sessionProcess.pid) {\n    throw new Error('xvfb-run did not return a PID')\n  }\n  console.error(`[terminal-ime] started isolated X11 session PID ${sessionProcess.pid}`)\n  const exitCode = await waitForExit(sessionProcess)\n  const remaining = await stopOwnedProcessGroup(sessionProcess.pid)\n  if (remaining.length > 0) {\n    throw new Error(`Owned X11 session processes survived cleanup: ${remaining.join('; ')}`)\n  }\n  return exitCode\n}\n\nconst insideSession = process.argv[2] === insideSessionFlag\ntry {\n  if (insideSession && !process.argv[3]) {\n    throw new Error(`${insideSessionFlag} requires an evidence directory argument`)\n  }\n  process.exitCode = insideSession ? await runInsideSession(process.argv[3]) : await runOuter()\n} catch (error) {\n  console.error(`[terminal-ime] ${error instanceof Error ? error.message : String(error)}`)","sourceCodeStart":268,"sourceCodeEnd":304,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/run-terminal-ibus-hangul-e2e.mjs#L268-L304","documentation":"runOuter() spawns `xvfb-run` to provide an isolated X server for the inner session. If spawn() returns no pid, xvfb-run could not be forked (binary missing, PATH stripped, fork failure) and the inner session would never start. The harness aborts because every subsequent step depends on a working display.","triggerScenarios":"xvfb-run is not installed or not on PATH; spawn() fork fails due to resource limits; the env passed to spawn drops PATH.","commonSituations":"Minimal CI image without xorg-xserver-xvfb or xserver-xorg-video-dummy; container where PATH was reset; running on a host that uses startx/Xvfb directly instead of the wrapper.","solutions":["Install Xvfb wrapper: sudo apt-get install xvfb (Debian/Ubuntu) or xorg-x11-server-Xvfb (Fedora).","Confirm `which xvfb-run` resolves in the env the harness inherits.","If only Xvfb is available, replace the xvfb-run invocation with an explicit Xvfb + DISPLAY export."],"exampleFix":"// before\n// xvfb-run missing -> no pid\n// after\nsudo apt-get install -y xvfb","handlingStrategy":"validation","validationCode":"const { spawnSync } = require('node:child_process')\nif (spawnSync('which', ['xvfb-run']).status !== 0) {\n  console.error('xvfb-run not installed; apt-get install xvfb'); process.exit(1)\n}","typeGuard":"function hasPid(child: { pid?: number }): child is { pid: number } {\n  return typeof child.pid === 'number'\n}","tryCatchPattern":"const session = spawn('xvfb-run', args, { detached: true, env, stdio: 'inherit' })\nsession.once('error', (e) => { console.error('xvfb-run spawn failed:', e.message) })\nif (!session.pid) throw new Error('xvfb-run did not return a PID')","preventionTips":["Preflight `which xvfb-run` in the harness.","Listen for the spawn 'error' event to report ENOENT cleanly.","Include xvfb in the base CI image."],"tags":["x11","xvfb","spawn","linux","e2e"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}