{"record":{"id":"377c201b6f3f548d","repo":"Yeachan-Heo/oh-my-codex","slug":"api-failed-to-launch-native-binary-executable-i","errorCode":null,"errorMessage":"[api] failed to launch native binary: executable is blocked (${errno.code || 'blocked'})","messagePattern":"\\[api\\] failed to launch native binary: executable is blocked \\((.+?)\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"src/cli/api.ts","lineNumber":222,"sourceCode":"function isHelpRequest(args: readonly string[]): boolean {\n  if (args.length === 0) return true;\n  return args.includes('--help') || args.includes('-h');\n}\n\nexport async function apiCommand(args: string[]): Promise<void> {\n  if (isHelpRequest(args)) {\n    console.log(API_USAGE);\n    return;\n  }\n\n  const binaryPath = await resolveApiBinaryPathWithHydration();\n\n  const result = runApiBinary(binaryPath, args);\n  if (result.error) {\n    const errno = result.error as NodeJS.ErrnoException;\n    const kind = classifySpawnError(errno);\n    if (kind === 'missing') throw new Error(`[api] failed to launch native binary: executable not found (${binaryPath})`);\n    if (kind === 'blocked') throw new Error(`[api] failed to launch native binary: executable is blocked (${errno.code || 'blocked'})`);\n    throw new Error(`[api] failed to launch native binary: ${errno.message}`);\n  }\n\n  writeApiResultOutput(result);\n  if (result.status !== 0) {\n    process.exitCode = typeof result.status === 'number'\n      ? result.status\n      : resolveSignalExitCode(result.signal);\n  }\n}\n","sourceCodeStart":204,"sourceCodeEnd":233,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/cli/api.ts#L204-L233","documentation":"Spawning the omx-api native binary failed with an error classified as 'blocked' — typically EACCES/EPERM, meaning the OS refused to execute the file. The message includes the errno code (or 'blocked') from the underlying Node spawn error.","triggerScenarios":"Running `omx api` when the binary lacks the execute bit, when macOS quarantine attributes flag an downloaded unsigned binary, or when AppArmor/SELinux/noexec mounts prevent execution.","commonSituations":"Binaries downloaded without +x; macOS Gatekeeper quarantine (xattr com.apple.quarantine); Docker volumes mounted with noexec; restrictive CI container policies.","solutions":["chmod +x the binary path shown in the error","Remove macOS quarantine: `xattr -d com.apple.quarantine <binaryPath>`","Remount or relocate the binary off a noexec filesystem / adjust SELinux/AppArmor policy","Point OMX_API_BIN_ENV at a copy of the binary in an executable-permitted location"],"exampleFix":"# before\nomx api status   # EACCES\n# after\nchmod +x $(omx api --print-binary-path)\nomx api status","handlingStrategy":"validation","validationCode":"import { accessSync, constants } from 'node:fs';\ntry { accessSync(binPath, constants.X_OK); } catch { throw new Error(`binary not executable: ${binPath}`); }","typeGuard":null,"tryCatchPattern":"catch (e) { if (/executable is blocked/.test(String(e))) { execSync(`chmod +x ${binPath}`); retry(); } else throw e; }","preventionTips":["chmod +x downloaded binaries as part of provisioning","Strip macOS quarantine attributes in postinstall","Avoid noexec mounts for tool caches"],"tags":["spawn","eacces","permissions","native-binary","macos-quarantine"],"backgroundTag":"spawn-eacces-blocked","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}