Evolution API crashing with PostgreSQL P1000 authentication error (Railway internal Postgres)
lelosmundim-wq
FREEOP

21 days ago

Hi everyone,

I'm trying to deploy Evolution API on Railway and connect it to a Railway PostgreSQL database, but the service keeps crashing during deployment with a Prisma authentication error.

Setup

  • Railway project with:

    • PostgreSQL service (online and running)

    • Evolution API service

  • DATABASE_URL is set using Railway environment variable reference (not manually typed)

  • Database and API are in the same Railway project/environment

Error shown in Deploy Logs

Error: P1000: Authentication failed against database server at `postgres`,
the provided database credentials for `user` are not valid.

Logs show:

Datasource "db": PostgreSQL database "evolution", schema "public" at "postgres:5432"
Prisma schema loaded from prisma/postgresql-schema.prisma
Migration failed

What I already tried

  • Redeploying the service

  • Restarting both Postgres and Evolution API

  • Recreating DATABASE_URL using Railway reference

  • Confirmed Postgres service is online

  • Confirmed environment variables are loading correctly

Question

Is there any additional configuration required for Evolution API + Railway Postgres?

Specifically:

  • Do I need to use DATABASE_PRIVATE_URL instead of DATABASE_URL?

  • Does Railway require a different host format for Prisma migrations?

  • Is there a known issue with Prisma migrations resolving postgres hostname internally?

Any guidance would be greatly appreciated — I'm fairly new to Railway deployments.

Thanks in advance pray emoji

$10 Bounty

1 Replies

lu4p
FREETop 5% Contributor

21 days ago

You should use the internal url to not pay for egress between your app and database. Also make sure that prisma is reading the right env variables.

See this article in how to setup env vars correctly.

https://www.prisma.io/docs/orm/core-concepts/supported-databases/postgresql

That said using the public url should work in principle although it's better to use the internal url.

You're likely shipping a .env file which overrides DATABASE_URL to something else, or have the Prisma client setup in a way where it expects another env var.


Loading...