New database service not reachable after v2 upgrade in railway container.

Hi, today I tried to upgrade my postgres database instance from legacy to v2 in my two projects: both are postgresql + nodejs service with prisma orm I didn't had any issue with the first project, but for the second one i'm having some issues related to the db connection at the service startup. Here the error logged by the console:
PrismaClientInitializationError: Can't reach database server at `viaduct.proxy.rlwy.net`:`57909`
Please make sure your database server is running at `viaduct.proxy.rlwy.net`:`57909`.
PrismaClientInitializationError: Can't reach database server at `viaduct.proxy.rlwy.net`:`57909`
Please make sure your database server is running at `viaduct.proxy.rlwy.net`:`57909`.
I'm sure that the database server is up and working since using the variable "DATABASE_URL" from my local environment i'm able to connect to the db, even with a jdbc url. The strange thing is that this service this service also managed to connect after many attempts. But now I'm not able to deploy other upgrades since the startup always fail Project Id 3f4bc0af-664d-4446-9e7c-486a97145272 Service Id 2ed85fc2-a245-4748-84d9-81e1d2b8acce Anyone has experienced the same issue and resolved it?
Solution:
Could you try adding a 3 second sleep in your start command?
Jump to solution
7 Replies
Percy
Percy10mo ago
Project ID: 3f4bc0af-664d-4446-9e7c-486a97145272,2ed85fc2-a245-4748-84d9-81e1d2b8acce
Solution
Fragly
Fragly10mo ago
Could you try adding a 3 second sleep in your start command?
Riccardo Perra
Riccardo Perra10mo ago
I have the healthcheck enabled for 300s, so the start command run also after the service initialization 🧐 if the db is unreachable, the start command will be rerun automatically later
Fragly
Fragly10mo ago
could you try doing it anyway?
Riccardo Perra
Riccardo Perra10mo ago
it worked poggers but I miss what's difference 🧐
Fragly
Fragly10mo ago
It's some issue in Railway where network takes a bit to initialize, at least as I understand
Riccardo Perra
Riccardo Perra10mo ago
So strange 🤨 at least I expected it works after the 2nd/3rd healthcheck attempt
Want results from more Discord servers?
Add your server