{"record":{"id":"f1a12aedbfd54eae","repo":"paperclipai/paperclip","slug":"import-failed-on-the-server","errorCode":null,"errorMessage":"Import failed on the server.","messagePattern":"Import failed on the server\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"ui/src/pages/CompanyImport.tsx","lineNumber":836,"sourceCode":"      // server-side, so keep watching rather than reporting a failure that\n      // may not exist.\n    }\n    if (job?.status === \"succeeded\") {\n      clearStoredImportJob(storageKey);\n      if (!job.importResult) {\n        // The server confirmed success but retained only the compact summary\n        // (a cloud tenant job, or a board job whose full result aged out of\n        // memory). Still a success — navigate by the summary's company id.\n        return {\n          status: \"completed-expired\",\n          companyId: job.result?.companyId ?? null,\n        };\n      }\n      return { status: \"completed\", result: job.importResult };\n    }\n    if (job?.status === \"failed\") {\n      clearStoredImportJob(storageKey);\n      throw new Error(job.error?.message ?? \"Import failed on the server.\");\n    }\n    await waitForNextImportJobPoll();\n  }\n}\n\n// ── Main page ─────────────────────────────────────────────────────────\n\nexport function CompanyImport() {\n  const {\n    selectedCompanyId,\n    selectedCompany,\n    setSelectedCompanyId,\n  } = useCompany();\n  const { setBreadcrumbs } = useBreadcrumbs();\n  const { pushToast } = useToastActions();\n  const queryClient = useQueryClient();\n  const packageInputRef = useRef<HTMLInputElement | null>(null);\n  const { data: session } = useQuery({","sourceCodeStart":818,"sourceCodeEnd":854,"githubUrl":"https://github.com/paperclipai/paperclip/blob/a7e689b3c35347b529cb9f54c9b9a8575a3dcab6/ui/src/pages/CompanyImport.tsx#L818-L854","documentation":"Terminal-state branch in watchImportJob: the polled import job's status flipped to 'failed' on the server (the import pipeline rejected the package), so the watch loop surfaces the server-side failure message to the user.","triggerScenarios":"Thrown at ui/src/pages/CompanyImport.tsx:836 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the server logs for the import failure reason, fix it, and retry the import."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a7e689b3c35347b529cb9f54c9b9a8575a3dcab6","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}