paperclipai/paperclip · error

Database for is not up to date. Run `pnpm db:migrate` (or…

Error message

Database for ${configPath} is not up to date.${pending} Run `pnpm db:migrate` (or start Paperclip once) before using worktree merge history.

What it means

Migration-state precondition for worktree merge-history: the database behind the given config has pending migrations, so schema-dependent merge queries could read wrong shapes; the operator must run `pnpm db:migrate` or start Paperclip once first.

Solutions

  1. Run `pnpm db:migrate` in the instance at ${configPath}.
  2. Start Paperclip once so migrations are applied, then retry.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at cli/src/commands/worktree.ts:2278 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/bac8da290782d59f. Report an issue: GitHub.

Appendix: source

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

  }
  const envEntries = readPaperclipEnvEntries(resolvePaperclipEnvFile(configPath));
  let embeddedHandle: EmbeddedPostgresHandle | null = null;

  try {
    if (config.database.mode === "embedded-postgres") {
      embeddedHandle = await ensureEmbeddedPostgres(
        config.database.embeddedPostgresDataDir,
        config.database.embeddedPostgresPort,
      );
    }
    const connectionString = resolveSourceConnectionString(config, envEntries, embeddedHandle?.port);
    const migrationState = await inspectMigrations(connectionString);
    if (migrationState.status !== "upToDate") {
      const pending =
        migrationState.reason === "pending-migrations"
          ? ` Pending migrations: ${migrationState.pendingMigrations.join(", ")}.`
          : "";
      throw new Error(
        `Database for ${configPath} is not up to date.${pending} Run \`pnpm db:migrate\` (or start Paperclip once) before using worktree merge history.`,
      );
    }
    const db = createDb(connectionString) as ClosableDb;
    return {
      db,
      stop: async () => {
        await closeDb(db);
        if (embeddedHandle?.startedByThisProcess) {
          await embeddedHandle.stop();
        }
      },
    };
  } catch (error) {
    if (embeddedHandle?.startedByThisProcess) {
      await embeddedHandle.stop().catch(() => undefined);
    }
    throw error;

View on GitHub (pinned to 01ad858492)