{"record":{"id":"7fafc3637d8cef05","repo":"paperclipai/paperclip","slug":"import-job-not-found","errorCode":null,"errorMessage":"Import job not found","messagePattern":"Import job not found","errorType":"http","errorClass":null,"httpStatus":404,"severity":"error","filePath":"server/src/routes/companies.ts","lineNumber":557,"sourceCode":"    res.json(buildExportFidelityReport(companyId, counts));\n  });\n\n  /**\n   * Floor for the whole company-import surface: single-shot upload, preview,\n   * job polling, chunked transfers, and the per-company agent-safe import\n   * routes. Two independent signals close it, both checked up front — before\n   * auth or body work, the same way the company-creation floor does:\n   *\n   * - a cloud-managed instance (`cloud_managed`): the hosting platform\n   *   provisions the company, so materializing imported companies on a\n   *   managed instance is disabled unconditionally;\n   * - the operator hiding the Import page (`company.import` in\n   *   `PAPERCLIP_HIDDEN_SETTINGS` → `settings_operator_managed`): hiding the\n   *   page also disables its API, so the hide is real rather than cosmetic.\n   *\n   * Export routes stay open either way — they are the tenant's\n   * data-portability escape hatch.\n   */\n  const importFloor = (_req: Request, _res: Response, next: NextFunction) => {\n    if (isCloudManagedInstance()) {\n      throw forbidden(\"Company import is disabled on cloud-managed instances\", {\n        code: \"cloud_managed\",\n      });\n    }\n    if (hidesCompanyPage(getHiddenSettings(), \"company.import\")) {\n      throw forbidden(\"Company import is hidden by the hosting operator\", {\n        code: SETTINGS_OPERATOR_MANAGED_ERROR_CODE,\n      });\n    }\n    next();\n  };\n  // COMPANY_IMPORT_TRANSFERS_ROUTE_PATH nests under the import path, so these\n  // two prefixes cover every import route registered below.\n  router.use(COMPANY_IMPORT_ROUTE_PATH, importFloor);\n  router.use(\"/:companyId/imports\", importFloor);\n","sourceCodeStart":539,"sourceCodeEnd":575,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/server/src/routes/companies.ts#L539-L575","documentation":"Not-found equivalence guard on GET /import/jobs/:jobId: the import job id is unknown, expired from retention, or was created by a different actor key. All cases return the same 404 so import job ids cannot be probed across actors.","triggerScenarios":"Thrown at server/src/routes/companies.ts:524 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the id in the request path or body refers to an existing record in this company; re-list the parent collection to get a valid id.","Check that the record was not deleted or archived, and that the request is scoped to the correct companyId."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}