paperclipai/paperclip · error · Error

authenticated public deployments require DATABASE_URL to be…

Error message

authenticated public deployments require DATABASE_URL to be a postgres/postgresql connection string

What it means

Deployment contract guard in assertCloudDatabaseContract: DATABASE_URL is set for an authenticated public deployment, but its URL scheme is not postgres: or postgresql: (isPostgresConnectionString returned false — unparseable URL or another scheme). Cloud deployments require a real PostgreSQL connection string, so startup aborts.

Solutions

  1. Use a postgres:// or postgresql:// connection string for DATABASE_URL.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at server/src/index.ts:260 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of paperclipai/paperclip@3f1d897a7c (2026-08-18). Data as JSON: /api/errors/499bcb3daa3d0501. Report an issue: GitHub.

Appendix: source

Thrown at server/src/index.ts:271

      prompt.close();
    }
  }
  
  type EnsureMigrationsOptions = {
    autoApply?: boolean;
  };
  
  async function ensureMigrations(
    connectionString: string,
    label: string,
    opts?: EnsureMigrationsOptions,
  ): Promise<MigrationSummary> {
    const autoApply = opts?.autoApply === true;
    let state = await inspectMigrations(connectionString);
    if (state.status === "needsMigrations" && state.reason === "pending-migrations") {
      const repair = await reconcilePendingMigrationHistory(connectionString);
      if (repair.repairedMigrations.length > 0) {
        logger.warn(
          { repairedMigrations: repair.repairedMigrations },
          `${label} had drifted migration history; repaired migration journal entries from existing schema state.`,
        );
        state = await inspectMigrations(connectionString);
        if (state.status === "upToDate") return "already applied";
      }
    }
    if (state.status === "upToDate") return "already applied";
    if (state.status === "needsMigrations" && state.reason === "no-migration-journal-non-empty-db") {
      logger.warn(
        { tableCount: state.tableCount },
        `${label} has existing tables but no migration journal. Run migrations manually to sync schema.`,
      );
      const apply = autoApply ? true : await promptApplyMigrations(state.pendingMigrations);
      if (!apply) {
        throw new Error(
          `${label} has pending migrations (${formatPendingMigrationSummary(state.pendingMigrations)}). ` +
            "Refusing to start against a stale schema. Run pnpm db:migrate or set PAPERCLIP_MIGRATION_AUTO_APPLY=true.",

View on GitHub (pinned to 3f1d897a7c)