{"record":{"id":"eb3988513ce89653","repo":"paperclipai/paperclip","slug":"command-is-not-executable-command-resolved","errorCode":null,"errorMessage":"Command is not executable: \"${command}\" (resolved: \"${absolute}\")","messagePattern":"Command is not executable: \"(.+?)\" \\(resolved: \"(.+?)\"\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/adapter-utils/src/server-utils.ts","lineNumber":3190,"sourceCode":"\nexport async function ensureCommandResolvable(\n  command: string,\n  cwd: string,\n  env: NodeJS.ProcessEnv,\n  options: {\n    remoteExecution?: RemoteExecutionSpec | null;\n  } = {},\n) {\n  if (options.remoteExecution) {\n    const resolvedSsh = await resolveCommandPath(\"ssh\", process.cwd(), env);\n    if (resolvedSsh) return;\n    throw new Error('Command not found in PATH: \"ssh\"');\n  }\n  const resolved = await resolveCommandPath(command, cwd, env);\n  if (resolved) return;\n  if (command.includes(\"/\") || command.includes(\"\\\\\")) {\n    const absolute = path.isAbsolute(command) ? command : path.resolve(cwd, command);\n    throw new Error(`Command is not executable: \"${command}\" (resolved: \"${absolute}\")`);\n  }\n  throw new Error(`Command not found in PATH: \"${command}\"`);\n}\n\nexport async function runChildProcess(\n  runId: string,\n  command: string,\n  args: string[],\n  opts: {\n    cwd: string;\n    env: Record<string, string>;\n    timeoutSec: number;\n    graceSec: number;\n    onLog: (stream: \"stdout\" | \"stderr\", chunk: string) => Promise<void>;\n    onLogError?: (err: unknown, runId: string, message: string) => void;\n    onSpawn?: (meta: { pid: number; processGroupId: number | null; startedAt: string }) => Promise<void>;\n    terminalResultCleanup?: TerminalResultCleanupOptions;\n    stdin?: string;","sourceCodeStart":3172,"sourceCodeEnd":3208,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/packages/adapter-utils/src/server-utils.ts#L3172-L3208","documentation":"Thrown by ensureCommandResolvable when the command string contains a path separator ('/' or '\\\\') so it is treated as a path to an executable, but resolveCommandPath could not resolve it as runnable. The resolved absolute path is included so the caller can see exactly what was attempted. This covers the case where a user points at a specific binary file that is missing, not executable, or wrong-arch.","triggerScenarios":"Calling ensureCommandResolvable('./node_modules/.bin/claude', cwd, env) where that file does not exist relative to cwd, or '/usr/local/bin/agent' that is not present or lacks execute permission. Because the command contains '/', resolveCommandPath fails and the branch reports the resolved absolute path.","commonSituations":"A configured agentCommand path that was correct on one host but not another; a binary that exists but is not chmod +x; a Windows backslash path used on Linux or vice versa; a relative ./bin path run from the wrong cwd.","solutions":["Check the resolved absolute path in the message exists and is executable: ls -l <absolute> and chmod +x if needed.","Correct the agentCommand / command config to point at the real binary location for this host.","If using a relative path, confirm the cwd passed to ensureCommandResolvable is the one the path is relative to.","Reinstall the agent CLI so the expected binary path is populated."],"exampleFix":"// before\nawait ensureCommandResolvable(\"./bin/claude\", cwd, env);\n// after\nawait ensureCommandResolvable(\"/usr/local/bin/claude\", cwd, env);\n// and: chmod +x /usr/local/bin/claude","handlingStrategy":"validation","validationCode":"async function ensureExecutable(command, cwd, env) {\n  if (command.includes(\"/\") || command.includes(\"\\\\\")) {\n    const abs = path.isAbsolute(command) ? command : path.resolve(cwd, command);\n    await fs.access(abs, fs.constants.X_OK);\n  }\n}\nawait ensureExecutable(command, cwd, env);\nawait ensureCommandResolvable(command, cwd, env, options);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefer absolute paths for agentCommand config so resolution is unambiguous.","After installing/upgrading an agent CLI, chmod +x the resolved binary.","Validate agentCommand paths at config load with fs.access(X_OK)."],"tags":["process","executable","path","configuration","paperclip"],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}