{"record":{"id":"38f10a5b8d4084ff","repo":"paperclipai/paperclip","slug":"action-failed-with-exit-code-result-exitcode-38f10a","errorCode":null,"errorMessage":"${action} failed with exit code ${result.exitCode ?? \"null\"}${result.stderr.trim() ? `: ${result.stderr.trim()}` : \"\"}","messagePattern":"(.+?) failed with exit code (.+?)(.+?)` : \"\"\\}","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/plugins/sandbox-providers/cloudflare/bridge-template/src/routes.ts","lineNumber":121,"sourceCode":"  cwd = \"/\",\n) {\n  return await executeInSandbox({\n    sandbox,\n    command,\n    args,\n    cwd,\n    timeoutMs: options.timeoutMs,\n    sessionStrategy: options.sessionStrategy,\n    sessionId: options.sessionId,\n  });\n}\n\nfunction requireZeroExit(action: string, result: { exitCode: number | null; timedOut: boolean; stderr: string }) {\n  if (result.timedOut) {\n    throw new Error(`${action} timed out: ${result.stderr.trim()}`);\n  }\n  if (result.exitCode !== 0) {\n    throw new Error(\n      `${action} failed with exit code ${result.exitCode ?? \"null\"}${result.stderr.trim() ? `: ${result.stderr.trim()}` : \"\"}`,\n    );\n  }\n}\n\nasync function ensureWorkspace(\n  sandbox: CloudflareSandbox,\n  options: {\n    remoteCwd: string;\n    sessionStrategy: SessionStrategy;\n    sessionId: string;\n    timeoutMs: number;\n  },\n) {\n  const result = await execLeaseUtility(sandbox, options, \"mkdir\", [\"-p\", options.remoteCwd], \"/\");\n  requireZeroExit(`ensure workspace ${options.remoteCwd}`, result);\n}\n","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/packages/plugins/sandbox-providers/cloudflare/bridge-template/src/routes.ts#L103-L139","documentation":"Error \"${action} failed with exit code ${result.exitCode ?? \"null\"}${result.stderr.trim() ? `: ${result.stderr.trim()}` : \"\"}\" thrown in paperclipai/paperclip.","triggerScenarios":"Thrown at packages/plugins/sandbox-providers/cloudflare/bridge-template/src/routes.ts:121 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the exit code and stderr in the message, fix the underlying command failure, and retry."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}