{"record":{"id":"9e4e29ea5e6b0794","repo":"paperclipai/paperclip","slug":"import-request-returned-no-data","errorCode":null,"errorMessage":"Import request returned no data.","messagePattern":"Import request returned no data\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/client/company.ts","lineNumber":1862,"sourceCode":"            }\n          }\n\n          const importApiPath = resolveCompanyImportApiPath({\n            dryRun: false,\n            targetMode: targetPayload.mode,\n            companyId: targetPayload.mode === \"existing_company\" ? targetPayload.companyId : null,\n          });\n          const imported = transferId\n            ? await ctx.api.post<CompanyPortabilityImportResult>(\n                `/api/companies${companyImportTransferApplyPath(transferId)}`,\n                { ...transferMeta, selectedFiles, adapterOverrides },\n              )\n            : await ctx.api.post<CompanyPortabilityImportResult>(importApiPath, {\n                ...previewPayload,\n                adapterOverrides,\n              });\n          if (!imported) {\n            throw new Error(\"Import request returned no data.\");\n          }\n          const tc = getTelemetryClient();\n          if (tc) {\n            const isPrivate = sourcePayload.type !== \"github\";\n            const sourceRef = sourcePayload.type === \"github\" ? sourcePayload.url : from;\n            trackCompanyImported(tc, { sourceType: sourcePayload.type, sourceRef, isPrivate });\n          }\n          let companyUrl: string | undefined;\n          if (!ctx.json) {\n            try {\n              const importedCompany = await ctx.api.get<Company>(apiPath`/api/companies/${imported.company.id}`);\n              const issuePrefix = importedCompany?.issuePrefix?.trim();\n              if (issuePrefix) {\n                companyUrl = buildCompanyDashboardUrl(ctx.api.apiBase, issuePrefix);\n              }\n            } catch {\n              companyUrl = undefined;\n            }","sourceCodeStart":1844,"sourceCodeEnd":1880,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/cli/src/commands/client/company.ts#L1844-L1880","documentation":"Thrown after the final import apply POST (transfer apply path or importApiPath) resolves to null. The apply endpoint must return a CompanyPortabilityImportResult describing the created/updated company; null (204/empty/ignored-404) means the server applied nothing or failed silently. This is the terminal step — by this point preview succeeded.","triggerScenarios":"Preview worked but apply returns 204/empty; server applies the import then crashes/errors before serializing the result; transferId apply sub-path returning empty; a long-running apply hitting a proxy idle timeout that returns an empty 204.","commonSituations":"Large import that exceeds a reverse-proxy response timeout; server bug in the apply serialization step; partial server failure where resources were created but no response body returned.","solutions":["Check whether the company was actually created despite the error: `paperclipai company list --json`.","Inspect server logs around the apply handler for an exception after the work committed.","Increase proxy/gateway timeouts for the apply route if imports are large.","Retry the import; if collision mode is 'rename'/'skip' it will not duplicate."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// After an apply, verify the company actually exists even if the response was empty.\nasync function verifyImportSucceeded(api: { get: (p: string) => Promise<unknown> }, companyId: string): Promise<boolean> {\n  try { const c = await api.get(`/api/companies/${companyId}`); return c != null; } catch { return false; }\n}","typeGuard":"import type { CompanyPortabilityImportResult } from \"@paperclipai/shared\";\n\nfunction isImportResult(v: unknown): v is CompanyPortabilityImportResult {\n  return !!v && typeof v === \"object\"\n    && !!((v as any).company)\n    && typeof (v as any).company.id === \"string\";\n}","tryCatchPattern":"try {\n  const imported = await ctx.api.post<CompanyPortabilityImportResult>(path, payload);\n  if (!isImportResult(imported)) {\n    // The apply may have partially succeeded; verify before retrying.\n    throw new Error(\"Import apply returned no result; verify company list before retry.\");\n  }\n} catch (err) {\n  throw err;\n}","preventionTips":["Use collision mode 'rename' or 'skip' so retries do not duplicate data.","Raise proxy timeouts for the apply route; large imports are slow.","After a suspicious apply, always list companies before re-running."],"tags":["cli","import","apply","empty-response","company-portability","timeout"],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}