paperclipai/paperclip · error · Error

Target worktree database appears to be running

Error message

Target worktree database appears to be running (pid ${runningTargetPid}). Stop Paperclip in ${targetEndpoint.rootPath} before reseeding, or re-run with --allow-live-target if you want to override this guard.

What it means

Error "Target worktree database appears to be running (pid ${runningTargetPid}). Stop Paperclip in ${targetEndpoint.rootPath} before reseeding, or re-run with --allow-live-target if you want to override this guard." thrown in paperclipai/paperclip.

Solutions

  1. Stop Paperclip in ${targetEndpoint.rootPath} and retry the reseed.
  2. Re-run with --allow-live-target to override the guard (risky).
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at cli/src/commands/worktree.ts:3431 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of paperclipai/paperclip@01ad858492 (2026-08-18). Data as JSON: /api/errors/d4a7f6a673add312. Report an issue: GitHub.

Appendix: source

Thrown at cli/src/commands/worktree.ts:4274

    throw new Error(`Source config not found at ${source.configPath}.`);
  }

  const targetConfig = readConfig(targetEndpoint.configPath);
  if (!targetConfig) {
    throw new Error(`Target config not found at ${targetEndpoint.configPath}.`);
  }
  const sourceConfig = readConfig(source.configPath);
  if (!sourceConfig) {
    throw new Error(`Source config not found at ${source.configPath}.`);
  }

  const targetPaths = resolveWorktreeReseedTargetPaths({
    configPath: targetEndpoint.configPath,
    rootPath: targetEndpoint.rootPath,
  });
  const runningTargetPid = resolveRunningEmbeddedPostgresPid(targetConfig);
  if (runningTargetPid && !opts.allowLiveTarget) {
    throw new Error(
      `Target worktree database appears to be running (pid ${runningTargetPid}). Stop Paperclip in ${targetEndpoint.rootPath} before reseeding, or re-run with --allow-live-target if you want to override this guard.`,
    );
  }

  const confirmed = opts.yes
    ? true
    : await p.confirm({
      message: `Overwrite the isolated Paperclip DB for ${targetEndpoint.label} from ${source.label} using ${seedMode} seed mode?`,
      initialValue: false,
    });
  if (p.isCancel(confirmed) || !confirmed) {
    p.log.warn("Reseed cancelled.");
    return;
  }

  if (runningTargetPid && opts.allowLiveTarget) {
    p.log.warning(`Proceeding even though the target embedded PostgreSQL appears to be running (pid ${runningTargetPid}).`);
  }

View on GitHub (pinned to 01ad858492)