M001: Chapter1-Lab2: connect to Sandbox fails from IDE

Please show the terminal where you tried connect string
What is your cluster name
After pasting the command did you enter?

mongo “mongodb+srv://sandbox.rgjbr.mongodb.net/test” --username m001-student

Cluster name- Sandbox

A screenshot please. A cut-n-paste does not give us the context.

Hi @alok_tripathi ,

Also ensure that in the IP Entry List, you have added allow access from anywhere.

Hi @Shubham_Ranjan @steevej-1495 @Ramachandra_37567
I am facing issue to connect my cluster in IDE space. Below are the full details with screenshot
image

Cluster Name: Sandbox

Connect to Sandbox:

Error in IDE:

Test Result is:
image

Could you please let me know, what did I wrong?

Regards
Ashutosh Singh

Did you allow connect from anywhere in the IP list?

The IDE does not use the same IP as your PC as it is a VM on the cloud.

If you bother hiding the cluster URI, make sure you do it everywhere. The error message tells us what is the hidden part from your first screenshot. It is a training cluster you can terminate and recreate anytime so there is no real risk there.

Hi @steevej-1495
I have added allow access from anywhere and the URI as is:
mongo “mongodb+srv://sandbox.hniqh.mongodb.net/admin” --username m001-student

So, still I need to terminate the cluster and recreate the new one, please confirm.

You don’t. Sorry I did not see that Shubham_Ranjan already mentioned allow access from anywhere.

Hi @steevej-1495

What do I need now, please suggest?

Post a screenshot of the IP Whitelist tab as I suspect it is still not correct.

@steevej-1495 Please find below IP Address List

@steevej-1495
Do I need to edit IP Address as this, please confirm?

image

Yes. You have to Allow Access From Anywhere.

ok @steevej-1495 let me do and will update you.

Thank you @steevej-1495
This is working fine now.

I’m also having difficulty with this specific activity. I’ve tried multiple times and I have deleted and recreated my cluster to the specifications of the course. Each time I enter the string and password, I get the same result, a failed connection. Below is my response:

connecting to: mongodb://sandbox-shard-00-02.igxcj.mongodb.net.:27017,sandbox-shard-00-00.igxcj.mongodb.net.:27017,sandbox-shard-00-01.igxcj.mongodb.net.:27017/sample_training?authSource=admin&gssapiServiceName=mongodb&replicaSet=atlas-fekzky-shard-0&ssl=true
2021-01-25T14:48:55.505+0000 I NETWORK [js] Starting new replica set monitor for atlas-fekzky-shard-0/sandbox-shard-00-02.igxcj.mongodb.net.:27017,sandbox-shard-00-00.igxcj.mongodb.net.:27017,sandbox-shard-00-01.igxcj.mongodb.net.:27017
2021-01-25T14:48:55.644+0000 W NETWORK [ReplicaSetMonitor-TaskExecutor] Unable to reach primary for set atlas-fekzky-shard-0
2021-01-25T14:48:55.644+0000 I NETWORK [ReplicaSetMonitor-TaskExecutor] Cannot reach any nodes for set atlas-fekzky-shard-0. Please check network connectivity and the status of the set. This has happened for 1 checks in a row.
2021-01-25T14:48:56.185+0000 W NETWORK [js] Unable to reach primary for set atlas-fekzky-shard-0
2021-01-25T14:48:56.185+0000 I NETWORK [js] Cannot reach any nodes for set atlas-fekzky-shard-0. Please check network connectivity and the status of the set. This has happened for 2 checks in a row.
2021-01-25T14:48:56.725+0000 W NETWORK [js] Unable to reach primary for set atlas-fekzky-shard-0
2021-01-25T14:48:56.725+0000 I NETWORK [js] Cannot reach any nodes for set atlas-fekzky-shard-0. Please check network connectivity and the status of the set. This has happened for 3 checks in a row.
2021-01-25T14:48:57.265+0000 W NETWORK [js] Unable to reach primary for set atlas-fekzky-shard-0
2021-01-25T14:48:57.265+0000 I NETWORK [js] Cannot reach any nodes for set atlas-fekzky-shard-0. Please check network connectivity and the status of the set. This has happened for 4 checks in a row.
2021-01-25T14:48:57.806+0000 W NETWORK [js] Unable to reach primary for set atlas-fekzky-shard-0
2021-01-25T14:48:57.806+0000 I NETWORK [js] Cannot reach any nodes for set atlas-fekzky-shard-0. Please check network connectivity and the status of the set. This has happened for 5 checks in a row.
2021-01-25T14:48:58.347+0000 W NETWORK [js] Unable to reach primary for set atlas-fekzky-shard-0
2021-01-25T14:48:58.347+0000 I NETWORK [js] Cannot reach any nodes for set atlas-fekzky-shard-0. Please check network connectivity and the status of the set. This has happened for 6 checks in a row.
2021-01-25T14:48:58.887+0000 W NETWORK [js] Unable to reach primary for set atlas-fekzky-shard-0
2021-01-25T14:48:58.887+0000 I NETWORK [js] Cannot reach any nodes for set atlas-fekzky-shard-0. Please check network connectivity and the status of the set. This has happened for 7 checks in a row.
2021-01-25T14:48:59.433+0000 W NETWORK [js] Unable to reach primary for set atlas-fekzky-shard-0
2021-01-25T14:48:59.433+0000 I NETWORK [js] Cannot reach any nodes for set atlas-fekzky-shard-0. Please check network connectivity and the status of the set. This has happened for 8 checks in a row.
2021-01-25T14:48:59.974+0000 W NETWORK [js] Unable to reach primary for set atlas-fekzky-shard-0
2021-01-25T14:48:59.974+0000 I NETWORK [js] Cannot reach any nodes for set atlas-fekzky-shard-0. Please check network connectivity and the status of the set. This has happened for 9 checks in a row.
2021-01-25T14:49:00.517+0000 W NETWORK [js] Unable to reach primary for set atlas-fekzky-shard-0
2021-01-25T14:49:00.517+0000 I NETWORK [js] Cannot reach any nodes for set atlas-fekzky-shard-0. Please check network connectivity and the status of the set. This has happened for 10 checks in a row.
2021-01-25T14:49:01.059+0000 W NETWORK [js] Unable to reach primary for set atlas-fekzky-shard-0
2021-01-25T14:49:01.059+0000 I NETWORK [js] Cannot reach any nodes for set atlas-fekzky-shard-0. Please check network connectivity and the status of the set. This has happened for 11 checks in a row.
2021-01-25T14:49:01.617+0000 W NETWORK [js] Unable to reach primary for set atlas-fekzky-shard-0
2021-01-25T14:49:02.159+0000 W NETWORK [js] Unable to reach primary for set atlas-fekzky-shard-0
2021-01-25T14:49:02.700+0000 W NETWORK [js] Unable to reach primary for set atlas-fekzky-shard-0
2021-01-25T14:49:03.241+0000 W NETWORK [js] Unable to reach primary for set atlas-fekzky-shard-0
2021-01-25T14:49:03.782+0000 W NETWORK [js] Unable to reach primary for set atlas-fekzky-shard-0
2021-01-25T14:49:04.322+0000 W NETWORK [js] Unable to reach primary for set atlas-fekzky-shard-0
2021-01-25T14:49:04.863+0000 W NETWORK [js] Unable to reach primary for set atlas-fekzky-shard-0
2021-01-25T14:49:05.404+0000 W NETWORK [js] Unable to reach primary for set atlas-fekzky-shard-0
2021-01-25T14:49:05.945+0000 W NETWORK [js] Unable to reach primary for set atlas-fekzky-shard-0
2021-01-25T14:49:06.488+0000 W NETWORK [js] Unable to reach primary for set atlas-fekzky-shard-0
2021-01-25T14:49:06.488+0000 I NETWORK [js] Cannot reach any nodes for set atlas-fekzky-shard-0. Please check network connectivity and the status of the set. This has happened for 21 checks in a row.
2021-01-25T14:49:07.029+0000 W NETWORK [js] Unable to reach primary for set atlas-fekzky-shard-0
2021-01-25T14:49:07.578+0000 W NETWORK [js] Unable to reach primary for set atlas-fekzky-shard-0
2021-01-25T14:49:08.118+0000 W NETWORK [js] Unable to reach primary for set atlas-fekzky-shard-0
2021-01-25T14:49:08.659+0000 W NETWORK [js] Unable to reach primary for set atlas-fekzky-shard-0
2021-01-25T14:49:09.199+0000 W NETWORK [js] Unable to reach primary for set atlas-fekzky-shard-0
2021-01-25T14:49:09.740+0000 W NETWORK [js] Unable to reach primary for set atlas-fekzky-shard-0
2021-01-25T14:49:10.282+0000 W NETWORK [js] Unable to reach primary for set atlas-fekzky-shard-0
2021-01-25T14:49:10.283+0000 E QUERY [js] Error: connect failed to replica set atlas-fekzky-shard-0/sandbox-shard-00-02.igxcj.mongodb.net.:27017,sandbox-shard-00-00.igxcj.mongodb.net.:27017,sandbox-shard-00-01.igxcj.mongodb.net.:27017 :
connect@src/mongo/shell/mongo.js:328:13
@(connect):1:6
exception: connect failed

Have you tried the same solution?

Post a screenshot of the network access for your cluster.

Sorry, I had to complete the rest of the course and just skipped that activity.