mongodb icon indicating copy to clipboard operation
mongodb copied to clipboard

error, :selection_timeout with Atlas Mongo Cluster.

Open zeroshree opened this issue 8 years ago • 7 comments

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.

zeroshree avatar Sep 26 '18 06:09 zeroshree

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?

ankhers avatar Sep 26 '18 13:09 ankhers

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}

zeroshree avatar Sep 26 '18 13:09 zeroshree

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?

ankhers avatar Sep 26 '18 15:09 ankhers

I am going to close this issue. If you are still having it, please reopen it and give some additional information.

ankhers avatar Oct 11 '18 20:10 ankhers

currently we are facing this issue.

zeroshree avatar Oct 31 '18 19:10 zeroshree

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?

ankhers avatar Oct 31 '18 21:10 ankhers

Hey sorry for that. actually it was disk usages issue. we resolved . There is no problem with your elixir-mongodb driver.

zeroshree avatar Oct 31 '18 21:10 zeroshree