{"record":{"id":"30899ce1b72e7507","repo":"paperclipai/paperclip","slug":"createos-transfer-command-failed","errorCode":null,"errorMessage":"CreateOS transfer command failed.","messagePattern":"CreateOS transfer command failed\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/plugins/sandbox-providers/createos/src/file-sync.ts","lineNumber":71,"sourceCode":"function excluded(name: string, patterns: string[]): boolean {\n  name = name.replace(/^\\.\\//, \"\").replace(/\\/$/, \"\");\n  return patterns.some((pattern) => [pattern, `${pattern}/**`, `**/${pattern}`, `**/${pattern}/**`]\n    .some((glob) => path.matchesGlob(name, glob)));\n}\n\nexport async function syncFiles(\n  client: CreateosClient,\n  params: PluginEnvironmentSyncInParams,\n  direction: \"in\" | \"out\",\n  signal: AbortSignal,\n): Promise<PluginEnvironmentSyncResult> {\n  const id = identifier(params.lease.providerLeaseId);\n  const operations: PluginEnvironmentSyncResult[\"operations\"] = [];\n  const run = async (command: string, cwd = ROOT, timeoutMs?: number) => {\n    assertRemotePath(cwd);\n    const result = await execute(client, { ...params, command: \"/bin/bash\", args: [\"-c\", command], cwd },\n      timeoutMs == null ? signal : AbortSignal.any([signal, AbortSignal.timeout(timeoutMs)]));\n    if (result.timedOut || result.exitCode !== 0) throw new Error(\"CreateOS transfer command failed.\");\n  };\n  const upload = async (local: string, remote: string) => {\n    const source = createReadStream(local);\n    try {\n      const init: RequestInit & { duplex: \"half\" } = {\n        method: \"PUT\", body: Readable.toWeb(source) as ReadableStream<Uint8Array>,\n        duplex: \"half\", headers: { \"Content-Type\": \"application/octet-stream\" }, signal,\n      };\n      const response = await client.request(`/sandboxes/${id}/files?path=${encodeURIComponent(remote)}`, init);\n      await response.body?.cancel();\n    } finally { source.destroy(); }\n  };\n  const download = async (remote: string, local: string, mode = 0o600) => {\n    const response = await client.request(`/sandboxes/${id}/files?path=${encodeURIComponent(remote)}`, { signal });\n    if (!response.body) throw new Error(\"CreateOS file download has no body.\");\n    await pipeline(response.body, createWriteStream(local, { flags: \"wx\", mode }), { signal });\n  };\n","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/paperclipai/paperclip/blob/3f1d897a7c018d76563a21c6e39c3c9b03933622/packages/plugins/sandbox-providers/createos/src/file-sync.ts#L53-L89","documentation":"The CreateOS sandbox plugin's internal `run` helper executes a shell command inside the remote sandbox during file synchronization (e.g. mkdir/tar/mv steps). If the command exits non-zero or times out, the plugin discards the actual exit details and throws this generic message. It signals that a remote-side transfer step failed without telling you which command or why.","triggerScenarios":"Any bash command run by syncFiles inside the sandbox (e.g. `mkdir -p`, `tar -x`, `mv`, `chmod` for the mapping) returns a non-zero exit code, or exceeds the optional timeoutMs passed by the caller and is aborted via AbortSignal.timeout.","commonSituations":"Remote sandbox image lacks a tool the transfer step needs (tar, bash built-ins); target directory is read-only or owned by another user; disk quota exceeded on the sandbox; timeoutMs set too low for large uploads; remote path already exists in a conflicting state.","solutions":["Retry the sync with the sandbox exec endpoint to run the failing command manually and inspect its real stderr/exit code, since this error hides those details.","Increase the timeoutMs on the transfer operation if the failure correlates with large files.","Verify the sandbox image provides all tools the transfer relies on (bash, tar) and that the remote target directory is writable.","Check sandbox disk usage and quotas; clean stale files and retry."],"exampleFix":"// before: opaque failure\nawait run(`tar -xzf ${archive} -C ${remoteDir}`, remoteDir, 5_000);\n// after: pre-check target writability and raise the timeout\nawait run(`mkdir -p ${remoteDir} && test -w ${remoteDir}`, remoteDir, 10_000);\nawait run(`tar -xzf ${archive} -C ${remoteDir}`, remoteDir, 60_000);","handlingStrategy":"retry","validationCode":"// pre-flight: ensure remote tools exist\nawait run(`command -v bash && command -v tar`, ROOT, 10_000);","typeGuard":null,"tryCatchPattern":"try {\n  await syncFiles(params);\n} catch (err) {\n  if (err.message === \"CreateOS transfer command failed.\") {\n    // inspect remote state, then retry with longer timeoutMs\n  } else throw err;\n}","preventionTips":["Set generous timeoutMs for large transfers","Verify sandbox image tooling (bash, tar) before syncing","Check sandbox disk quota periodically"],"tags":["sandbox","file-transfer","remote-execution","timeout"],"backgroundTag":"command-not-found","analyzedSha":"3f1d897a7c018d76563a21c6e39c3c9b03933622","analyzedAt":"2026-09-18T08:03:59.046Z","contentChangedAt":"2026-09-18T08:03:59.046Z","schemaVersion":2},"datasetVersion":"2026-09-22T11:17:16.035Z"}