paperclipai/paperclip · error · Error

Source config not found at ${sourceConfigPath}.

Error message

Source config not found at ${sourceConfigPath}.

What it means

Thrown by ensureWorktreeSeeded when the SOURCE Paperclip instance config (the worktree's origin) cannot be read. The sourceConfigPath is resolved from --from-config/--from-data-dir/--from-instance, or falls back to the pending seed marker's recorded path; readConfig() returns null when the file is absent or unparseable. Seeding clones data FROM this source instance into the worktree, so the source config must exist and be valid before any DB copy can run.

Source

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

    const pending = readWorktreeSeedPendingMarker(markers.pending);
    const sourceConfigPath = opts.fromConfig || opts.fromDataDir || opts.fromInstance
      ? resolveSourceConfigPath({
          fromConfig: opts.fromConfig,
          fromDataDir: opts.fromDataDir,
          fromInstance: opts.fromInstance,
        })
      : path.resolve(pending.sourceConfigPath);

    if (path.resolve(sourceConfigPath) === path.resolve(configPath)) {
      throw new Error(
        "Source and target Paperclip configs are the same. Pass --from-config for the source instance.",
      );
    }

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

    const targetRoot = path.dirname(path.dirname(configPath));
    const targetPaths = resolveWorktreeReseedTargetPaths({ configPath, rootPath: targetRoot });
    const seedDatabase = dependencies.seedDatabase ?? seedWorktreeDatabase;
    const details = await seedDatabase({
      sourceConfigPath,
      sourceConfig,
      targetConfig,
      targetPaths,
      instanceId: targetPaths.instanceId,
      seedMode: "minimal",
      preserveLiveWork: opts.preserveLiveWork,
    });

View on GitHub (pinned to 67001ec6eb)

Solutions

  1. Verify the source config path is readable: `ls -la <sourceConfigPath>` and confirm it is a valid JSON Paperclip config.
  2. Re-point seeding at the correct source instance: `paperclipai worktree:seed --from-config /abs/path/to/source/.paperclip/config.json`.
  3. If the source instance no longer exists, create/restore it first (run `pnpm dev` once in the source repo) before seeding the worktree.
  4. If you cannot recover a source, skip seeding entirely with `--no-seed` and start the worktree with an empty database.

Example fix

// before
paperclipai worktree:seed --from-config ./../old-repo/.paperclip/config.json
// after (use absolute path to the live source repo)
paperclipai worktree:seed --from-config /home/me/projects/paperclip/.paperclip/config.json
Defensive patterns

Strategy: validation

Validate before calling

import { existsSync } from "node:fs";
import { readConfig } from "<paperclip-config-module>";

function assertSourceConfigReadable(sourceConfigPath: string): void {
  const abs = path.resolve(sourceConfigPath);
  if (!existsSync(abs)) throw new Error(`Source config missing: ${abs}`);
  if (!readConfig(abs)) throw new Error(`Source config unreadable/invalid: ${abs}`);
}
// call before ensureWorktreeSeeded
assertSourceConfigReadable(sourceConfigPath);

Type guard

function isReadableSourceConfig(p: string): boolean {
  return existsSync(p) && readConfig(p) != null;
}

Try / catch

try {
  await ensureWorktreeSeeded(opts);
} catch (err) {
  if (err instanceof Error && err.message.startsWith("Source config not found")) {
    // prompt user for --from-config or fall back to --no-seed
  } else throw err;
}

Prevention

When it happens

Trigger: Calling `paperclipai worktree:seed` (or any path that triggers lazy seeding) when the recorded pending-marker sourceConfigPath points at a moved/deleted repo; passing --from-config <path> where the path is wrong or the file is corrupt; passing --from-instance <id> whose ~/.paperclip/instances/<id> has no config.json; the source repo's .paperclip/config.json was removed after the worktree was created.

Common situations: Source repo directory was renamed or moved after `worktree:init`; developer passed a relative path that resolved against the wrong cwd; source instance was wiped via `rm -rf data/` but the worktree's pending marker still references it; typo in --from-config.

Related errors


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