{"record":{"id":"0a1da96c9a3a64bf","repo":"stablyai/orca","slug":"failed-to-configure-ibus-hangul-key-result-s","errorCode":null,"errorMessage":"Failed to configure IBus Hangul ${key}: ${result.stderr.trim()}","messagePattern":"Failed to configure IBus Hangul (.+?): (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"config/scripts/run-terminal-ibus-hangul-e2e.mjs","lineNumber":95,"sourceCode":"}\n\nfunction commandOutput(command, args) {\n  const result = spawnSync(command, args, { encoding: 'utf8' })\n  return result.status === 0 ? result.stdout.trim() : result.stderr.trim()\n}\n\nfunction configureHangulEngine() {\n  for (const [key, value] of [\n    ['initial-input-mode', 'hangul'],\n    ['hangul-keyboard', '2']\n  ]) {\n    const result = spawnSync(\n      'gsettings',\n      ['set', 'org.freedesktop.ibus.engine.hangul', key, value],\n      { encoding: 'utf8' }\n    )\n    if (result.status !== 0) {\n      throw new Error(`Failed to configure IBus Hangul ${key}: ${result.stderr.trim()}`)\n    }\n  }\n}\n\nasync function waitForHangulEngine(ibusProcess) {\n  const deadline = Date.now() + 15_000\n  while (Date.now() < deadline) {\n    if (ibusProcess.exitCode !== null) {\n      throw new Error(`ibus-daemon exited early with code ${ibusProcess.exitCode}`)\n    }\n    const result = spawnSync('ibus', ['engine', 'hangul'], { stdio: 'pipe' })\n    if (result.status === 0) {\n      return\n    }\n    await delay(100)\n  }\n  throw new Error('Timed out while selecting the IBus Hangul engine')\n}","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/run-terminal-ibus-hangul-e2e.mjs#L77-L113","documentation":"configureHangulEngine() runs `gsettings set org.freedesktop.ibus.engine.hangul <key> <value>` for initial_input_mode=hangul and hangul-keyboard=2. If gsettings exits non-zero, the harness aborts because the IME cannot be driven into a known Hangul state for the E2E test. stderr is surfaced so the operator sees the gsettings error (schema missing, dconf daemon down, permission denied).","triggerScenarios":"Running the native IBus Hangul E2E runner on a host where ibus-hangul is not installed (so the org.freedesktop.ibus.engine.hangul schema is absent), or where the dconf/gsettings backend is unreachable (no DBus session, XDG_RUNTIME_DIR unset).","commonSituations":"Minimal CI image missing ibus-hangul; running under a bare xvfb session without DBus; a container where dconf service was not started; permissions on the dconf database.","solutions":["Install the Hangul engine: sudo apt-get install ibus ibus-hangul (or the distro equivalent).","Ensure a DBus session and XDG_RUNTIME_DIR exist (the harness sets them inside the X11 session; if calling configureHangulEngine standalone, export them first).","Run `gsettings set org.freedesktop.ibus.engine.hangul initial_input-mode hangul` manually to reproduce and read the exact gsettings error."],"exampleFix":"// before\n// ibus-hangul not installed -> gsettings exits 1\n// after\nsudo apt-get install -y ibus ibus-hangul\npnpm run test:e2e:terminal-ibus-hangul-native","handlingStrategy":"try-catch","validationCode":"// preflight: schema + binary present\nconst { spawnSync } = require('node:child_process')\nconst schema = spawnSync('gsettings', ['get','org.freedesktop.ibus.engine.hangul','initial-input-mode'], { encoding: 'utf8' })\nif (schema.status !== 0) {\n  console.error('ibus-hangul schema missing; install ibus-hangul')\n  process.exit(1)\n}","typeGuard":null,"tryCatchPattern":"try {\n  configureHangulEngine()\n} catch (err) {\n  if (/Failed to configure IBus Hangul/.test(String(err))) {\n    console.error('IME config failed — install ibus-hangul and verify DBus session')\n  }\n  throw err\n}","preventionTips":["Bake ibus-hangul and a DBus session into the CI image.","Add a gsettings preflight to the harness that fails with a friendlier message.","Run `gsettings list-schemas | grep hangul` as a CI smoke check."],"tags":["ibus","ime","gsettings","linux","e2e"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}