{"record":{"id":"8613df8187699849","repo":"paperclipai/paperclip","slug":"cannot-seed-worktree-database-because-source-confi","errorCode":null,"errorMessage":"Cannot seed worktree database because source config was not found at ${sourceConfigPath}. Use --no-seed or provide --from-config.","messagePattern":"Cannot seed worktree database because source config was not found at (.+?)\\. Use --no-seed or provide --from-config\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/worktree.ts","lineNumber":1702,"sourceCode":"    nonEmpty(process.env.PAPERCLIP_AGENT_JWT_SECRET);\n  mergePaperclipEnvEntries(\n    {\n      ...buildWorktreeEnvEntries(paths, branding),\n      ...(existingAgentJwtSecret ? { PAPERCLIP_AGENT_JWT_SECRET: existingAgentJwtSecret } : {}),\n    },\n    paths.envPath,\n  );\n  ensureAgentJwtSecret(paths.configPath);\n  loadPaperclipEnvFile(paths.configPath);\n  const copiedGitHooks = copyGitHooksToWorktreeGitDir(cwd);\n\n  let seedSummary: string | null = null;\n  let seedExecutionQuarantineSummary: SeededWorktreeExecutionQuarantineSummary | null = null;\n  let pausedScheduledRoutineCount: number | null = null;\n  let reboundWorkspaceSummary: SeedWorktreeDatabaseResult[\"reboundWorkspaces\"] = [];\n  if (opts.seed !== false) {\n    if (!sourceConfig) {\n      throw new Error(\n        `Cannot seed worktree database because source config was not found at ${sourceConfigPath}. Use --no-seed or provide --from-config.`,\n      );\n    }\n    const spinner = p.spinner();\n    spinner.start(`Seeding isolated worktree database from source instance (${seedMode})...`);\n    try {\n      const seeded = await seedWorktreeDatabase({\n        sourceConfigPath,\n        sourceConfig,\n        targetConfig,\n        targetPaths: paths,\n        instanceId,\n        seedMode,\n        preserveLiveWork: opts.preserveLiveWork,\n      });\n      seedSummary = seeded.backupSummary;\n      seedExecutionQuarantineSummary = seeded.executionQuarantine;\n      pausedScheduledRoutineCount = seeded.pausedScheduledRoutines;","sourceCodeStart":1684,"sourceCodeEnd":1720,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/cli/src/commands/worktree.ts#L1684-L1720","documentation":"Thrown inside runWorktreeInit when opts.seed is not false (seeding is on, the default) but sourceConfig resolved to null. Unlike error 220 (which has a readable target and a bad source), here the source config file simply did not exist — existsSync(sourceConfigPath) was false at line 1640, so sourceConfig stayed null. The message directs the user to either disable seeding or supply an explicit source.","triggerScenarios":"Running `worktree:init` outside any Paperclip repo (no discoverable source config) without --no-seed; the auto-discovered source .paperclip/config.json is absent; --from-config points at a path that does not exist.","commonSituations":"First-time setup in a fresh clone that has never run `pnpm dev` to generate a source config; running init from a subdirectory where source config discovery walks up and finds nothing; wrong --from-config path.","solutions":["Provide the source explicitly: `paperclipai worktree:init --from-config /abs/path/to/source/.paperclip/config.json`.","Skip seeding if you want an empty worktree DB: `paperclipai worktree:init --no-seed`.","If you expected a source config to exist, run `pnpm dev` once in the source repo to generate .paperclip/config.json, then retry init.","Verify discovery by running the init from the source repo root."],"exampleFix":"// before\npaperclipai worktree:init   # no source config discoverable\n// after\npaperclipai worktree:init --from-config /home/me/paperclip/.paperclip/config.json\n# or\npaperclipai worktree:init --no-seed","handlingStrategy":"validation","validationCode":"if (opts.seed !== false) {\n  const sourceCfg = existsSync(sourceConfigPath) ? readConfig(sourceConfigPath) : null;\n  if (!sourceCfg) {\n    throw new Error(`No source config at ${sourceConfigPath}; pass --no-seed or --from-config.`);\n  }\n}","typeGuard":"function hasReadableSourceConfig(p: string): boolean {\n  return existsSync(p) && readConfig(p) != null;\n}","tryCatchPattern":"try { await runWorktreeInit(opts); }\ncatch (err) {\n  if (/Cannot seed.*source config was not found/.test(String((err as Error).message))) {\n    await runWorktreeInit({ ...opts, seed: false }); // empty DB fallback\n  } else throw err;\n}","preventionTips":["Run init from the source repo root so source config is auto-discovered.","Pass --from-config explicitly when init'ing outside a Paperclip repo.","Use --no-seed when you intentionally want an empty worktree DB."],"tags":["worktree","config","seeding","cli"],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}