{"record":{"id":"d4a7f6a673add312","repo":"paperclipai/paperclip","slug":"target-worktree-database-appears-to-be-running-pi","errorCode":null,"errorMessage":"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.","messagePattern":"Target worktree database appears to be running \\(pid (.+?)\\)\\. Stop Paperclip in (.+?) before reseeding, or re-run with --allow-live-target if you want to override this guard\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/worktree.ts","lineNumber":4274,"sourceCode":"    throw new Error(`Source config not found at ${source.configPath}.`);\n  }\n\n  const targetConfig = readConfig(targetEndpoint.configPath);\n  if (!targetConfig) {\n    throw new Error(`Target config not found at ${targetEndpoint.configPath}.`);\n  }\n  const sourceConfig = readConfig(source.configPath);\n  if (!sourceConfig) {\n    throw new Error(`Source config not found at ${source.configPath}.`);\n  }\n\n  const targetPaths = resolveWorktreeReseedTargetPaths({\n    configPath: targetEndpoint.configPath,\n    rootPath: targetEndpoint.rootPath,\n  });\n  const runningTargetPid = resolveRunningEmbeddedPostgresPid(targetConfig);\n  if (runningTargetPid && !opts.allowLiveTarget) {\n    throw new Error(\n      `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.`,\n    );\n  }\n\n  const confirmed = opts.yes\n    ? true\n    : await p.confirm({\n      message: `Overwrite the isolated Paperclip DB for ${targetEndpoint.label} from ${source.label} using ${seedMode} seed mode?`,\n      initialValue: false,\n    });\n  if (p.isCancel(confirmed) || !confirmed) {\n    p.log.warn(\"Reseed cancelled.\");\n    return;\n  }\n\n  if (runningTargetPid && opts.allowLiveTarget) {\n    p.log.warning(`Proceeding even though the target embedded PostgreSQL appears to be running (pid ${runningTargetPid}).`);\n  }","sourceCodeStart":4256,"sourceCodeEnd":4292,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/cli/src/commands/worktree.ts#L4256-L4292","documentation":"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.","triggerScenarios":"Thrown at cli/src/commands/worktree.ts:3431 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Stop Paperclip in ${targetEndpoint.rootPath} and retry the reseed.","Re-run with --allow-live-target to override the guard (risky)."],"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"}