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
Percy4mo ago
Project ID: 773fe5a2-1441-4258-a034-523d5ff7a5d6
Dimithree
Dimithree4mo ago
773fe5a2-1441-4258-a034-523d5ff7a5d6 already triple check the connection string, and it's the same result
Dimithree
Dimithree4mo ago
No description
Fragly
Fragly4mo ago
Could you try adding a 3 second sleep in your custom start command?
Dimithree
Dimithree4mo ago
how do you do it?
Fragly
Fragly4mo ago
sleep 3 && pnpx prisma migrate deploy
sleep 3 && pnpx prisma migrate deploy
Dimithree
Dimithree4mo ago
alright let me try it
Dimithree
Dimithree4mo ago
doesn't do anything, seems like it's execute the sleep 3 then not running the next command
No description
Dimithree
Dimithree4mo ago
No description
Dimithree
Dimithree4mo 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
Fragly4mo ago
that is baffling
Dimithree
Dimithree4mo ago
the image is based on node:18-alpine3.19 not sure if it's help
Solution
Fragly
Fragly4mo 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
Dimithree4mo ago
alright let me try wow it's working! thanks a lot @Fragly !
Fragly
Fragly4mo ago
Awesome, I'm glad I could help!