{"record":{"id":"cb1917e45faa8371","repo":"affaan-m/ECC","slug":"the-local-it-cli-could-not-be-started-result-e","errorCode":null,"errorMessage":"The local Itô CLI could not be started: ${result.error.message}","messagePattern":"The local Itô CLI could not be started: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/ito.js","lineNumber":288,"sourceCode":"  const isNodeQualification = command === \"evals\";\n  const isDeviceLogin = command === \"login\";\n  const result = spawnSync(invocation.executable, invocation.args, {\n    cwd: process.cwd(),\n    encoding: \"utf8\",\n    // Keep policy helpers immutable for callers, but give child-process\n    // instrumentation its own mutable copy (for example NODE_V8_COVERAGE).\n    env: { ...createSafeItoInvocationEnvironment(environment, args) },\n    stdio: isDeviceLogin ? \"inherit\" : [\"pipe\", \"pipe\", \"pipe\"],\n    maxBuffer: MAX_OUTPUT_BYTES,\n    timeout: isNodeQualification ? NODE_QUALIFICATION_TIMEOUT_MS : undefined,\n    shell: false,\n    windowsHide: true,\n  });\n\n  if (result.stdout) process.stdout.write(result.stdout);\n  if (result.stderr) process.stderr.write(result.stderr);\n  if (result.error) {\n    throw new Error(`The local Itô CLI could not be started: ${result.error.message}`);\n  }\n  if (typeof result.status === \"number\") return result.status;\n  if (result.signal) {\n    throw new Error(`The local Itô CLI terminated by signal ${result.signal}.`);\n  }\n  return 1;\n}\n\nfunction main(argv = process.argv.slice(2), environment = process.env) {\n  try {\n    const parsed = parseArgs(argv, environment);\n    if (parsed.help) {\n      showHelp();\n      return 0;\n    }\n    const executable = resolveItoExecutable(environment);\n    return invokeIto(executable, parsed.invocationArgs, environment);\n  } catch (error) {","sourceCodeStart":270,"sourceCodeEnd":306,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/scripts/ito.js#L270-L306","documentation":"Thrown by invokeIto at scripts/ito.js:287-289 after spawnSync returns with result.error truthy. spawnSync populates error (an ENOENT/EACCES/EMFILE/etc. Node error object) when the child could not be spawned at all — distinct from a child that spawned and then exited non-zero (which returns a numeric result.status and is returned, not thrown). The thrown message interpolates result.error.message verbatim. spawnSync was called with shell:false, env filtered by createSafeItoInvocationEnvironment, and process.execPath as the executable (ito.js:261-264), so the spawn target is the Node binary itself with the ito entry as argv[1].","triggerScenarios":"process.execPath (the running Node binary) cannot spawn the resolved ito.js: most commonly ENOENT on the node binary path itself, EACCES on the ito entry's parent dir, EMFILE/ENOMEM under fd or memory exhaustion, or EAGAIN under fork limits. The thrown message will include the underlying syscall error.","commonSituations":"Container with ulimit -n too low (EMFILE); CI runner out of memory; the ito entry's parent dir lost traverse permission after ECC_ITO_CLI_EXECUTABLE was validated; the Node binary was replaced/moved while ECC was running; SELinux/AppArmor denying exec.","solutions":["Read the underlying syscall error in the message — ENOENT, EACCES, EMFILE each have distinct fixes.","For EACCES: `ls -ld` each parent of ECC_ITO_CLI_EXECUTABLE and ensure traverse (x) bit.","For EMFILE: raise the open-file limit (`ulimit -n 4096` or systemd LimitNOFILE).","For ENOENT on Node itself: confirm `process.execPath` is valid (`node -e 'console.log(process.execPath)'`) and the binary still exists.","Re-run with ECC_ITO_CLI_EXECUTABLE pointing at a freshly rebuilt entry."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const fs = require('fs');\nfunction preflightSpawnConditions(executable) {\n  // verify node binary is reachable\n  if (!fs.existsSync(process.execPath)) throw new Error(`node binary missing: ${process.execPath}`);\n  // verify fd budget\n  // (node -e 'console.log(process)') would not help; rely on ulimit -n in shell\n  // verify parent dir is traversable\n  const dir = path.dirname(fs.realpathSync.native(executable));\n  fs.accessSync(dir, fs.constants.X_OK);\n}","typeGuard":null,"tryCatchPattern":"try {\n  return invokeIto(executable, args, env);\n} catch (err) {\n  if (err.message.startsWith('The local Itô CLI could not be started:')) {\n    const underlying = err.message.split(':').slice(1).join(':').trim();\n    if (underlying.includes('ENOENT')) { /* node binary or script gone */ }\n    else if (underlying.includes('EACCES')) { /* permissions */ }\n    else if (underlying.includes('EMFILE') || underlying.includes('ENFILE')) { /* raise ulimit */ }\n  }\n  throw err;\n}","preventionTips":["Set a healthy ulimit -n in CI (>= 4096).","Build and run ecc ito as the same user to avoid EACCES on the dist tree.","Pin the Node version so process.execPath does not disappear mid-pipeline."],"tags":["cli","ito","spawn","runtime","system-error"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}