Changed region of postgres db and now DATABASE_URL seems FUBAR
hornta
PROOP

3 months ago

So I noticed I was running my postgres in singapore and my compute server which connects to the db in EU so I decided to change region of the db and after that things have stopped working. I've even tried to remove DATABASE_URL and then readd it, but still says: Error: P1001: Can't reach database server atpostgres.railway.internal:5432``

Have someone else had this problem?

32 Replies

3 months ago

did you copy the new internal connection string from postgres & redeploy?


3 months ago

(i believe it would create a new one)


hornta
PROOP

3 months ago

I've checked and made sure that DATABASEURL in my compute service is the same as DATABASEURL in the postgres service.


hornta
PROOP

3 months ago

I want to click on Somethings wrong, but doing that will just revert the migration:

1442238951673958400


hornta
PROOP

3 months ago

I tried to re-deploy the current instance(which is btw connected to the database), but it fails:

1442240533446525200


hornta
PROOP

3 months ago

1442241020371800000


hornta
PROOP

3 months ago

I am able to connect to the db using the DATABASEPUBLICURL locally though so the db is actually running.


hornta
PROOP

3 months ago

I have had zero problems with this until I decided to change region


3 months ago

im not really sure if this would work, as i havent done a swap from region to region db wise, but you can deploy a new db in the correct region, and then reconnect it to your backend service (and then deattach the volume from the original one, and readd it to the new one, ensuring all of its vars are in the service)

1442243136314146800


hornta
PROOP

3 months ago

Ive tried that, I remember when I used railway several years ago there was a way to detach the volume but I cant find it now:

1442243440959291400


3 months ago

hmm that im not sure why it doesnt appear


hornta
PROOP

3 months ago

maybe because im on free plan?


3 months ago

perhaps it might be bc you tried to swap the region already


3 months ago

i dont think so


hornta
PROOP

3 months ago

I could do the pro plan but i kinda wanna be sure things works then 😄


3 months ago

nah i dont think its a plan issue


hornta
PROOP

3 months ago

Tried creating a completely fresh pg db and still no such setting:

1442252356963274800


3 months ago

hmm..I wonder then if it is 🤔


3 months ago

I assume you right clicked it the actual volume, not the db?


hornta
PROOP

3 months ago

Yes I right clicked the volume.


3 months ago

technically you can delete the db and it’ll unmount the volume but that’s not really a fix


3 months ago

but deleting the db means you’d be losing your data in it


hornta
PROOP

3 months ago

When I deleted the db, the volume is now a separate block.


hornta
PROOP

3 months ago

so Ill try attaching it to a new postgres service


hornta
PROOP

3 months ago

omg, but now the new db i created ends up in singapore again


3 months ago

within your account settings, is your default region Singapore or Asia?


hornta
PROOP

3 months ago

aha, thx


3 months ago

try that and deploy a new db and it should work with your region


hornta
PROOP

3 months ago

Still failed


hornta
PROOP

3 months ago

I even tried now to re-create the compute service and it's still fd up xD


hornta
PROOP

3 months ago

oh it must be the freakin volume that is some how corrupted.


hornta
PROOP

3 months ago

I made a completely new db now and connected it to the completely new compute service and now it correctly works.


Loading...