{"record":{"id":"4d079f300c7988cc","repo":"paperclipai/paperclip","slug":"local-path-adapters-cannot-be-reinstalled-use-rel","errorCode":null,"errorMessage":"Local-path adapters cannot be reinstalled. Use Reload instead.","messagePattern":"Local-path adapters cannot be reinstalled\\. Use Reload instead\\.","errorType":"http","errorClass":null,"httpStatus":400,"severity":"error","filePath":"server/src/routes/adapters.ts","lineNumber":665,"sourceCode":"  // package name, but without the risk of losing the store record.\n  router.post(\"/adapters/:type/reinstall\", async (req, res) => {\n    assertInstanceAdmin(req);\n    assertAdapterCodeInstallAllowed();\n    assertAdapterManagementVisible();\n\n    const type = req.params.type;\n\n    if (BUILTIN_ADAPTER_TYPES.has(type) && !getAdapterPluginByType(type)) {\n      res.status(400).json({ error: \"Cannot reinstall built-in adapter.\" });\n      return;\n    }\n\n    const record = getAdapterPluginByType(type);\n    if (!record) {\n      res.status(404).json({ error: `Adapter \"${type}\" is not an externally installed adapter.` });\n      return;\n    }\n\n    if (record.localPath) {\n      res.status(400).json({ error: \"Local-path adapters cannot be reinstalled. Use Reload instead.\" });\n      return;\n    }\n\n    try {\n      const pluginsDir = getAdapterPluginsDir();\n\n      logger.info({ type, packageName: record.packageName }, \"Reinstalling adapter package via npm\");\n\n      await execFileAsync(\"npm\", [\"install\", \"--no-save\", record.packageName], {\n        cwd: pluginsDir,\n        timeout: 120_000,\n      });\n\n      // Reload the freshly installed adapter\n      const newModule = await reloadExternalAdapter(type);\n      if (!newModule) {","sourceCodeStart":647,"sourceCodeEnd":683,"githubUrl":"https://github.com/paperclipai/paperclip/blob/5716fe907e596ce73501408fc6efdb19fb61edf2/server/src/routes/adapters.ts#L647-L683","documentation":"Source guard on the reinstall route: the adapter's store record shows it was installed from a local path (localPath set), so there is no npm package to re-pull; the route tells the caller to use the reload endpoint instead and returns 400.","triggerScenarios":"Thrown at server/src/routes/adapters.ts:607 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use the Reload operation for local-path adapters instead of reinstall."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5716fe907e596ce73501408fc6efdb19fb61edf2","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}