Private network - cannot connect to postgres

the custom start command: pnpx prisma migrate deploy
Error: P1001: Can't reach database server at `postgres.railway.internal`:`5432`
Error: P1001: Can't reach database server at `postgres.railway.internal`:`5432`
Solution:
that does help, for alpine based images you'd want to set a ENABLE_ALPINE_PRIVATE_NETWORKING service variable to true context: https://docs.railway.app/guides/private-networking#workaround-for-alpine-based-images...
Jump to solution
15 Replies
Percy
Percy10mo ago
Project ID: 773fe5a2-1441-4258-a034-523d5ff7a5d6
Dimithree
DimithreeOP10mo ago
773fe5a2-1441-4258-a034-523d5ff7a5d6 already triple check the connection string, and it's the same result
Dimithree
DimithreeOP10mo ago
No description
Fragly
Fragly10mo ago
Could you try adding a 3 second sleep in your custom start command?
Dimithree
DimithreeOP10mo ago
how do you do it?
Fragly
Fragly10mo ago
sleep 3 && pnpx prisma migrate deploy
sleep 3 && pnpx prisma migrate deploy
Dimithree
DimithreeOP10mo ago
alright let me try it
Dimithree
DimithreeOP10mo ago
doesn't do anything, seems like it's execute the sleep 3 then not running the next command
No description
Dimithree
DimithreeOP10mo ago
No description
Dimithree
DimithreeOP10mo ago
i actually tried this for experiment
echo "test" && pnpx prisma migrate deploy
echo "test" && pnpx prisma migrate deploy
the output only show "test" and nothing else
Fragly
Fragly10mo ago
that is baffling
Dimithree
DimithreeOP10mo ago
the image is based on node:18-alpine3.19 not sure if it's help
Solution
Fragly
Fragly10mo ago
that does help, for alpine based images you'd want to set a ENABLE_ALPINE_PRIVATE_NETWORKING service variable to true context: https://docs.railway.app/guides/private-networking#workaround-for-alpine-based-images
Dimithree
DimithreeOP10mo ago
alright let me try wow it's working! thanks a lot @Fragly !
Fragly
Fragly10mo ago
Awesome, I'm glad I could help!
Want results from more Discord servers?
Add your server