{"record":{"id":"8447f07090be8d95","repo":"paperclipai/paperclip","slug":"reinstall-failed-message","errorCode":null,"errorMessage":"Reinstall failed: ${message}","messagePattern":"Reinstall failed: (.+?)","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"server/src/routes/adapters.ts","lineNumber":706,"sourceCode":"      unregisterServerAdapter(type);\n      registerWithSessionManagement(newModule);\n      configSchemaCache.delete(type);\n\n      // Sync store version from disk\n      let newVersion: string | undefined;\n      const updatedRecord = getAdapterPluginByType(type);\n      if (updatedRecord) {\n        newVersion = readAdapterPackageVersionFromDisk(updatedRecord);\n        if (newVersion) {\n          addAdapterPlugin({ ...updatedRecord, version: newVersion });\n        }\n      }\n\n      logger.info({ type, version: newVersion }, \"Adapter reinstalled from npm\");\n\n      res.json({ type, version: newVersion, reinstalled: true });\n    } catch (err) {\n      const message = err instanceof Error ? err.message : String(err);\n      logger.error({ err, type }, \"Failed to reinstall adapter\");\n      res.status(500).json({ error: `Reinstall failed: ${message}` });\n    }\n  });\n\n  // ── GET /api/adapters/:type/config-schema ────────────────────────────────\n  // Serve a declarative config schema for an adapter's UI form fields.\n  // The adapter's getConfigSchema() resolves all options (static and dynamic)\n  // so the UI receives a fully hydrated schema in a single fetch.\n  const configSchemaCache = new Map<string, {\n    adapter: ServerAdapterModule;\n    schema: AdapterConfigSchema;\n    fetchedAt: number;\n  }>();\n  const CONFIG_SCHEMA_TTL_MS = 30_000;\n\n  router.get(\"/adapters/:type/config-schema\", async (req, res) => {\n    // Config schemas are read-only form metadata used when org members create","sourceCodeStart":688,"sourceCodeEnd":724,"githubUrl":"https://github.com/paperclipai/paperclip/blob/5716fe907e596ce73501408fc6efdb19fb61edf2/server/src/routes/adapters.ts#L688-L724","documentation":"Wrapped failure in the reinstall route's catch block: the npm reinstall or subsequent reload/re-registration threw, and the underlying message is re-surfaced with a 500 so the operator can see why the reinstall aborted.","triggerScenarios":"Thrown at server/src/routes/adapters.ts:648 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the failure message, fix the package or environment issue, and retry the reinstall."],"exampleFix":null,"handlingStrategy":"try-catch","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"}