Error connecting to sandbox cluster

Screenshot (7) Screenshot (8)

An error occurred while loading navigation: ‘not master and slaveOk=false’: It is recommended to change your read preference in the connection dialog to Primary Preferred or Secondary Preferred or provide a replica set name for a full topology connection.

I got the above error in compass inspite of the fact that the entered connection string has preference primary. How to fix this?

What connection string?

the one entered in 2nd image
just above the connect button

Need to see the full connection string. Better still, paste it here.


You need to copy the string directly from Atlas and you’ll get something similar to this:

Basically, you needed to supply all the nodes within the connection string in order for it to find the PRIMARY node. 00-01 is a Secondary node hence the error.

Hi @Hetal_57847,

As @007_jb mentioned, please login to your atlas account for getting the connection string. Please refer this post for further instructions.

For your sandbox cluster, please use this connection string :


Hope it helps!

Please let us know if you have any other questions.

Shubham Ranjan
Curriculum Services Engineer

I tried using this connection string to connect to atlas cluster via shell.

I am getting the following error

For testing purposes, Whitelist all IP addresses to your cluster and share the connection string so that I can test it on my end.

mongo “mongodb+srv://” --username m001-student --password m001-mongodb-basics

As you can see, I can connect:

Try this:
mongo "mongodb://,,"

it got connected to secondary. I don’t get it what went wrong at my end?

Can you elaborate? Or share a screenshot.

I mean why wasn’t I able to connect with the string I had mentioned before

also I am not able to list the databases

My mistake, use this:
mongo "mongodb://,,"

Also what country are you located? And what region did you choose for your Atlas?

I have selected AWS / N. Virginia (us-east-1) as my region. I am from India. This was default region so I didn’t change it.

Thanks for this. I was trying so hard and this worked out. :slight_smile:

So it looks like you can connect using the Seed List connection string (i.e. the long format) but it doesn’t work with the SRV connection string (short version, “mongodb+srv”). I’ve only seen this same thing happen to another user located in Pakistan and someone else in the Middle East.

Can you confirm if you’re using a VPN or a work laptop?

Neither. This is my personal laptop.