Server selection timed out after 30000 ms - Chapter 2 Atlas


Im getting the error

Server selection timed out after 30000 ms

I can connect happily using shell (and imported js data set) but when I use compass I get the timeout message

Help !

thanks Simon

By the way @simonloach, I’ve just assigned your topic to the M001 course because it was unassigned. Feel free to change it if my assumption was wrong.

1 Like

Hi @simonloach,

Can you please share the SRV connection string of your sandbox cluster along with the credentials?

Also, did you face any difficulty in connecting to the class atlas cluster from Compass ?

Shubham Ranjan
Curriculum Services Engineer


connection string is


From what I remember it seemed to connect to the class cluster from compass just fine

many thanks


There was a typo in the password, I used the below string and it connected just fine:

 mongo mongodb+srv://

Few things here:

  • You used just a single node address:, its always better to use the server address as a whole like I did in the string above.
  • With that, if you are mentioning readPreference in the connection string, it will look for primary first, that is also one of the reasons the string was not able to connect.


1 Like

thanks will try it when I get home tonight :slight_smile:

1 Like