widojansen
Mongo.MongoDBConnection error tcp connect: non-existing domain - :nxdomain
Hi,
I’m on Intel Mac with MacOS 11.7.2 with a MongoDB in a docker file.
Mongo CLI connects to MongoDB with default setting and I can add and list the data.
When I do ‘curl localhost:27017’ I get the expected error message ‘It looks like you are trying to access MongoDB over HTTP on the native driver port.’
In the mix.exs I have a depency: {:mongodb_driver, “~> 1.0.0”}
But when I try to connect from elixir after ‘iex -S mix run’ with
{:ok, conn} = Mongo.start_link(url: “mongodb://localhost:27017/rest_api_db”)
Then I keep on receiving the error message:
[error] Mongo.MongoDBConnection (pid<0.421.0>) failed to connect: ** (Mongo.Error) 17f29de58a5e:27017 tcp connect: non-existing domain - :nxdomain
Changing localhost to 127.0.0.1 gives the same error.
What am I doing wrong?
Marked As Solved
widojansen
Solved.
‘docker compose up’ is different as ‘docker-compose up’
With the first command I cannot connect with the second I can!
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance










