'You have failed to connect to a MongoDB Atlas cluster. Please ensure that your IP whitelist allows connections from your network
MongoDB shell version v4.4.6
Enter password:
connecting to: mongodb://cluster0-shard-00-01.x2gaq.mongodb.net:27017,cluster0-shard-00-02.x2gaq.mongodb.net:27017,cluster0-shard-00-00.x2gaq.mongodb.net:27017/Testingdb?authSource=admin&compressors=disabled&gssapiServiceName=mongodb&replicaSet=atlas-hrfqux-shard-0&ssl=true
{"t":{"$date":"2021-06-16T11:30:24.198Z"},"s":"I", "c":"NETWORK", "id":4333208, "ctx":"ReplicaSetMonitor-TaskExecutor","msg":"RSM host selection timeout","attr":{"replicaSet":"atlas-hrfqux-shard-0","error":"FailedToSatisfyReadPreference: Could not find host matching read preference { mode: \"nearest\" } for set atlas-hrfqux-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 atlas-hrfqux-shard-0/cluster0-shard-00-01.x2gaq.mongodb.net:27017,cluster0-shard-00-02.x2gaq.mongodb.net:27017,cluster0-shard-00-00.x2gaq.mongodb.net:27017 :
connect@src/mongo/shell/mongo.js:374:17
@(connect):2:6
exception: connect failed
exiting with code 1
This error pops out everytime when I try to connect my mongo shell to the Mongodb Atlas.
Is there any solution to get rid out of this error.
Thank you!
Solution 1:[1]
I faced the same error and in my case it was my internet connection which was blocking the mongo servers. I switched from hostel LAN to normal wi-fi, and it got connected!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Sutej Sharma |
