paperclipai/paperclip · critical · Error

Refusing to remove install store without a manifest at ${pat

Error message

Refusing to remove install store without a manifest at ${paths.cliRoot}.

What it means

Thrown by assertManagedInstallStore() after the marker is verified but readInstallManifest(paths) returns null — meaning the install.json manifest file is absent (ENOENT). The library refuses to remove a store whose manifest is missing because it cannot determine the payload path to safely prune, and removing blindly could leave orphaned or destroy wanted data.

Source

Thrown at cli/src/install-store.ts:139

  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;
}

export async function withInstallStoreLock<T>(
  callback: () => Promise<T>,
  paths = resolveInstallStorePaths(),
  options: { initialize?: boolean } = {},
): Promise<T> {
  if (options.initialize !== false) initializeInstallStore(paths);
  const token = `${process.pid}:${Date.now()}:${Math.random().toString(16).slice(2)}`;
  const processIsAlive = (pid: number): boolean => {
    try {
      process.kill(pid, 0);
      return true;

View on GitHub (pinned to 67001ec6eb)

Solutions

  1. If the store is stale, remove cliRoot manually ('rm -rf ~/.paperclip/cli') and reinitialize with 'paperclipai install'.
  2. If a known-good manifest exists in a backup, restore install.json to paths.manifestPath and retry.
  3. Run 'paperclipai install' to perform a fresh install which will write a new manifest.
  4. Do not fabricate a manifest by hand — its payloadPath must point at a real payload under installsRoot.

Example fix

$ ls ~/.paperclip/cli/install.json
ls: install.json: No such file or directory
$ rm -rf ~/.paperclip/cli
$ paperclipai install
Defensive patterns

Strategy: validation

Validate before calling

import fs from "node:fs";
import { resolveInstallStorePaths } from "./install-store.js";

function manifestExists(paths = resolveInstallStorePaths()): boolean {
  return fs.existsSync(paths.manifestPath);
}

Type guard

import { readInstallManifest, resolveInstallStorePaths } from "./install-store.js";

function hasManifest(paths = resolveInstallStorePaths()): boolean {
  return readInstallManifest(paths) !== null;
}

Try / catch

try {
  assertManagedInstallStore(paths);
} catch (err) {
  if (err instanceof Error && err.message.includes("without a manifest")) {
    console.error("Manifest missing. Reset: rm -rf ~/.paperclip/cli && paperclipai install");
    process.exit(1);
  }
  throw err;
}

Prevention

When it happens

Trigger: Called assertManagedInstallStore() where the marker is valid but paths.manifestPath (~/.paperclip/cli/install.json) does not exist, so readInstallManifest returns null.

Common situations: 1) Partial uninstall removed install.json but left the rest of the store. 2) The store was initialized but no install ever completed to write a manifest. 3) The manifest was manually deleted. 4) A sync excluded install.json.

Related errors


AI-assisted analysis of paperclipai/paperclip@67001ec6eb (2026-08-12). Data as JSON: /api/errors/78dfaf03ff24f4c3. Report an issue: GitHub.