{"record":{"id":"523b77904a655eff","repo":"stablyai/orca","slug":"ibus-daemon-did-not-return-a-pid","errorCode":null,"errorMessage":"ibus-daemon did not return a PID","messagePattern":"ibus-daemon did not return a PID","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"config/scripts/run-terminal-ibus-hangul-e2e.mjs","lineNumber":156,"sourceCode":"      stdio: ['ignore', windowManagerLogFd, windowManagerLogFd]\n    })\n    if (!windowManagerProcess.pid) {\n      throw new Error('xfwm4 did not return a PID')\n    }\n    evidence.windowManagerPid = windowManagerProcess.pid\n    console.error(`[terminal-ime] started xfwm4 PID ${windowManagerProcess.pid}`)\n\n    ibusProcess = spawn(\n      'ibus-daemon',\n      ['--xim', '--verbose', '--panel=disable', '--emoji-extension=disable'],\n      {\n        detached: true,\n        env: process.env,\n        stdio: ['ignore', ibusLogFd, ibusLogFd]\n      }\n    )\n    if (!ibusProcess.pid) {\n      throw new Error('ibus-daemon did not return a PID')\n    }\n    evidence.ibusDaemonPid = ibusProcess.pid\n    console.error(`[terminal-ime] started ibus-daemon PID ${ibusProcess.pid}`)\n    await waitForHangulEngine(ibusProcess)\n    console.error(`[terminal-ime] IBus version: ${commandOutput('ibus', ['version'])}`)\n    console.error(`[terminal-ime] IBus engine: ${commandOutput('ibus', ['engine'])}`)\n    console.error(\n      `[terminal-ime] Hangul initial mode: ${commandOutput('gsettings', [\n        'get',\n        'org.freedesktop.ibus.engine.hangul',\n        'initial-input-mode'\n      ])}`\n    )\n    console.error(\n      `[terminal-ime] Hangul keyboard: ${commandOutput('gsettings', [\n        'get',\n        'org.freedesktop.ibus.engine.hangul',\n        'hangul-keyboard'","sourceCodeStart":138,"sourceCodeEnd":174,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/run-terminal-ibus-hangul-e2e.mjs#L138-L174","documentation":"Symmetric to the xfwm4 check: after spawning ibus-daemon the harness verifies child.pid is set. A missing pid means spawn() could not fork ibus-daemon (missing binary, bad PATH, fork failure) and the subsequent waitForHangulEngine() would poll forever against nothing.","triggerScenarios":"ibus-daemon binary not on PATH, not executable, or fork failed (resource limits, bad env). The detached spawn inherits process.env, so a stripped PATH inside the X11 session causes this.","commonSituations":"ibus package not installed; container image trimmed ibus out; PATH overridden in the session env block (lines ~275-287) dropping /usr/bin; running on a host where ibus-daemon has a different name.","solutions":["Install ibus: sudo apt-get install ibus.","Verify `which ibus-daemon` inside the same env block the harness passes to spawn (note PATH is inherited from process.env, not re-listed).","Check dmesg/journal for fork-failure causes (RLIMIT_NPROC, cgroup pids limit)."],"exampleFix":"// before\n// ibus-daemon missing -> child.pid undefined\n// after\nsudo apt-get install -y ibus","handlingStrategy":"validation","validationCode":"const { spawnSync } = require('node:child_process')\nif (spawnSync('which', ['ibus-daemon']).status !== 0) {\n  console.error('ibus-daemon not installed; apt-get install ibus'); process.exit(1)\n}","typeGuard":"function hasPid(child: { pid?: number }): child is { pid: number } {\n  return typeof child.pid === 'number'\n}","tryCatchPattern":"const ibus = spawn('ibus-daemon', args, { detached: true, stdio: ['ignore', fd, fd] })\nibus.once('error', (e) => { console.error('ibus-daemon spawn failed:', e.message) })\nif (!ibus.pid) throw new Error('ibus-daemon did not return a PID')","preventionTips":["Preflight `which ibus-daemon` before spawn.","Listen for the spawn 'error' event for a clearer ENOENT message.","Inherit the full PATH into the session env block."],"tags":["ibus","ime","spawn","linux","e2e"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}