Connecting to database

"I’m encountering a problem connecting to MongoDB Atlas, even though I’ve allowed network access for everyone by adding ‘’ to the IP whitelist. When attempting to connect, I consistently receive the following error message: ‘MongooseServerSelectionError: Could not connect to any servers in your MongoDB Atlas cluster. One common reason is that you’re trying to access the database from an IP that isn’t whitelisted. Make sure your current IP address is on your Atlas cluster’s IP whitelist.’

What could be the potential reasons for this issue, and how can I resolve it to successfully establish a connection to my MongoDB Atlas cluster?"

Hi @Adilzhan_Serikzhanov,

Looks to be a generic network connection failure message. Hard to say the root cause of it at this stage but I’d recommend taking a look at my reply on following post and performing the same mentioned network tests from the client failing to connect.


  1. Have you been able to connect previously?
  2. What are the environment details for the client attempting to connect (VM hosted on local machine, local machine, cloud VM (e.g. EC2 instance on AWS))?
  3. Any VPN’s involved from the client attempting to connect?
  4. Cluster tier / instance type (shared, dedicated, serverless)

Let me know the results of the network tests if you’re still having trouble.