{"record":{"id":"d68be4a0557338ce","repo":"paperclipai/paperclip","slug":"kubernetes-post-upload-command-failed-exit-resu","errorCode":null,"errorMessage":"Kubernetes post-upload command failed (exit ${result.exitCode})${detail ? `: ${detail}` : \"\"}","messagePattern":"Kubernetes post-upload command failed \\(exit (.+?)\\)(.+?)` : \"\"\\}","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/plugins/sandbox-providers/kubernetes/src/file-sync.ts","lineNumber":672,"sourceCode":"    const wrapper = [\n      ...canonicalizerPreamble(shQuote(remoteDir)),\n      `_pc_real=$(_pc_resolve \"$1\") || { echo \"ESCAPE\" >&2; exit 42; };`,\n      `case \"$_pc_real/\" in \"$_pc_root\"/*) : ;; *) echo \"ESCAPE\" >&2; exit 42 ;; esac;`,\n      `exec 9<\"$_pc_real\" || { echo \"open failed\" >&2; exit 46; };`,\n      `_pc_fd_real=$(_pc_resolve /proc/self/fd/9) || { echo \"ESCAPE\" >&2; exit 42; };`,\n      `case \"$_pc_fd_real/\" in \"$_pc_root\"/*) : ;; *) echo \"ESCAPE\" >&2; exit 42 ;; esac;`,\n      `cd /proc/self/fd/9 || { echo \"cd failed\" >&2; exit 46; };`,\n      `exec /bin/sh -c \"$2\" pc-post-upload;`,\n    ].join(\"\\n\");\n    const commandTimeoutMs = command.timeoutMs ?? timeoutMs;\n    // Positional args: $0=pc-post-upload, $1=cwd, $2=the verbatim command string.\n    const result = await exec([\"/bin/sh\", \"-c\", wrapper, \"pc-post-upload\", cwd, command.command], {\n      timeoutMs: commandTimeoutMs,\n      maxStderrBytes: SYNC_STDERR_CAP_BYTES,\n    });\n    if (result.exitCode !== 0) {\n      const detail = (result.stderr || \"\").trim();\n      throw new Error(\n        `Kubernetes post-upload command failed (exit ${result.exitCode})${detail ? `: ${detail}` : \"\"}`,\n      );\n    }\n  }\n}\n\nexport async function performSyncIn(input: {\n  exec: PodStreamExec;\n  operations: PluginSyncOperation[];\n  remoteDir: string;\n  timeoutMs: number;\n}): Promise<PluginEnvironmentSyncResult> {\n  const operations: PluginEnvironmentSyncResult[\"operations\"] = [];\n  for (const operation of input.operations) {\n    let filesTransferred = 0;\n    let bytesTransferred = 0;\n\n    const fileMappings = operation.files.filter((mapping) => mapping.kind === \"file\");","sourceCodeStart":654,"sourceCodeEnd":690,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/packages/plugins/sandbox-providers/kubernetes/src/file-sync.ts#L654-L690","documentation":"Error \"Kubernetes post-upload command failed (exit ${result.exitCode})${detail ? `: ${detail}` : \"\"}\" thrown in paperclipai/paperclip.","triggerScenarios":"Thrown at packages/plugins/sandbox-providers/kubernetes/src/file-sync.ts:672 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the exit code and detail; fix the post-upload command 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-14T05:17:10.506Z"}