can't run console if service connects to DB through railway internal network
dwaynemac
PROOP

2 years ago

My service uses DATABASEPRIVATEURL to connect to db. If i run "railway run xx" connection to DB wont work.

What's the suggested way to work around this?

5 Replies

fvr1
PRO

2 years ago

I had the same issue!
It's bc you are trying to connect from your home network and DATABASEPRIVATEURL only works in the railway internal network. So you should use the DATABASE_URL if you want to connect from your terminal (that env gives access to networks outside railway cloud environment).


dwaynemac
PROOP

2 years ago

But in order to do this I need to redeploy the service, right?


fvr1
PRO

2 years ago

yes


dwaynemac
PROOP

2 years ago

As feedback for the product this doesn’t seem good ux considering private networking is the recommended connection to db services.


ray-chen
EMPLOYEE

2 years ago

Yep, @fvr1 is right!

This is great feedback - there's some disconnect on private networking and local dev using CLI currently. While the recommended way to connect to DB services within Railway is via private networking, we don't yet expose any sort of tunneling capability via the CLI, so you'll have to use the public URL to connect from any non-Railway clients.


Loading...