error, :selection_timeout with Atlas Mongo Cluster.
Hello We are facing a problem to connect mongo atlas from elixir 1.6.6 and OTP 19. On few servers It is working fine , but some times it is not connecting on some servers with same elixir and erlang version.
ERROR {:error, :selection_timeout}
Please have a look into this.
You will get that error when the system waits to long trying to find a server to talk to. Are you positive the nodes that are having this timeout issue are successfully connecting to your database?
No , Server which have this issue timeout , are not able to connect to mongo cluster database.
example iex> Mongo.count(:mongo_final, "users", %{}, pool: DBConnection.Poolboy) {:error, :selection_timeout}
It is impossible to tell with that alone why something is not connecting. You should be getting an error in your logs saying why it is unable to connect. You may also want to check your mongo server logs to see if there is anything in there.
As an example, when I attempt to connect to the wrong port, I am getting the following error message
11:53:44.200 [error] Mongo.Protocol (#PID<0.225.0>) failed to connect: ** (Mongo.Error) tcp connect: connection refused - :econnrefused
Are you getting anything remotely like that?
I am going to close this issue. If you are still having it, please reopen it and give some additional information.
currently we are facing this issue.
Do you have any aditional information? Like I mentioned, I am going to need some more information to try and solve this. Are you getting any errors similar to the one I listed above? Do you see anything in your mongodb server logs about failed connections?
Hey sorry for that. actually it was disk usages issue. we resolved . There is no problem with your elixir-mongodb driver.