R
Railway5mo ago
devi4nt

Unable to connect to railway hosted database during build phase

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 DATABASE_PRIVATE_URL but I've also tried using a public url.
Solution:
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
Jump to solution
8 Replies
Percy
Percy5mo ago
Project ID: bcb1aa26-eedf-4586-9a1d-f7063bcc23de
devi4nt
devi4ntOP5mo ago
bcb1aa26-eedf-4586-9a1d-f7063bcc23de
> [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.
> [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.
ok this issue seems to of resolved itself, no rush on this but would be nice to know what happened here.
Solution
Brody
Brody5mo 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
devi4ntOP5mo ago
I had tried both, in fact it was originally setup to use the public domain see builds e2675c4 & e2675c4 I only tried the private one out of curiosity to see if it would help, will bear that in mind re: v2 builder 🙂
Brody
Brody5mo ago
please note that the V2 builder is only available in the us-west region at this time 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
devi4ntOP5mo ago
To my knowledge the builder / region was not changed between build attempts, I only varied the DATABASE_URL environment variable.
Brody
Brody5mo ago
ah then you simply had it working with the public network and tried switching to the private network
devi4nt
devi4ntOP5mo ago
yeah
Want results from more Discord servers?
Add your server