{"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":"Error","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/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/ito.js#L270-L306","documentation":"invokeIto runs the canonical Itô CLI with spawnSync and forwards its stdout/stderr unchanged. If the child process could not be spawned at all, spawnSync populates result.error, and the bridge throws with the underlying reason. This indicates a process-start failure, not a non-zero exit from the CLI itself.","triggerScenarios":"Running an ecc ito subcommand when the node binary in process.execPath is missing/unusable, the CLI script crashed at startup (e.g. ENOENT on a dynamic require, EACCES on the file), spawn limits are hit (EAGAIN), or the interpreter cannot execute dist/bin/ito.js.","commonSituations":"Node version too old for the CLI's syntax; dist build corrupted; disk full or ulimit restrictions; antivirus/seatbelt blocking child spawn; running inside a sandbox where exec of the checkout path is denied.","solutions":["Read result.error.message in the thrown text (ENOENT/EACCES/EAGAIN) and fix that root cause — e.g. EACCES: chmod +x / re-checkout; ENOENT: rebuild dist.","Rebuild the canonical CLI (npm ci && npm run build in cli/ito-compute-cli) to restore a healthy dist/bin/ito.js.","Verify the Node runtime running ECC (process.execPath) is a working, sufficiently new Node; update Node if the CLI fails on startup syntax.","Check ulimit -u / container seccomp policies if the message is EAGAIN or permission-related."],"exampleFix":"// before\n$ ecc ito status\nError: The local Itô CLI could not be started: spawnSync /path/dist/bin/ito.js EACCES\n// after\nchmod +x /path/ito-cloud-runtime/cli/ito-compute-cli/dist/bin/ito.js\n$ ecc ito status   # proceeds","handlingStrategy":"try-catch","validationCode":"const fs = require('fs');\nconst p = process.env.ECC_ITO_CLI_EXECUTABLE;\nif (!p || !fs.existsSync(p) || process.version < 'v20') console.warn('Itô CLI preflight failed');","typeGuard":null,"tryCatchPattern":"try { const code = await invokeIto(args); } catch (e) {\n  if (e.message.startsWith('The local Itô CLI could not be started')) {\n    const m = e.message.match(/ (EACCES|ENOENT|EAGAIN)/);\n    console.error('Spawn failed:', m && m[1], '— rebuild dist or fix permissions');\n  } else throw e;\n}","preventionTips":["Keep the Node runtime current; old interpreters crash the CLI at startup","Rebuild dist after pulling CLI updates","Check ulimits and sandbox policies that block child-process spawn"],"tags":["process","spawn","cli"],"backgroundTag":"file-open-failed","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}