{"record":{"id":"ef6ad01cf996db73","repo":"paperclipai/paperclip","slug":"workspace-relink-did-not-repair-all-server-package","errorCode":null,"errorMessage":"Workspace relink did not repair all server package links: ${remainingMismatches.map((item) => item.packageName).join(\", \")}","messagePattern":"Workspace relink did not repair all server package links: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/src/services/workspace-runtime.ts","lineNumber":664,"sourceCode":"    for (const mismatch of mismatches) {\n      await opts.onLog(\n        \"stdout\",\n        `[runtime]   ${mismatch.packageName}: ${mismatch.actualPath ?? \"missing\"} -> ${mismatch.expectedPath}\\n`,\n      );\n    }\n  }\n\n  for (const mismatch of mismatches) {\n    const linkPath = path.join(workspaceRoot, \"server\", \"node_modules\", ...mismatch.packageName.split(\"/\"));\n    await fs.mkdir(path.dirname(linkPath), { recursive: true });\n    await fs.rm(linkPath, { recursive: true, force: true });\n    await fs.symlink(mismatch.expectedPath, linkPath);\n  }\n\n  const remainingMismatches = findServerWorkspaceLinkMismatches(workspaceRoot);\n  if (remainingMismatches.length === 0) return;\n\n  throw new Error(\n    `Workspace relink did not repair all server package links: ${remainingMismatches.map((item) => item.packageName).join(\", \")}`,\n  );\n}\n\nexport function sanitizeRuntimeServiceBaseEnv(baseEnv: NodeJS.ProcessEnv): NodeJS.ProcessEnv {\n  const env: NodeJS.ProcessEnv = { ...baseEnv };\n  for (const key of Object.keys(env)) {\n    if (key.startsWith(\"PAPERCLIP_\")) {\n      delete env[key];\n    }\n  }\n  delete env.DATABASE_URL;\n  delete env.npm_config_tailscale_auth;\n  delete env.npm_config_authenticated_private;\n  return env;\n}\n\nfunction stableRuntimeServiceId(input: {","sourceCodeStart":646,"sourceCodeEnd":682,"githubUrl":"https://github.com/paperclipai/paperclip/blob/a7e689b3c35347b529cb9f54c9b9a8575a3dcab6/server/src/services/workspace-runtime.ts#L646-L682","documentation":"ensureServerWorkspaceLinksCurrent relinked mismatched server package symlinks in node_modules, but a re-scan still found packages pointing at the wrong path. The self-check after repair failed, naming the remaining mismatched package names.","triggerScenarios":"Thrown at server/src/services/workspace-runtime.ts:624 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Some server package links still mismatch after relink. Re-run install (pnpm install) in the workspace or fix the listed packages' link targets manually."],"exampleFix":null,"handlingStrategy":"retry","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"}