"Server selection timed out after 30000 ms" error during mongodb compass connection

Hi ,everyone ,I have followed all the steps but unable to connect and it is showing this error.

Hi @ROHIT_KUMAR_48314,

Are you connected to any Corporate network / VPN connection ?

Can you please make sure you are able to ping and telnet the cluster ?

ping cluster0-shard-00-00-jxeqq.mongodb.net

telnet cluster0-shard-00-00-jxeqq.mongodb.net 27017

In addition to this, Please confirm that port 27017 is not blocked by clicking http://portquiz.net:27017.

If any of this is an issue then I would suggest you to contact your IT department to see if there is a workaround or try to make the request from another location such as your home network.

Hope it helps!

Thanks,
Shubham Ranjan
Curriculum Support Engineer

2 Likes

Hello. I having this problem too. But yesterday was working just fine. I checked the ping, telnet and the port availability and all is working great, but still receive “Server selection timed out after 30000 ms” in Compass.

Are you able to connect with shell?
Try to restart compass and see
If you are using favorites try to create a new one and check if it works

Didn’t tried with shell, but looking in this answer Unable to connect to MongoDB compass (barryoneill answer) I found the solution was checking SRV option (I swear I connect just fine without checking it yesterday).

Hi @Yamil_67132,

This must be a temporary network issue. Please try to connect after some time and hopefully it should be fine.

Thanks,
Shubham Ranjan
Curriculum Support Engineer

Is this still an issue? I just registered and I am trying to connect and get the same timeout issue.

I solved the problem by downloading the “Community” edition rather than the version linked in the course. All seems well now.

Hi @cpwolf3,

The Community version of Compass does not have Schema Tab, which you need to have in Compass in order to do the labs.

It might be a network/firewall related issue. Please try to connect from some other location such as your home network.

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

Thanks,
Shubham Ranjan
Curriculum Support Engineer

You should install mongodb compass from the link in the course. You might have installed community server.

C:\Users\Deevi>ping cluster0-shard-00-00-jxeqq.mongodb.net

Pinging ec2-34-195-121-130.compute-1.amazonaws.com [34.195.121.130] with 32 bytes of data:
Reply from 34.195.121.130: bytes=32 time=258ms TTL=48
Reply from 34.195.121.130: bytes=32 time=257ms TTL=48
Reply from 34.195.121.130: bytes=32 time=258ms TTL=48
Reply from 34.195.121.130: bytes=32 time=257ms TTL=48

Ping statistics for 34.195.121.130:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 257ms, Maximum = 258ms, Average = 257ms

Outgoing port tester

This server listens on all TCP ports, allowing you to test any outbound TCP port.

You have reached this page on port 27017 .

Your network allows you to use this port. (Assuming that your network is not doing advanced traffic filtering.)

Network service: unknown
but still im getting the same error

Hi @vivek_25217,

Even though these basic tests passes, network is still a problem. Have you tried connecting from some other network such as your home network/ mobile hotspot ?

If nothing works then you can import the data locally on your machine and complete the labs. The instructions are mentioned in this post.

Hope it helps!

Thanks,
Shubham Ranjan
Curriculum Services Engineer

@Shubham_Ranjan
I think atlas cluster which course is trying to give access, have not set NETWORK ACCESS settings in atlas dashboard, IP WHITELIST as “ALLOW ACCESS FROM ANYWHERE”

Hi @Sahil_66399,

Are you talking about the class atlas cluster ?

If yes, then I can confirm that this cluster is publicly available. If in case you are having any problem then please share a screenshot of the error message that you are getting.

Thanks,
Shubham Ranjan
Curriculum Services Engineer

Yes I was mistaken while filing details appropriately.
Its working now fine.
I am really amazed seeing such nice course and active discussion forum which shows everyone is taking interest learning mongoDB and practicing hands on labs.

I am really thankful to Team mongoDB for giving us such remarkable platform and access to live cluster, labs, everything to learn about mongoDB.

1 Like

Hi @Sahil_66399,

I’m so glad that you found the course helpful :slightly_smiling_face:.

And also let me take this opportunity to thank some of our Super Users who are constantly helping our learners in the discussion forum @007_jb, @Ramachandra_37567 and @steevej-1495 :clap: :slightly_smiling_face: .

Thanks,
Shubham Ranjan
Curriculum Services Engineer

1 Like

I was getting this error when attempting to connect to my sandbox using Compass. I was able to connect successfully to my sandbox using the shell. I loaded the data for the movies and was in the part of the course where you are supposed to connect to your sandbox using Compass. I tried following the instructions in the video, but some things have changed, and who knows, maybe I made a typo.

What fixed it for me was copying and pasting the connection string for Mongo Compass on Atlas for my sandbox cluster, and then changing ONLY the username and password, without clicking around on anything else.

1 Like

Hi @William_Moore_97877,

Thanks for sharing. I believe there must have been a typo in the connection string which was causing this issue.

Thanks,
Shubham Ranjan
Curriculum Services Engineer

Hi @Shubham_Ranjan,

i cannot ping the cluster but able to confirm that port 27017 is not blocked. i’m trying to connect at work - what should i ask my administrator to do for me?

thank you!

Hi @jiajing_zachmy_78370,

The class atlas cluster consists of three different nodes and you must be able to make outgoing requests to all these three nodes.

cluster0-shard-00-00-jxeqq.mongodb.net
cluster0-shard-00-01-jxeqq.mongodb.net
cluster0-shard-00-02-jxeqq.mongodb.net

Hope it helps!

Thanks,
Shubham Ranjan
Curriculum Services Engineer