Can’t connect to Atlas cluster via IDE (M001)

I’m at M001, trying to connect using the given online IDE.
I can’t seem to successfully connect…
I’m getting this error:

user@M001# mongo "mongodb+srv://sandbox.2pb0l.mongodb.net/test" --username m001-student -p m001-mongodb-basicsMongoDB shell version v4.0.5
connecting to: mongodb://sandbox-shard-00-01.2pb0l.mongodb.net.:27017,sandbox-shard-00-00.2pb0l.mongodb.net.:27017,sandbox-shard-00-02.2pb0l.mongodb.net.:27017/test?authSource=admin&gssapiServiceName=mongodb&replicaSet=atlas-zpqu3s-shard-0&ssl=true
2021-12-08T20:13:46.414+0000 I NETWORK  [js] Starting new replica set monitor for atlas-zpqu3s-shard-0/sandbox-shard-00-01.2pb0l.mongodb.net.:27017,sandbox-shard-00-00.2pb0l.mongodb.net.:27017,sandbox-shard-00-02.2pb0l.mongodb.net.:27017
2021-12-08T20:13:49.085+0000 W NETWORK  [js] Unable to reach primary for set atlas-zpqu3s-shard-0
2021-12-08T20:13:49.085+0000 I NETWORK  [js] Cannot reach any nodes for set atlas-zpqu3s-shard-0. Please check network connectivity and the status of the set. This has happened for 1 checks in a row.
2021-12-08T20:13:53.577+0000 W NETWORK  [js] Unable to reach primary for set atlas-zpqu3s-shard-0
2021-12-08T20:13:53.577+0000 I NETWORK  [js] Cannot reach any nodes for set atlas-zpqu3s-shard-0. Please check network connectivity and the status of the set. This has happened for 2 checks in a row.
2021-12-08T20:13:57.743+0000 W NETWORK  [js] Unable to reach primary for set atlas-zpqu3s-shard-0
2021-12-08T20:13:57.743+0000 I NETWORK  [js] Cannot reach any nodes for set atlas-zpqu3s-shard-0. Please check network connectivity and the status of the set. This has happened for 3 checks in a row.
2021-12-08T20:14:01.968+0000 W NETWORK  [js] Unable to reach primary for set atlas-zpqu3s-shard-0
2021-12-08T20:14:01.968+0000 I NETWORK  [js] Cannot reach any nodes for set atlas-zpqu3s-shard-0. Please check network connectivity and the status of the set. This has happened for 4 checks in a row.
2021-12-08T20:14:01.968+0000 E QUERY    [js] Error: connect failed to replica set atlas-zpqu3s-shard-0/sandbox-shard-00-01.2pb0l.mongodb.net.:27017,sandbox-shard-00-00.2pb0l.mongodb.net.:27017,sandbox-shard-00-02.2pb0l.mongodb.net.:27017 :
connect@src/mongo/shell/mongo.js:328:13
@(connect):1:6
exception: connect failed

*** IMPORTANT NOTE ***
I WAS ABLE TO SUCCESFULLY CONNECT using:
a) Windows Shell
b) MongoDB Compass
using the same URI, when the only difference was that I used mongosh instead of mongo.
The IDE is the only one giving me trouble.
Please help!

1 Like

So I was finally able to fix it.

The problem for me was that I did not mark “Allow Access From Anywhere”,
but rather used a “IP Whitelist” and inserted my computer’s IP.
I needed to log into my Atlas, go to “Network Access”,
click on “edit” where inserted the IP is in the row,
and then in the pop-up screen choose “Allow Access From Anywhere”.

That also explains why I was able to log in from my Windows Shell, but not by using the IDE, cause the IDE has a different IP than mine.

1 Like

Implicit session: session { “id” : UUID(“50006228-2c96-4e1d-b51c-4443b82a1506”) }
MongoDB server version: 4.4.10
WARNING: shell and server versions do not match
Welcome to the MongoDB shell.
For interactive help, type “help”.
For more comprehensive documentation, see
http://docs.mongodb.org/
Questions? Try the support group
http://groups.google.com/group/mongodb-user
MongoDB Enterprise Sandbox-shard-0:PRIMARY>

I did connect but still i can’t get throught the lab as it shows
“Incorrect! Try again.”

Remaining Sections

Chapter 1: What is MongoDB?

  • [ Lab: Connect to your Atlas Cluster ]

I have finished all the courses but , this is somthing beyond thinking.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.