{"record":{"id":"a4a34a8782676816","repo":"Yeachan-Heo/oh-my-codex","slug":"sparkshell-raw-fallback-failed-errno-message","errorCode":null,"errorMessage":"[sparkshell] raw fallback failed: ${errno.message}","messagePattern":"\\[sparkshell\\] raw fallback failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/sparkshell.ts","lineNumber":397,"sourceCode":"  if (announce) {\n    process.stderr.write(`[sparkshell] native sidecar unavailable; cause=${sanitizeFallbackDiagnostic(cause)}; path=${sanitizeFallbackDiagnostic(nativePath)}; state=${sanitizeFallbackDiagnostic(state)}; remediation=install a compatible native sidecar, reconnect for hydration, or set ${OMX_SPARKSHELL_BIN_ENV}. Falling back to raw command execution without summary support.\\n`);\n  }\n  const result = spawnSync(invocation.argv[0], invocation.argv.slice(1), {\n    cwd: process.cwd(),\n    env: process.env,\n    stdio: 'inherit',\n    encoding: 'utf-8',\n  });\n  if (result.error) {\n    const errno = result.error as NodeJS.ErrnoException;\n    const kind = classifySpawnError(errno);\n    if (kind === 'missing') {\n      throw new Error(`[sparkshell] raw fallback failed: executable not found (${invocation.argv[0]})`);\n    }\n    if (kind === 'blocked') {\n      throw new Error(`[sparkshell] raw fallback failed: executable is blocked (${errno.code || 'blocked'})`);\n    }\n    throw new Error(`[sparkshell] raw fallback failed: ${errno.message}`);\n  }\n  if (result.status !== 0) {\n    process.exitCode = typeof result.status === 'number'\n      ? result.status\n      : resolveSignalExitCode(result.signal);\n  }\n}\n\nexport async function sparkshellCommand(args: string[]): Promise<void> {\n  if (args[0] === '--help' || args[0] === '-h') {\n    console.log(SPARKSHELL_USAGE);\n    return;\n  }\n\n  if (args.length === 0) {\n    throw new Error(`Missing command to run.\\n${SPARKSHELL_USAGE}`);\n  }\n","sourceCodeStart":379,"sourceCodeEnd":415,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/cli/sparkshell.ts#L379-L415","documentation":"spawnSync returned an error in the fallback path that is neither 'missing' (ENOENT) nor 'blocked' (EACCES-style); the raw Node error message is surfaced. This is the catch-all for spawn failures such as EINVAL, EIO, or EMFILE.","triggerScenarios":"Corrupt argv, OS-level resource exhaustion (EMFILE), or exotic spawn errors when launching the fallback program.","commonSituations":"Very low ulimits in CI, broken shebangs, node/runtime version edge cases.","solutions":["Read the embedded errno message to identify the OS failure","Check `ulimit -n` and raise it if EMFILE","Reproduce outside sparkshell: `node -e \"require('child_process').spawnSync(process.argv[1],[])\" tmux`"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  runSparkShellFallback(invocation);\n} catch (e) {\n  const msg = (e as Error).message;\n  if (msg.includes('ENOENT')) installTmux();\n  else if (msg.includes('EACCES')) fixPerms();\n  else throw e;\n}","preventionTips":["Surface the embedded errno message to users for actionable guidance","Retry only after fixing the underlying OS condition, not blindly"],"tags":["spawn","os","environment"],"backgroundTag":"spawn-failed","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}