Failed to connect to a MongoDB Atlas cluster

Hi!
Today when i tryed to connect to my cluster by mongoshell, i received the error below:

connecting to: mongodb://cluster0-shard-00-00.cxmga.mongodb.net:27017,cluster0-shard-00-01.cxmga.mongodb.net:27017,cluster0-shard-00-02.cxmga.mongodb.net:27017/productions?authSource=admin&compressors=disabled&gssapiServiceName=mongodb&replicaSet=Cluster0-shard-0&ssl=true
{“t”:{“$date”:“2021-03-31T14:21:12.044Z”},“s”:“I”, “c”:“NETWORK”, “id”:4333208, “ctx”:“ReplicaSetMonitor-TaskExecutor”,“msg”:“RSM host selection timeout”,“attr”:{“replicaSet”:“Cluster0-shard-0”,“error”:“FailedToSatisfyReadPreference: Could not find host matching read preference { mode: "nearest" } for set Cluster0-shard-0”}}

*** You have failed to connect to a MongoDB Atlas cluster. Please ensure that your IP whitelist allows connections from your network.

Error: connect failed to replica set Cluster0-shard-0/cluster0-shard-00-00.cxmga.mongodb.net:27017,cluster0-shard-00-01.cxmga.mongodb.net:27017,cluster0-shard-00-02.cxmga.mongodb.net:27017 :
connect@src/mongo/shell/mongo.js:374:17
@(connect):2:6
exception: connect failed
exiting with code 1

I’ve unninstall and reinstall, but without success.
The error persists…could you help me

Thanks

1 Like

Welcome to the Community!

What is the status of your cluster
Are all nodes up and running
What type of connect string are you using?SRV or a different
Have you whitelisted your IP

1 Like

Hi Ramachandra_Tummala
Thanks for answer, i’ve found the problem…it was my ISP that was blocking the port 27017, today is working fine.

The issue is solved :slight_smile:

Thanks a lot!

3 Likes

thanks , I also have same issue, I changed network and its working fine