Can't get docker image to connect to postgres using private network
Anonymous
PROOP

a year ago

I'm trying to spin up a docker image that will connect to a postgres service, but it won't connect successfully over the private network, I have to use a public url and port. The database should never be accessed outside of the docker service so I'd rather not having the extra latency or bandwidth.

Solved

32 Replies

Anonymous
PROOP

a year ago

f3ddaf83-9602-481e-b3e6-4a5786029748


uxuz
MODERATOR

a year ago

can you elaborate more on why it didn't work with the private network, what kind of error occurred?


Anonymous
PROOP

a year ago

> [error] 2025-03-06 20:01:33.318 Postgrex.Protocol (#PID<0.3343.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (postgres.railway.internal:5432): non-existing domain - :nxdomain pid=<0.3343.0>


uxuz
MODERATOR

a year ago

Is this from the build or deploy logs?


Anonymous
PROOP

a year ago

deploy


brody
EMPLOYEE

a year ago

what env?


Anonymous
PROOP

a year ago

do you mean what service?


Anonymous
PROOP

a year ago

if so, the document-engine


Anonymous
PROOP

a year ago

you'll have to look at previous deployments, in order to progress, I used a public domain for now


brody
EMPLOYEE

a year ago

what environment


Anonymous
PROOP

a year ago

oh you mean like staging vs production. staging


brody
EMPLOYEE

a year ago

what language?


Anonymous
PROOP

a year ago

it's not our codebase or anything. It's a docker image that has some commercial software


Anonymous
PROOP

a year ago

so I don't know about any languages


brody
EMPLOYEE

a year ago

is it oss?


Anonymous
PROOP

a year ago

nope


brody
EMPLOYEE

a year ago

its elixir


brody
EMPLOYEE

a year ago

try setting a service variable ERL_AFLAGS="-proto_dist inet6_tcp"


Anonymous
PROOP

a year ago

i'll try that after I figure out this data migration


Anonymous
PROOP

a year ago

seems to at least change the response:

postgres.railway.internal:40141 - no response

Thu Mar 6 10:54:25 PM UTC 2025 - waiting for database to start


Anonymous
PROOP

a year ago

wait, woops forgot to change the port back


Anonymous
PROOP

a year ago

ok, same issue


brody
EMPLOYEE

a year ago

try ECTO_IPV6=true


Anonymous
PROOP

a year ago

no dice


brody
EMPLOYEE

a year ago

then you will need to get in contact with the maintainers of that software and ask them how to make the postgres connection work with ipv6


Anonymous
PROOP

a year ago

i'm guessing private domains use ipv6, and that's the problem?


brody
EMPLOYEE

a year ago

yeah


Anonymous
PROOP

a year ago

dang, there's not an ipv4 internal domain?


brody
EMPLOYEE

a year ago

there is not


Anonymous
PROOP

a year ago

ok. thanks for the assistance


brody
EMPLOYEE

a year ago

no problem


brody
EMPLOYEE

10 months ago

!s


Status changed to Solved brody 11 months ago


Loading...