Database connection issue
ucscu_cbs
PROOP
3 months ago
My frontend displays but the postgres databse connection failure even though the configurations are correct
2 Replies
ilyassbreth
FREE
3 months ago
add a sleep before your app starts by changing your start command to:
sleep 3 && node server.js(or whatever your start command is)
railway's private networking needs a few seconds to initialize. if that doesn't work, check if you're using alpine linux - you'd need to add ENABLE_ALPINE_PRIVATE_NETWORKING=true as an env variable to your app service (not the database).
also make sure you're using DATABASE_URL and not DATABASE_PUBLIC_URL for the private connection.
pradipshirgaonkar
FREE
3 months ago
check your schema and root passwords are correct