Connection test failed

Hi, I am having trouble testing my connection using my local mongo cli using the following command:

mongo mongodb+srv://m220student:m220password@[cluster_id].mongodb.net/test?retryWrites=true

I am getting the following error messages:

2019-01-09T22:03:37.739-0500 W NETWORK [thread1] Unable to reach primary for set mflix-shard-0
2019-01-09T22:03:37.739-0500 I NETWORK [thread1] Cannot reach any nodes for set mflix-shard-0. Please check network connectivity and the status of the set. This has happened for 21 checks in a row.
2019-01-09T22:03:37.857-0500 E QUERY [thread1] Error: connect failed to replica set mflix-shard-0/mflix-shard-00-00-xxxxx.mongodb.net.:27017,mflix-shard-00-01-xxxxx.mongodb.net.:27017,mflix-shard-00-02-xxxxx.mongodb.net.:27017 :
connect@src/mongo/shell/mongo.js:251:13

I tried pinging the server directly but unable to do so. I am working from my home Mac computer. Any advise how to fix this issue please.

Thanks
Suresh

Please make sure your IP is whitelisted.

Go to Atlas -> Security -> IP whitelisting and add your IP address or allow access from anywhere.

Kanika

1 Like

The part [cluster_id] must be replace by the actual name of your cluster. The fact the error message shows …xxxxx.mongodb.net… makes me think that this is the problem. But you may have edited the output of the error so that we do not know the real name of your cluster. Which would be a good thing for security reasons since we are asked to whitelist 0.0.0.0 and are using the same credentials.

I have already done that. I see 0.0.0.0/0 in the list of IP Whitelist.

Please share the connection string you are using.

Kanika

I was able to fix this by installing the latest version of Mongo shell. Thanks.