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.

Source

Thrown at server/src/index.ts:267

    try {
      const parsed = new URL(connectionString);
      return parsed.protocol === "postgres:" || parsed.protocol === "postgresql:";
    } catch {
      return false;
    }
  }

  function assertCloudDatabaseContract(): void {
    if (config.deploymentMode !== "authenticated" || config.deploymentExposure !== "public") {
      return;
    }
    if (!config.databaseUrl) {
      throw new Error(
        "authenticated public deployments require DATABASE_URL or config.database.connectionString; refusing embedded PostgreSQL fallback",
      );
    }
    if (!isPostgresConnectionString(config.databaseUrl)) {
      throw new Error(
        "authenticated public deployments require DATABASE_URL to be a postgres/postgresql connection string",
      );
    }
  }

  const LOCAL_BOARD_USER_ID = "local-board";
  const LOCAL_BOARD_USER_EMAIL = "local@paperclip.local";
  const LOCAL_BOARD_USER_NAME = "Board";
  
  async function ensureLocalTrustedBoardPrincipal(db: any): Promise<void> {
    const now = new Date();
    const existingUser = await db
      .select({ id: authUsers.id })
      .from(authUsers)
      .where(eq(authUsers.id, LOCAL_BOARD_USER_ID))
      .then((rows: Array<{ id: string }>) => rows[0] ?? null);
  
    if (!existingUser) {

View on GitHub (pinned to a7e689b3c3)

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@a7e689b3c3 (2026-08-18). Data as JSON: /api/errors/499bcb3daa3d0501. Report an issue: GitHub.