Trouble switching to private networking

danbisdev
HOBBY

8 months ago

I have a webserver and a database and I'm trying to connect to the db from the webserver using the PGPRIVATEHOST but it isn't working. Is there something else I need to do other than switch from PGHOST to PGPRIVATEHOST?

0 Replies

danbisdev
HOBBY

8 months ago

2e90105f-9e57-4bf0-b0d4-cc830c988fd2


8 months ago

you would also need to use the private port


danbisdev
HOBBY

8 months ago

Where would I find the private port? It's not listed as an env var on the database


8 months ago

service settings

1308951356580565000


danbisdev
HOBBY

8 months ago

That's for public networking though. I don't see one under Private Networking?


8 months ago

5432 is the private port


danbisdev
HOBBY

8 months ago

Oh weird okay let me give that a go


danbisdev
HOBBY

8 months ago

psycopg2.OperationalError: could not translate host name "postgres.railway.internal" to address: Name or service not known Still getting this :/


8 months ago

please switch the runtime to v2

1308954387506266000


8 months ago

also, please dont specify install commands in the build command field, it is poor practice

1308954530301350000


danbisdev
HOBBY

8 months ago

Oh yeah I had a buddy fix that for me and I forgot to remove it from the build command


danbisdev
HOBBY

8 months ago

Alrighty looks like one of those two things fixed it! Thanks for the help 😄


8 months ago

no problem!


Trouble switching to private networking - Railway Help Station