Mongodb with elixir

Have set up Mongodb and configured the Worker int the application file but am I get connection errorr, am confident the credential are correct cause am using them in Mongo studio
[error] Mongo.Protocol (#PID<0.1208.0>) failed to connect: ** (Mongo.Error) tcp connect: connection refused - :econnrefused

Any idea what am missing?
PS: phoenix application is dockerised.

:econnrefused ist usually not related to the credentials used, but means that the connection was blocked by the network stack on either end or inbetween.

So first you need to debug your network between the docker container and the database server.

The first thing I’d start with is checking port and address configuration of the database in your application. If that’s ok, usually firewall on the target, then the source host. After that you probably have to dissect the network…

1 Like