{"record":{"id":"95c83c13898c979f","repo":"paperclipai/paperclip","slug":"invalid-localpath-validated-reason","errorCode":null,"errorMessage":"Invalid localPath: ${validated.reason}","messagePattern":"Invalid localPath: (.+?)","errorType":"http","errorClass":null,"httpStatus":400,"severity":"error","filePath":"server/src/routes/plugins.ts","lineNumber":1192,"sourceCode":"\n    // Cloud install floor: on harness-managed instances only bundled-catalog\n    // sources are installable, regardless of actor privileges or flag state.\n    const cloudManaged = isCloudManagedInstance();\n    if (cloudManaged && !isLocalPath) {\n      res.status(403).json({\n        error:\n          \"npm installs are disabled on cloud-managed instances; only plugins bundled with the application may be installed\",\n      });\n      return;\n    }\n\n    // Canonicalize local install paths on every instance so traversal\n    // segments and symlinks cannot smuggle an aliased path past validation.\n    let canonicalLocalPath: string | undefined;\n    if (isLocalPath) {\n      const validated = await canonicalizeLocalPluginPath(trimmedPackage);\n      if (!validated.ok) {\n        res.status(400).json({ error: `Invalid localPath: ${validated.reason}` });\n        return;\n      }\n      if (cloudManaged && !(await isWithinBundledPluginRoot(validated.canonicalPath))) {\n        res.status(403).json({\n          error:\n            \"cloud-managed instances may only install plugins from the bundled plugin catalog\",\n        });\n        return;\n      }\n      canonicalLocalPath = validated.canonicalPath;\n    }\n\n    try {\n      const installOptions = canonicalLocalPath !== undefined\n        ? { localPath: canonicalLocalPath }\n        : { packageName: trimmedPackage, version: version?.trim() };\n\n      const discovered = await loader.installPlugin(installOptions);","sourceCodeStart":1174,"sourceCodeEnd":1210,"githubUrl":"https://github.com/paperclipai/paperclip/blob/a7e689b3c35347b529cb9f54c9b9a8575a3dcab6/server/src/routes/plugins.ts#L1174-L1210","documentation":"canonicalizeLocalPluginPath rejected the local install path with the reason in validated.reason (traversal segments, symlink aliasing, or non-existent path); local installs must canonicalize to a valid path.","triggerScenarios":"Thrown at server/src/routes/plugins.ts:1176 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the offending parameter to satisfy the constraint stated in the error message (type, range, or allowed values), then retry.","Refer to the route's request validation in the named file and the shared validators for the accepted format."],"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"}