{"record":{"id":"31d0952799f7555b","repo":"paperclipai/paperclip","slug":"refusing-to-use-unsafe-install-store-marker-path","errorCode":null,"errorMessage":"Refusing to use unsafe install-store marker ${paths.markerPath}.","messagePattern":"Refusing to use unsafe install-store marker (.+?)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/install-store.ts","lineNumber":95,"sourceCode":"  return {\n    paperclipHome,\n    cliRoot,\n    installsRoot: path.join(cliRoot, \"installs\"),\n    manifestPath: path.join(cliRoot, \"install.json\"),\n    markerPath: path.join(cliRoot, \".managed-install\"),\n    lockPath: path.join(cliRoot, \".install.lock\"),\n    currentPath: path.join(cliRoot, \"current\"),\n    shimPath: path.join(homeDir, \".local\", \"bin\", \"paperclipai\"),\n  };\n}\n\nexport function initializeInstallStore(paths = resolveInstallStorePaths()): void {\n  ensurePrivateDirectory(paths.cliRoot);\n  ensurePrivateDirectory(paths.installsRoot);\n  try {\n    const markerStat = fs.lstatSync(paths.markerPath);\n    if (!markerStat.isFile() || markerStat.isSymbolicLink() || markerStat.nlink > 1) {\n      throw new Error(`Refusing to use unsafe install-store marker ${paths.markerPath}.`);\n    }\n    assertOwnedByCurrentUser(markerStat, paths.markerPath);\n    if (fs.readFileSync(paths.markerPath, \"utf8\") !== MANAGED_STORE_MARKER) {\n      throw new Error(`Refusing to use unrecognized install store ${paths.cliRoot}.`);\n    }\n  } catch (error) {\n    if ((error as NodeJS.ErrnoException).code !== \"ENOENT\") throw error;\n    try {\n      fs.writeFileSync(paths.markerPath, MANAGED_STORE_MARKER, { mode: 0o600, flag: \"wx\" });\n    } catch (writeError) {\n      if (\n        (writeError as NodeJS.ErrnoException).code !== \"EEXIST\" ||\n        fs.readFileSync(paths.markerPath, \"utf8\") !== MANAGED_STORE_MARKER\n      ) {\n        throw writeError;\n      }\n    }\n  }","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/cli/src/install-store.ts#L77-L113","documentation":"initializeInstallStore lstat'ed the .managed-install marker and found it is not a regular unlinked file; the guard refuses unsafe marker shapes before using the store.","triggerScenarios":"Thrown at cli/src/install-store.ts:95 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove or replace the unsafe marker at ${paths.markerPath} (not a symlink, regular file owned by you).","Choose a different install-store directory."],"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"}