Skip to content

PostgreSQL migration fails with hidden Prisma error (2.3.7, Docker) #2605

Description

@Gromykoss

Evolution API 2.3.7 — Prisma migration fails with PostgreSQL

Environment

  • Evolution API: latest (2.3.7), also tested homolog, 2.4.0-rc1/rc2
  • PostgreSQL: 15-alpine, user evolution, database evolution_db
  • Docker: --network bridge, --dns 8.8.8.8
  • DATABASE_PROVIDER=postgresql
  • DATABASE_URL=postgresql://evolution:***@postgres:5432/evolution_db?schema=evolution_api

Symptom

Container restart loop. deploy_database.sh exits with "Migration failed" — no actual Prisma error reaches logs.

What we tried

  1. DROP SCHEMA evolution_api CASCADE; CREATE SCHEMA evolution_api; — same error
  2. Purged _prisma_migrations table — same error
  3. prisma db push --accept-data-loss — schema pushes but npm run start:prod exits
  4. MariaDB + mysql2 driver — same migration fail
  5. All image tags: latest, homolog, 2.4.0-rc1/rc2 — identical behavior

Root cause (from our debugging)

deploy_database.sh:

npm run db:deploy → rm -rf ./prisma/migrations && cp -r ./prisma/DATABASE_PROVIDER-migrations ./prisma/migrations && npx prisma migrate deploy ...

The script hides Prisma's real error (2>&1 suppression).

Workaround that works

Overriding entrypoint with prisma db push --force-reset --accept-data-loss creates tables, but server crashes.

Request

  1. Expose the real Prisma error in logs (remove stderr suppression in deploy_database.sh)
  2. Fix PostgreSQL migration compatibility for 2.3.7
  3. Or document the correct DATABASE_URL format for PostgreSQL 15

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions