{"record":{"id":"ffb0db15ff1c6770","repo":"paperclipai/paperclip","slug":"refusing-to-remove-install-store-with-an-invalid-m","errorCode":null,"errorMessage":"Refusing to remove install store with an invalid manifest at ${paths.cliRoot}.","messagePattern":"Refusing to remove install store with an invalid manifest at (.+?)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/install-store.ts","lineNumber":142,"sourceCode":"    markerStat = fs.lstatSync(paths.markerPath);\n  } catch (error) {\n    if ((error as NodeJS.ErrnoException).code === \"ENOENT\") {\n      throw new Error(`Refusing to remove unverified install store ${paths.cliRoot}.`);\n    }\n    throw error;\n  }\n  if (!markerStat.isFile() || markerStat.isSymbolicLink() || markerStat.nlink > 1) {\n    throw new Error(`Refusing to remove unverified install store ${paths.cliRoot}.`);\n  }\n  assertOwnedByCurrentUser(markerStat, paths.markerPath);\n  if (fs.readFileSync(paths.markerPath, \"utf8\") !== MANAGED_STORE_MARKER) {\n    throw new Error(`Refusing to remove unverified install store ${paths.cliRoot}.`);\n  }\n  const manifest = readInstallManifest(paths);\n  if (!manifest) throw new Error(`Refusing to remove install store without a manifest at ${paths.cliRoot}.`);\n  const relativePayload = path.relative(paths.installsRoot, path.resolve(manifest.payloadPath));\n  if (!relativePayload || relativePayload.startsWith(\"..\") || path.isAbsolute(relativePayload)) {\n    throw new Error(`Refusing to remove install store with an invalid manifest at ${paths.cliRoot}.`);\n  }\n  return manifest;\n}\n\nexport async function withInstallStoreLock<T>(\n  callback: () => Promise<T>,\n  paths = resolveInstallStorePaths(),\n  options: { initialize?: boolean } = {},\n): Promise<T> {\n  if (options.initialize !== false) initializeInstallStore(paths);\n  const token = `${process.pid}:${Date.now()}:${Math.random().toString(16).slice(2)}`;\n  const processIsAlive = (pid: number): boolean => {\n    try {\n      process.kill(pid, 0);\n      return true;\n    } catch (error) {\n      return (error as NodeJS.ErrnoException).code === \"EPERM\";\n    }","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/cli/src/install-store.ts#L124-L160","documentation":"The install.json manifest exists but fails the shape check (schemaVersion/source/previous/payloadPath), so it is not a trustworthy managed manifest and removal is refused.","triggerScenarios":"Thrown at cli/src/install-store.ts:142 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Repair or regenerate the manifest at ${paths.cliRoot}, then retry removal.","Remove the directory manually after verifying its contents are safe."],"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-23T08:17:48.524Z"}