Yeachan-Heo/oh-my-codex · error

[sparkshell] failed to launch native binary: ${errno.message

Error message

[sparkshell] failed to launch native binary: ${errno.message}

What it means

Launching the native sparkshell binary failed with an error that is neither ENOENT nor EACCES (and an explicit override is set, bypassing fallback). The raw Node spawn error message is propagated for diagnosis.

Source

Thrown at src/cli/sparkshell.ts:443

    }
    throw error;
  }
  const result = runSparkShellBinary(binaryPath, args);

  if (result.error) {
    const errno = result.error as NodeJS.ErrnoException;
    const kind = classifySpawnError(errno);
    if (!hasExplicitOverride && (kind === 'missing' || kind === 'blocked')) {
      runSparkShellFallback(args, { cause: errno, nativePath: binaryPath, state: kind });
      return;
    }
    if (kind === 'missing') {
      throw new Error(`[sparkshell] failed to launch native binary: executable not found (${binaryPath})`);
    }
    if (kind === 'blocked') {
      throw new Error(`[sparkshell] failed to launch native binary: executable is blocked (${errno.code || 'blocked'})`);
    }
    throw new Error(`[sparkshell] failed to launch native binary: ${errno.message}`);
  }

  if (!hasExplicitOverride && isSparkShellNativeCompatibilityFailure(result)) {
    runSparkShellFallback(args, {
      cause: result.stderr || 'GLIBC-incompatible native sidecar',
      nativePath: binaryPath,
      state: 'glibc-incompatible',
    });
    return;
  }

  writeSparkShellResultOutput(result);

  if (result.status !== 0) {
    process.exitCode = typeof result.status === 'number'
      ? result.status
      : resolveSignalExitCode(result.signal);
  }

View on GitHub (pinned to 3ad79a8a6f)

Solutions

  1. Inspect the embedded message for the errno and address that OS-level cause
  2. Check `ulimit -n`
  3. Reinstall the binary in case of corruption
Defensive patterns

Strategy: try-catch

Try / catch

try { sparkshellCommand(args); }
catch (e) { logSpawnDiagnostics((e as Error).message); /* EMFILE/EINVAL triage */ }

Prevention

When it happens

Trigger: EINVAL from bad argv, EMFILE from exhausted file descriptors, or EIO when spawning the overridden binary.

Common situations: Exotic environments: hardened sandboxes, very low ulimits, corrupted binary files.

Related errors


AI-assisted analysis of Yeachan-Heo/oh-my-codex@3ad79a8a6f (2026-08-27). Data as JSON: /api/errors/a1f0af2bc34da59d. Report an issue: GitHub.