M002 - Unable to connect to Sandbox cluster from Mongoshell

Hi,
I am having trouble connecting mongo cluster with shell. Error says that its whitelist issue, however, i have already whitelisted all ip.

Can you provide some help in this regard.

Regards,
Anand Kumar

tanks you, I now can conect whit mongo shell.

Your userid seems to be wrong
Its failing with authentication error
Please give correct id/pwd.It should work

1 Like

Hi ramchandra
please tell me the solution while connecting to atlas cluster from mongo shell i am getting error as

Error while trying to show server startup warnings: user is not allowed to do action [getLog] on [admin.]

in my cmd.

Raushan

Hi @raushankumar248,

The error warning that you are seeing on the screen is normal. You can safely ignore them.

If you have any other query, feel free to get back to us. Happy Learning :slight_smile:

Thanks,
Shubham Ranjan
Curriculum Support Engineer

Thanks a lot. I used atlas login username/password and got error. I should have used the username/password which i put while creating the cluster. Thanks pal.

1 Like

Hi,
I am trying to connect to sandbox cluster from MongoShell(Command Prompt) but i keep hitting the following error. Can you help me with this one

Hi @Akhil_Kumar_Reddy_68114,

I was able to connect to your sandbox cluster. Can you please try connecting using this connection string ?

mongo “mongodb://akhil-m001-shard-00-01-tfxm2.mongodb.net:27017,akhil-m001-shard-00-00-tfxm2.mongodb.net:27017,akhil-m001-shard-00-02-tfxm2.mongodb.net:27017” --ssl --authenticationDatabase admin --username m001-student --password m001-mongodb-basics

And also can you please make sure you are not behind a firewall or using VPN connection. To test that, ping your cluster by executing the below mentioned command in your terminal.

ping akhil-m001-shard-00-01-tfxm2.mongodb.net

If the issue still persists, feel free to get back to us. Happy Learning :slight_smile:

Thanks,
Shubham Ranjna
Curriculum Support Engineer

Hi @Shubham_13709,
This time I’m getting a new error
E QUERY [js] Error: couldn’t connect to server akhil-m001-shard-00-02-tfxm2.mongodb.net:27017, connection attempt failed: SocketException: The token supplied to the function is invalid :
connect@src/mongo/shell/mongo.js:343:13
@(connect):2:6
exception: connect failed.
And when I ping to the server I’m getting the reply.

Hi @Akhil_Kumar_Reddy_68114,

Let’s see if you are able to connect to a single node in the replica set. Execute this command in your terminal and share the screenshot of the response.

mongo “mongodb://akhil-m001-shard-00-00-tfxm2.mongodb.net:27017” --ssl --authenticationDatabase admin --username m001-student --password m001-mongodb-basics

Thanks,
Shubham Ranjna
Curriculum Support Engineer

Hi @Shubham_13709,
No it’s not working and throwing an error
MongoDB shell version v4.0.9
connecting to: mongodb://akhil-m001-shard-00-00-tfxm2.mongodb.net:27017/?authSource=admin&gssapiServiceName=mongodb
2019-08-08T18:25:53.457+0530 E QUERY [js] Error: couldn’t connect to server akhil-m001-shard-00-00-tfxm2.mongodb.net:27017, connection attempt failed: SocketException: The token supplied to the function is invalid :
connect@src/mongo/shell/mongo.js:343:13
@(connect):2:6
exception: connect failed

Hi @Akhil_Kumar_Reddy_68114,

Please refer this post . Let me know if you are not able to connect from any other network as well.

Thanks,
Shubham Ranjan
Curriculum Support Engineer

Thanks @Shubham_13709

Hi, I can’t connect using mongo "mongodb+srv://sandbox-lshui.mongodb.net/test" --username m001-student
It asks me to type the pw but I cannot write…the cursor remains blank, here is my screenshot

Can you help me? Thanks

Hi @Francesca_90151,

The password is not being displayed because of the security reasons but it is being typed in the background. Alternatively, you can also type the password in any text editor and simply copy-paste it here in the terminal (again it will not be displayed on the screen).

if you have any other issue, feel free to get back to us. Happy Learning :slight_smile:

Thanks,
Shubham Ranjan
Curriculum Support Engineer

Hi, @Francesca_90151

Password doesn’t show over command prompt but it gets typed in the background when you type anything.

or,

You can try this,

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