{"record":{"id":"f067251faf886158","repo":"paperclipai/paperclip","slug":"source-config-not-found-at-source-configpath","errorCode":null,"errorMessage":"Source config not found at ${source.configPath}.","messagePattern":"Source config not found at (.+?)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/worktree.ts","lineNumber":3413,"sourceCode":"  }\n}\n\nasync function runWorktreeReseed(opts: WorktreeReseedOptions): Promise<void> {\n  const seedMode = opts.seedMode ?? \"full\";\n  if (!isWorktreeSeedMode(seedMode)) {\n    throw new Error(`Unsupported seed mode \"${seedMode}\". Expected one of: minimal, full.`);\n  }\n\n  const targetEndpoint = opts.to\n    ? resolveWorktreeEndpointFromSelector(opts.to, { allowCurrent: true })\n    : resolveCurrentWorktreeEndpoint();\n  const source = resolveWorktreeReseedSource(opts);\n\n  if (path.resolve(source.configPath) === path.resolve(targetEndpoint.configPath)) {\n    throw new Error(\"Source and target Paperclip configs are the same. Choose different --from/--to values.\");\n  }\n  if (!existsSync(source.configPath)) {\n    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(","sourceCodeStart":3395,"sourceCodeEnd":3431,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/cli/src/commands/worktree.ts#L3395-L3431","documentation":"Thrown by runWorktreeReseed when existsSync(source.configPath) is false, checked BEFORE attempting readConfig. The source path comes from resolveWorktreeReseedSource, which resolves --from (worktree selector), --from-config (literal path), or --from-data-dir + --from-instance (~/.paperclip/instances/<id>/config.json). This is an early, clear 'file does not exist' guard distinct from the readConfig-based check at 3422.","triggerScenarios":"Calling reseed with --from-config /path/that/does/not/exist, or --from-instance <id> where ~/.paperclip/instances/<id>/config.json was never created, or --from <worktree> whose .paperclip/config.json is missing.","commonSituations":"A typo in the --from-config path. Or pointing at an instance id that was cleaned up. Or a fresh machine where ~/.paperclip has no 'default' instance yet.","solutions":["Verify the path with `ls <source.configPath>`; fix the typo or use an absolute path.","If deriving from instance id, run `paperclipai worktree init` or the primary instance setup first so ~/.paperclip/instances/<id>/config.json exists.","Use --from <worktree-selector> pointing at a worktree that has already been initialized."],"exampleFix":"// before\npaperclipai worktree reseed --from-config ~/wrong.json --to current\n// after\npaperclipai worktree reseed --from-config ~/.paperclip/instances/default/config.json --to current","handlingStrategy":"validation","validationCode":"import fs from \"node:fs\";\n\nfunction ensureSourceConfigExists(sourceConfigPath: string): void {\n  if (!fs.existsSync(sourceConfigPath)) {\n    throw new Error(`Source config not found at ${sourceConfigPath}.`);\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass --from-config as an absolute path to avoid cwd-relative surprises.","When deriving from --from-instance, confirm ~/.paperclip/instances/<id>/config.json exists first.","Run `ls` on the source config path in scripts before invoking reseed."],"tags":["worktree","cli","reseed","config","file-not-found"],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}