Deployed services suddenly cannot connect to Postgres database
Hello, I have several services deployed that were working fine as of a few days ago that I've realized are down. I haven't made any changes on this project in quite a while, so I'm pretty sure I didn't misconfigure anything.
There is a Postgres database in my project that suddenly cannot be connected to using Railway's preconfigured variables (
Rails gives the error: However, if I use a desktop app (Postico) to try to connect to the Railway database directly, it's fine.
${{Postgres.PGHOST}}
, etc).Rails gives the error: However, if I use a desktop app (Postico) to try to connect to the Railway database directly, it's fine.
21 Replies
Project ID:
b138184c-c87d-46ec-b684-4965890ad049
Project ID: b138184c-c87d-46ec-b684-4965890ad049
can you connect to the database with pgadmin?
I don't have it installed but I'll try now. Postico is fairly similar so I bet it will work
Give me a few minutes to install it and loop back
yeah just some desktop client that can connect to postgre, doesnt have to be pgadmin
In that case, yes. Works instantly using the postgres URL
can you try to configure your code to use the url
notably, my desktop client is using a containers-us-west-XX.railway.app host but inside of my app it looks like railway is giving my app an IP address
yeah, thats what I was gonna try
using ip is fine, as long as the connection is made with the host containers-us-west-XX.railway.app
redeploying now so we'll see what happens
youre now using
DATABASE_URL
in code?
and you have a variable reference setup for that in your service?yep
everything was working fine for months until some undetermined date in the past 3ish days
interesting, well let me know how that change goes
I have a staging environment that I was able to upload my build to that uses the exact same variable references as the production environment, and that one works completely fine.
The production one still will not connect despite being the same code. I tried removing the variable references and re-adding them and that didn't do anything obviously. It's Rails so it's not like I'm writing any database connection logic...
This makes absolutely no sense lol
For context, another service in the same project also is trying to activate the production database and is completely failing to as well
Adding a new Postges instance and migrating my data fixed the issue. I have no clue what went wrong but that container was made in January 2022 so maybe its something to do with the age?
I haven't deleted the old instance yet for if someone at Railway wants to debug
could you send the plugin id?
where can i find that?
open the old database and copy the id from the url
/plugin/<plugin id>
d17b4bb2-8c6e-4e95-9490-8c8d8d3f9438
thats what i thought :P
wasnt sure if it was in the UI somewhere too
thanks, i have shown the team this thread
ππΎ
This was caused by https://railway.instatus.com/clik6k1hk294312awn8v8rox7a1. It should be fixed now, try again?