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]

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/,, :

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.


Please make sure your IP is whitelisted.

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


1 Like

The part [cluster_id] must be replace by the actual name of your cluster. The fact the error message shows …… 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 and are using the same credentials.

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

Please share the connection string you are using.


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