{"record":{"id":"017fc159c1cdf902","repo":"paperclipai/paperclip","slug":"daytona-syncout-directory-download-failed-for-ma","errorCode":null,"errorMessage":"Daytona syncOut directory download failed for ${mapping.sourcePath}: ${response?.error ?? \"no response returned\"}","messagePattern":"Daytona syncOut directory download failed for (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/plugins/sandbox-providers/daytona/src/file-sync.ts","lineNumber":927,"sourceCode":"      `cd ${shellQuote(mapping.sourcePath)}`,\n      \"set -- *\",\n      'if [ \"$#\" -eq 1 ] && [ \"$1\" = \"*\" ] && [ ! -e \"$1\" ] && [ ! -L \"$1\" ]; then set --; fi',\n      'for entry in .[!.]* ..?*; do [ -e \"$entry\" ] || [ -L \"$entry\" ] || continue; set -- \"$@\" \"$entry\"; done',\n      `if [ \"$#\" -eq 0 ]; then dd if=/dev/zero of=${shellQuote(remoteTar)} bs=1024 count=1; ` +\n        `else tar -c --no-xattrs ${mapping.followSymlinks ? \"-h \" : \"\"}${excludeFlags} -f ${shellQuote(remoteTar)} -- \"$@\"; fi`,\n    ].join(\" && \");\n    await assertSandboxCommandOk(sandbox, `sh -c ${shellQuote(tarScript)}`, timeoutSeconds, \"syncOut tar\");\n\n    const localTar = path.join(tmp, \"sync-out.tar\");\n    let bytesTransferred = 0;\n    try {\n      const responses = await sandbox.fs.downloadFiles(\n        [{ source: remoteTar, destination: localTar }],\n        timeoutSeconds,\n      );\n      const response = responses.find((entry) => entry.source === remoteTar) ?? responses[0];\n      if (!response || response.error) {\n        throw new Error(\n          `Daytona syncOut directory download failed for ${mapping.sourcePath}: ${response?.error ?? \"no response returned\"}`,\n        );\n      }\n      bytesTransferred = (await fs.stat(localTar)).size;\n      await extractHostTarball({ archivePath: localTar, localDir: mapping.targetPath });\n    } finally {\n      // Best-effort remove the sandbox-side scratch tar; the host temp dir is\n      // cleaned by withHostTempDir.\n      await sandbox.fs\n        .deleteFile(remoteTar)\n        .catch(() => undefined);\n    }\n    const filesTransferred = await countHostFiles(mapping.targetPath, mapping.exclude);\n    return { filesTransferred, bytesTransferred };\n  });\n}\n\nexport async function performSyncOut(input: {","sourceCodeStart":909,"sourceCodeEnd":945,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/packages/plugins/sandbox-providers/daytona/src/file-sync.ts#L909-L945","documentation":"Thrown during syncOut directory download when the Daytona fs.downloadFiles response for the remote tarball is missing or carries an `.error`. After creating a tar of the directory sandbox-side and attempting to download it to the host, a missing/errored response aborts before host-side extraction.","triggerScenarios":"The syncOut directory path's remote tar (remoteTar) either returns no matching response or response.error is set from sandbox.fs.downloadFiles. The scratch tar deletion is best-effort in the finally block.","commonSituations":"The remote tar file was removed before download (sandbox cleanup race); Daytona API error; the tarScript sandbox command succeeded but produced an empty/missing archive; permission issues on the remote scratch dir; network interruption during download.","solutions":["Check response.error in the message and verify the remoteTar path is writable/readable in the sandbox.","Ensure no concurrent process deletes the scratch tar between creation and download.","Retry the syncOut for transient Daytona/network failures.","Verify the sandbox-side tarScript (run via assertSandboxCommandOk) actually produced the archive."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await syncOutDirectory(...);\n} catch (e) {\n  if (e instanceof Error && e.message.includes('directory download failed')) {\n    // retry once; verify remoteTar scratch path is writable/readable\n  }\n  throw e;\n}","preventionTips":["Ensure the sandbox scratch dir for the remoteTar is writable and not cleaned concurrently.","Confirm the tarScript command succeeds (assertSandboxCommandOk) before download.","Retry transient Daytona download errors with backoff."],"tags":["daytona","file-sync","syncout","download","directory","network"],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}