I keep on getting the error mongoose serever selection error despite allowing access from anywehere in my MongoDb Atlas. Do you have any solution to this
Seems like a generic connection failure so it’s hard to say what the root cause would be. I understand you’ve allowed access from anywhere but it’s also important to note that the error indicates that this is one “common” reason as opposed to the actual root cause. I’d recommend performing some network tests from the client failing to connect.
You can then possibly troubleshoot your network based off those results or perhaps it may be the incorrect cluster.
Thank you so much for this. The problem still persists. I am using the exact code that I was using for the connection. It worked well at first before it started giving me errors.
What were the results from the network tests linked from my previous reply from the client failing to connect at the moment? Could you paste those here?
Can you also advise some further details of the environment where the machine is running? e.g. if you’re connecting from a VM hosted locally, from a server hosted on AWS, GCP, Azure, a containerised instance, etc.
When was the last time the connection worked?
Lastly, check on the Atlas UI if it’s the right cluster and if it’s up and running (not paused etc.).
These are the results of the network tests
connected to portquiz.net
escape character is ‘^]’.
connection closed by a foreign host.