RE: Chapter 1 Lab : unable to connect to Atlas Cluster

Hello Kushagra Kesav,
I had tried multiple times to connect Atlas Cluster whereas I am facing the error as below.
I had cross checked IP and user has been created as mentioned in the course.
Could you please help me to connect the cluster?

user@M001# 
user@M001# mongo "mongodb+srv://sandbox.dl1fsga.mongodb.net/myFirstDatabase" --username m001-student --password m001-mongodb-basics
MongoDB shell version v4.4.3
connecting to: mongodb://ac-gbs7v4g-shard-00-00.dl1fsga.mongodb.net:27017,ac-gbs7v4g-shard-00-02.dl1fsga.mongodb.net:27017,ac-gbs7v4g-shard-00-01.dl1fsga.mongodb.net:27017/myFirstDatabase?authSource=admin&compressors=disabled&gssapiServiceName=mongodb&replicaSet=atlas-xk0jwz-shard-0&ssl=true
Implicit session: session { "id" : UUID("1e65cf10-6a1c-4d47-967b-0e18bd3b0a78") }
MongoDB server version: 5.0.13
WARNING: shell and server versions do not match
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
        https://docs.mongodb.com/
Questions? Try the MongoDB Developer Community Forums
        https://community.mongodb.com
MongoDB Enterprise atlas-xk0jwz-shard-0:PRIMARY> exit
bye
user@M001# 
user@M001# mongo "mongodb+srv://sandbox.dl1fsga.mongodb.net/myFirstDatabase" --username m001-student
MongoDB shell version v4.4.3
Enter password: 
connecting to: mongodb://ac-gbs7v4g-shard-00-00.dl1fsga.mongodb.net:27017,ac-gbs7v4g-shard-00-02.dl1fsga.mongodb.net:27017,ac-gbs7v4g-shard-00-01.dl1fsga.mongodb.net:27017/myFirstDatabase?authSource=admin&compressors=disabled&gssapiServiceName=mongodb&replicaSet=atlas-xk0jwz-shard-0&ssl=true


*** You have failed to connect to a MongoDB Atlas cluster. Please ensure that your IP whitelist allows connections from your network.

Error: can't connect to new replica set master [ac-gbs7v4g-shard-00-02.dl1fsga.mongodb.net:27017], err: AuthenticationFailed: bad auth : Authentication failed. :
connect@src/mongo/shell/mongo.js:374:17
@(connect):2:6
exception

Hi @Deepa_J,

You were already connected to your MongoDB instance. You can hit show dbs command to see all the databases in your MongoDB Atlas instance.

And you can ignore this warning:

I hope it helps. Wish you all the best with rest of the course.

Please feel free to reach out if you have any further questions.

Thanks,
Kushagra

1 Like

Thank you so much Kushagra!!
Apologies!! My bad got confused with the error message.