Unable to connect to railway hosted database during build phase

devi4nt
PRO

a year ago

This morning our deployment is failing. It seems as if the service can no longer access it's postgres database during the build phase. We're using the shared DATABASEPRIVATEURL but I've also tried using a public url.

0 Replies

devi4nt
PRO

a year ago

bcb1aa26-eedf-4586-9a1d-f7063bcc23de


devi4nt
PRO

a year ago

> [stage-0 10/12] RUN  pnpm run prisma:migrate:deploy:

0.924 > @ prisma:migrate:deploy /app
0.924 > prisma migrate deploy
0.924
1.468 Prisma schema loaded from prisma/schema.prisma
1.472 Datasource "db": PostgreSQL database "{redacted}", schema "public" at "postgres.railway.internal:5432"
1.552
1.553 Error: P1001: Can't reach database server at `postgres.railway.internal:5432`
1.553
1.553 Please make sure your database server is running at `postgres.railway.internal:5432`.
1.564  ELIFECYCLE  Command failed with exit code 1.

devi4nt
PRO

a year ago

ok this issue seems to of resolved itself, no rush on this but would be nice to know what happened here.


a year ago

these are logs from the legacy builder, and that is a private domain name, the private network is not available during build on the legacy builder, you would need to be on the V2 builder to be able to communicate with services on the private network


devi4nt
PRO

a year ago

I had tried both, in fact it was originally setup to use the public domain see builds e2675c4 & e2675c4


devi4nt
PRO

a year ago

I only tried the private one out of curiosity to see if it would help, will bear that in mind re: v2 builder 🙂


a year ago

please note that the V2 builder is only available in the us-west region at this time


a year ago

i assume thats what happened? you where on the v2 builder in the us-west region and it was working, then you switched regions and your builds where ran on the legacy builder instead


devi4nt
PRO

a year ago

To my knowledge the builder / region was not changed between build attempts, I only varied the DATABASE_URL environment variable.


a year ago

ah then you simply had it working with the public network and tried switching to the private network


devi4nt
PRO

a year ago

yeah