{"record":{"id":"7d9293dda3ae7a7c","repo":"paperclipai/paperclip","slug":"import-transfer-declaration-returned-no-data","errorCode":null,"errorMessage":"Import transfer declaration returned no data.","messagePattern":"Import transfer declaration returned no data\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/client/company.ts","lineNumber":1158,"sourceCode":"}\n\n/**\n * Declare (or resume) the transfer for these zip bytes and upload every part\n * the server reports missing, sequentially with per-part retries. Resolves\n * with the transfer id once the server holds every part.\n */\nexport async function uploadCompanyImportTransfer(\n  api: Pick<PaperclipApiClient, \"post\" | \"putRaw\">,\n  zipBytes: Uint8Array,\n  opts: { onProgress?: (progress: ImportTransferUploadProgress) => void } = {},\n): Promise<string> {\n  const manifest = buildImportTransferManifest(zipBytes);\n  const created = await api.post<CompanyImportTransferCreated>(\n    `/api/companies${COMPANY_IMPORT_TRANSFERS_ROUTE_PATH}`,\n    manifest,\n  );\n  if (!created) {\n    throw new Error(\"Import transfer declaration returned no data.\");\n  }\n  if (created.alreadyCompleted) {\n    // The server keys transfers by content, and this exact zip already\n    // finished an apply — its spooled parts are gone, so it cannot re-run.\n    throw new Error(\n      \"This exact package was already imported by a completed transfer. Re-export the package to import it again.\",\n    );\n  }\n  const missing = new Set(created.missingParts);\n  let uploadedParts = manifest.parts.length - missing.size;\n  let uploadedBytes = manifest.parts.reduce(\n    (sum, part) => (missing.has(part.index) ? sum : sum + part.byteSize),\n    0,\n  );\n  for (const part of manifest.parts) {\n    if (!missing.has(part.index)) continue;\n    const offset = part.index * manifest.partSizeBytes;\n    const bytes = zipBytes.subarray(offset, offset + part.byteSize);","sourceCodeStart":1140,"sourceCodeEnd":1176,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/cli/src/commands/client/company.ts#L1140-L1176","documentation":"uploadCompanyImportTransfer posted the transfer manifest but the API client resolved to a falsy body, so the created-transfer record (id, missing parts) is unavailable and the upload cannot proceed.","triggerScenarios":"Thrown at cli/src/commands/client/company.ts:1158 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the transfer; if it persists, verify the server is reachable and the export package is intact."],"exampleFix":null,"handlingStrategy":"type-guard","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"}