Unable to connect Sandbox Cluster from the mongo Shell

Unable%20to%20connect%20to%20Sandbox%20ckuster-page0002 Unable%20to%20connect%20to%20Sandbox%20ckuster-page0001

Facing this error while connecting to Sandbox cluster using MongoShell. Please help.

Hi @Priya_42434,

First of all, the content in the screenshot is not very clear because of the size. Please take care of it from the next time so that you get the right help as soon as possible :slight_smile:.

Now based on what I see in the first screenshot, I believe it is asking for the password for the user m001-student.

Please enter the password in the prompt and hit enter and then you will be good to go.

Note :- When you type the password, it won’t be visible on your screen because of the security reasons but it will be captured in the background.

Hope it helps!

If the issue still persists then please share your connection string and the password with us so that we can test it from our end.

Thanks,
Shubham Ranjan
Curriculum Support Engineer

Hi Shubham, Appreciate your quick response.

I managed to fix it on my own. The URL(mongo “mongodb+srv://cluster0-k0zul.mongodb.net/test” --username m001-student) I copied had until username only, when I pressed ENTER, I got an error.

I fixed it by: typing (–password m001-mongo-basics) and pressed enter, I was able to connect fine.

Hi @Priya_42434,

I’m glad your issue got resolved. If you have any other query then please feel free to get back to us.

Happy Learning :slight_smile:

Thanks,
Shubham Ranjan
Curriculum Support Engineer

Got also problems with connecting with the mongo Shell. Any idea?

Hi @Mailo_64955,

 MongoDB Enterprise Sandbox-shard-0:PRIMARY>

This prompt means you are successfully connected to the Primary node of your cluster. You can safely ignore the warning and error message on your screen.

Hope it helps!

If you have any other query then please feel free to get back to us.

Happy Learning :slight_smile:

Thanks,
Shubham Ranjan
Curriculum Support Engineer


this is my problem what should i do with this ? please help

Hi @Shraddha_58636,

I’m able to connect to your cluster.

Can you please try to connect using this connection string ?

mongo "mongodb+srv://cluster0-lywaj.mongodb.net/test" --username m001-student -p m001-mongodb-basics

Hope it helps!

If the issue still persists then please feel free to get back to us.

Happy Learning :slight_smile:

Thanks,
Shubham Ranjan
Curriculum Support Engineer

HI, I have similar problem, no matter if I pass (mongo “mongodb+srv://cluster0-lywaj.mongodb.net/test” --username m001-student -p m001-mongodb-basics) or (mongo “mongodb+srv://cluster0-lywaj.mongodb.net/test” --username m001-student -password m001-mongodb-basics) or (mongo “mongodb+srv://cluster0-lywaj.mongodb.net/test” --username m001-student --p m001-mongodb-basics) or (mongo “mongodb+srv://cluster0-lywaj.mongodb.net/test” --username m001-student --password m001-mongodb-basics) it always responds with “MongoDB shell version v3.4.10
connecting to: mongodb://mongodb+srv://cluster0-lywaj.mongodb.net/test
2019-12-13T15:33:56.958+0100 E QUERY [thread1] Error: Failed to parse mongodb:// URL: mongodb://mongodb+srv://cluster0-lywaj.mongodb.net/test :
connect@src/mongo/shell/mongo.js:237:13
@(connect):1:6
exception: connect failed”

what should i do?

Hi @Wojciech_60870,

You are using a very old version of MongoDB. This version of MongoDB does not work with srv strings that you are using. If possible then please install the latest version of MongoDB.

If not possible then please use this connection string for connecting to your cluster.

mongo "mongodb://cluster0-shard-00-00-lywaj.mongodb.net:27017,cluster0-shard-00-01-lywaj.mongodb.net:27017,cluster0-shard-00-02-lywaj.mongodb.net:27017/test?replicaSet=Cluster0-shard-0" --authenticationDatabase admin --ssl --username m001-student --password m001-mongodb-basics

Hope it helps!

If you have any other query then please feel free to get back to us.

Happy Learning :slight_smile:

Thanks,
Shubham Ranjan
Curriculum Support Engineer

Thank you, for your help.

Closing this thread as all the issues have been resolved.