DEV Community

Will Heyer
Will Heyer

Posted on

(SOLVED) MongooseServerSelectionError: Could not connect to any Servers in your MongoDB Atlas cluster.

I recently had an issue connecting to a MongoDB Atlas cluster and was receiving the below error message:

Alt Text

Initially, I thought the error was due to my IP address and I ensured that my IP was whitelisted. The easiest way to do this is the “All IPs” whitelist of 0.0.0.0/0 but I also included my computer’s own IP.

However, I was still unable to connect. Finally, after some further research, I checked to make sure my internet settings weren’t preventing my connection. As I use Xfinity internet, the security settings were apparently set too high and this was the cause of the connection error. This is due to the router not allowing a connection to port 27017. The workaround here is to connect to your iPhone’s Hotspot and test your application therein.

Thank you!

Top comments (0)