paperclipai/paperclip · error
Daytona post-upload command failed (exit ${result.exitCode ?
Error message
Daytona post-upload command failed (exit ${result.exitCode ?? "unknown"})${detail ? `: ${detail}` : ""} What it means
Thrown during performSyncIn when a caller-supplied postUploadCommand run verbatim in the sandbox exits non-zero. The first non-zero exit or timeout aborts the remaining commands. The command runs with a structured cwd and no string rewrite, and the error includes the exit code and trimmed stdout detail.
Source
Thrown at packages/plugins/sandbox-providers/daytona/src/file-sync.ts:730
timeoutSeconds,
label: "post-upload command cwd symlink-escape guard",
}),
});
cwd = command.cwd;
}
// C1/C3: run the command VERBATIM with a structured cwd (no string rewrite).
// C4: first non-zero exit or timeout throws and aborts the remaining commands.
const commandTimeoutSeconds =
command.timeoutMs != null ? toTimeoutSeconds(command.timeoutMs) : timeoutSeconds;
// `postUploadCommand` span: run one caller-supplied post-upload command.
const result = await withProviderSpan({
name: "postUploadCommand",
run: () =>
sandbox.process.executeCommand(command.command, cwd, undefined, commandTimeoutSeconds),
});
if ((result.exitCode ?? 1) !== 0) {
const detail = (result.result ?? result.artifacts?.stdout ?? "").toString().trim();
throw new Error(
`Daytona post-upload command failed (exit ${result.exitCode ?? "unknown"})${detail ? `: ${detail}` : ""}`,
);
}
}
}
export async function performSyncIn(input: {
sandbox: Sandbox;
operations: PluginSyncOperation[];
remoteDir: string;
timeoutSeconds: number;
}): Promise<PluginEnvironmentSyncResult> {
const operations: PluginEnvironmentSyncResult["operations"] = [];
for (const operation of input.operations) {
let filesTransferred = 0;
let bytesTransferred = 0;
const fileMappings = operation.files.filter((mapping) => mapping.kind === "file");View on GitHub (pinned to 67001ec6eb)
Solutions
- Read the exit code and stdout detail in the error to diagnose the command failure.
- Run the postUploadCommand manually inside the sandbox (via SSH setup session) to reproduce and fix.
- Verify the cwd and that all uploaded files are present before the command runs.
- Increase timeoutMs for the command if it is timing out, or split long commands.
Example fix
// before: postUploadCommand fails on missing dep
config.postUploadCommands = [{ command: 'npm ci && npm run build', timeoutMs: 60000 }]
// after: install then build, verified cwd
config.postUploadCommands = [{ command: 'npm install --no-audit && npm run build', timeoutMs: 120000 }] Defensive patterns
Strategy: try-catch
Try / catch
try {
await performSyncIn({ sandbox, operations, remoteDir, timeoutSeconds });
} catch (e) {
if (e instanceof Error && e.message.includes('post-upload command failed')) {
// read exit code + stdout; reproduce in SSH setup to fix the command
}
throw e;
} Prevention
- Test postUploadCommands inside the sandbox SSH session before wiring them into config.
- Keep postUploadCommands idempotent and resilient to missing optional files.
- Set a timeoutMs proportional to the command's worst-case runtime.
When it happens
Trigger: A syncIn operation specifies a postUploadCommand (e.g. build, install, lint) that fails inside the sandbox after files are uploaded. The command is executed verbatim via sandbox.process.executeCommand with the configured cwd and timeout.
Common situations: Post-upload build/install step fails (missing deps, syntax error, permission denied); command timeout exceeded; wrong cwd; command references files not yet present; shell differences between local and sandbox environments.
Related errors
- Daytona ${label} command failed (exit ${result.exitCode ?? "
- Daytona sync ${label} path is not a confined absolute path:
- Daytona sync ${label} path escapes the workspace remote dir:
- Daytona syncOut refusing tarball with an unparseable entry l
- Daytona syncOut refusing unparseable symlink entry: ${line}
AI-assisted analysis of paperclipai/paperclip@67001ec6eb (2026-08-12).
Data as JSON: /api/errors/5f81bf4c0f61070b.
Report an issue: GitHub.