Facing error - Cluster connectivity from the shell

I was looking to connect to the atlas cluster using the mongo shell which is installed on my windows computer,have installed ‘mongosh-5.3.1’.the installed folder path is successfully set under env variables too.I was looking to connect to default database(admin) which does the number of administrative things,however the connectivity to the cluster is failing,not sure whats the incorrect thing that is going on with me.attached is the screenshot for your reference,please help me on this.

Do not put mongosh before your connect string and try

Hi Ramachandra,

I even tried the way you suggested,even for that its the same error,I’m facing.please refer both the screenshots attached and kindly help me on this.

Thanks,
Shandeep

Hi Ramachandra,

Also,please refer to another screenshot attached here.

Thanks,
Sandeep

Is hypen ("-") part of your password or a typo?
That could be causing issues
Special characters in password also create issues
You may have to escape them or use a simple password

Hi Ramachandra,

Yes, hypen("-") is part of my password,please help me what can I do now?

Thanks,
Sandeep

Did you try other form of connect string with --username & --password and enclose password in double quotes
or
Change your password to a simple one from Atlas

Hi @Sandeep_S. Welcome to the community.

Can you please try again with mongosh instead of mongo?

mongosh “<–your connection string–>”

If you have any doubts, please feel free to reach out to us.

Thanks and Regards.
Sourabh Bagrecha,
MongoDB

Hi Sourabh,

Tried with mongosh as you suggested,its the same error again.attached is the screenshot for the same.
As rama chandra suggested,you want me to change the password and try connecting the cluster again??

Thanks,
Sandeep

Hi Sandeep, seems like the prompt is asking you to just enter the connection string and nothing else, please enter you connection string without the quotes as below:

mongodb+srv://m001-student:Tendulkar123-@sandbox.iexqr0p.mongodb.net

Just paste the above text when asked and you are all set to rock.

If you have any doubts, please feel free to reach out to us.

Thanks and Regards.
Sourabh Bagrecha,
MongoDB

1 Like

Hi Sourabh,

Now,tried as you suggested by entering the connection string without quotes as below:-
mongodb+srv://m001-student:Tendulkar123-@sandbox.iexqr0p.mongodb.net

and facing the below error,attached screenshot for the same.
MongoServerSelectionError: connect ETIMEDOUT 34.228.149.157:27017

Thanks,
Sandeep

Hi @Sandeep_S,
Have you added your IP address to the IP Access List for your cluster?
If not, go to the Network Access Tab and your IP address to it, as shown in the image below.

If you have any doubts, please feel free to reach out to us.

Thanks and Regards.
Sourabh Bagrecha,
MongoDB

Hi Sourabh,

For tutorial purpose they asked me to add this IP Address(0.0.0.0/0) and added the same,If this is not the one we have to add or do we need to add my system IP address,please let me know If I have to do that.attached screenshot for the same.

Thanks,
Sandeep

Your IP Access List is fine with 0.0.0.0/0.

I was able to get to your cluster. May be the cluster was not ready when you tried. It you still cannot access it, I recommend that you try from another location, or ISP or VPN.

Another thing that could happen is that your firewall is preventing you from establishing an outgoing connection. What do you get when you try:
http://portquiz.net:27017/

Hi Steeve,

You were right,the cluster connection was not happening because of VPN in my system which is blocking it,finally after disconnecting the VPN successfully able to connect to the cluster.glad that I could move forward with your help.thanks for all the assistance.

Thanks,
Sandeep

2 Likes

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