R
Railway5mo ago
Salo

Postgres connection error after migration

I'm having an issue after migrating my postgres service, i'm getting "Error: P1001: Can't reach database server". I successfully migrated the Postgres service, and can correctly see the migrated service. I also updated my DATABASE_URL variable to use ${{Postgres.DATABASE_URL}} on my backend service. There is no hardcoded references to the DB in my code and I'm not using .env files. From there I'm getting the Error: P1001: Can't reach database server when trying to run my api/backend service (which is running KeystoneJs fyi). Any ideas on what the connection issue could be coming from? Project ID b511c8ba-c047-4b52-809c-8e3fd5381b69
7 Replies
Percy
Percy5mo ago
Project ID: b511c8ba-c047-4b52-809c-8e3fd5381b69
Salo
Salo5mo ago
oh didn't see that issue posted in my search... can you just add the timeout into the DATABASE_URL variable as ${{Postgres.DATABASE_URL}}?connect_timeout=30&pool_timeout=30&socket_timeout=30 or is that something to add in the codebase?
Brody
Brody5mo ago
thats the correct way
Salo
Salo5mo ago
perfect... that fixed the issue. thanks @Brody
Brody
Brody5mo ago
no problem!