paperclipai/paperclip · critical · Error
Refusing to remove unverified install store ${paths.cliRoot}
Error message
Refusing to remove unverified install store ${paths.cliRoot}. What it means
Thrown by assertManagedInstallStore() when attempting to lstatSync the marker file fails with ENOENT — the marker file (.managed-install) does not exist at all. Without a valid marker the library cannot confirm the store is Paperclip-managed, so it refuses to proceed with removal. The message is shared with two other checks (lines 132, 136) but this specific throw is the missing-file case.
Source
Thrown at cli/src/install-store.ts:127
) {
throw writeError;
}
}
}
}
export function assertManagedInstallStore(paths = resolveInstallStorePaths()): InstallManifest {
const cliStat = fs.lstatSync(paths.cliRoot);
if (!cliStat.isDirectory() || cliStat.isSymbolicLink()) {
throw new Error(`Refusing to remove unsafe install-store path ${paths.cliRoot}.`);
}
assertOwnedByCurrentUser(cliStat, paths.cliRoot);
let markerStat: fs.Stats;
try {
markerStat = fs.lstatSync(paths.markerPath);
} catch (error) {
if ((error as NodeJS.ErrnoException).code === "ENOENT") {
throw new Error(`Refusing to remove unverified install store ${paths.cliRoot}.`);
}
throw error;
}
if (!markerStat.isFile() || markerStat.isSymbolicLink() || markerStat.nlink > 1) {
throw new Error(`Refusing to remove unverified install store ${paths.cliRoot}.`);
}
assertOwnedByCurrentUser(markerStat, paths.markerPath);
if (fs.readFileSync(paths.markerPath, "utf8") !== MANAGED_STORE_MARKER) {
throw new Error(`Refusing to remove unverified install store ${paths.cliRoot}.`);
}
const manifest = readInstallManifest(paths);
if (!manifest) throw new Error(`Refusing to remove install store without a manifest at ${paths.cliRoot}.`);
const relativePayload = path.relative(paths.installsRoot, path.resolve(manifest.payloadPath));
if (!relativePayload || relativePayload.startsWith("..") || path.isAbsolute(relativePayload)) {
throw new Error(`Refusing to remove install store with an invalid manifest at ${paths.cliRoot}.`);
}
return manifest;
}View on GitHub (pinned to 67001ec6eb)
Solutions
- If the store is stale, remove the entire cliRoot manually ('rm -rf ~/.paperclip/cli') since the library cannot safely verify it.
- If you want to keep the store, run initializeInstallStore() (or 'paperclipai install') to write a fresh marker — but only if you trust the directory contents.
- Restore the marker from a known-good backup if available.
- Do not fabricate a marker by hand unless you are certain the directory is a genuine Paperclip store.
Example fix
$ ls ~/.paperclip/cli/.managed-install ls: .managed-install: No such file or directory $ rm -rf ~/.paperclip/cli $ paperclipai install # recreates store + marker
Defensive patterns
Strategy: validation
Validate before calling
import fs from "node:fs";
import { resolveInstallStorePaths } from "./install-store.js";
function markerExists(paths = resolveInstallStorePaths()): boolean {
try { fs.lstatSync(paths.markerPath); return true; } catch { return false; }
} Type guard
import fs from "node:fs";
function markerPresent(markerPath: string): boolean {
try { fs.lstatSync(markerPath); return true; } catch (e) {
return (e as NodeJS.ErrnoException).code !== "ENOENT";
}
} Try / catch
try {
assertManagedInstallStore(paths);
} catch (err) {
if (err instanceof Error && err.message.includes("unverified install store")) {
console.error("Marker missing. To reset: rm -rf ~/.paperclip/cli && paperclipai install");
process.exit(1);
}
throw err;
} Prevention
- Do not delete the .managed-install marker manually.
- Use initializeInstallStore() to (re)create the marker rather than hand-creating the directory.
- Ensure backup/sync tools include dotfiles.
When it happens
Trigger: Called assertManagedInstallStore() where paths.markerPath does not exist on disk (the catch around lstatSync rethrows with ENOENT mapped to this refusal).
Common situations: 1) The store directory exists but the marker was manually deleted. 2) A partial uninstall removed the marker but left cliRoot. 3) The directory was hand-created without going through initializeInstallStore. 4) A sync tool excluded the dotfile marker.
Related errors
- Refusing to use unsafe install-store marker ${paths.markerPa
- Refusing to use unrecognized install store ${paths.cliRoot}.
- Refusing to remove unsafe install-store path ${paths.cliRoot
- Refusing to use non-directory install-store path ${directory
- Refusing to modify path not owned by the current user: ${tar
AI-assisted analysis of paperclipai/paperclip@67001ec6eb (2026-08-12).
Data as JSON: /api/errors/edce6e63082b08a0.
Report an issue: GitHub.