Trouble Connecting to PostgreSQL on Railway: "Can't reach database server" Error
benooon
HOBBYOP

2 years ago

hi

in my local computer i am able to connect to my postgresql instance, but when im uploading to railway and using the varibale DATABASE_URL i get an error Can't reach database server at viaduct.proxy.*******:****

and they are in the same environment

5 Replies

appiers
HOBBY

2 years ago

Hi there,

We are facing the same issue, postgres is getting connected from our localhost using connection string, but not working on railway itself.

Railway team please help, our production is stuck due to this.


brody
EMPLOYEE

2 years ago

Please make sure you have all the needed environment variables in place and that you are using them correctly.


appiers
HOBBY

2 years ago

env variable named DATABASE_URL is referenced from running instance of postgres inside same railway project, still getting this error "Can't reach database server at `roundhouse.proxy"

and database can be accessed from our localhost using same connection string.


brody
EMPLOYEE

2 years ago

Try adding a 3 second sleep before attempting a connection.


appiers
HOBBY

2 years ago

Great, It worked
Thanks!

Could you please tell us why this is happening?


Loading...