It looks like I cannot connect to my free Mongo Atlas cluster anymore. Everything was working and I have data that was collected when I look at the MongoDB website so I have no idea why it stopped working and can no longer connect. My entire site won't load.
This is there error I was getting:
{ Error: querySrv ENODATA _mongodb._tcp.blog-cluster-0hb5z.mongodb.net
at QueryReqWrap.onresolve [as oncomplete] (dns.js:197:19)
errno: 'ENODATA',
code: 'ENODATA',
syscall: 'querySrv', Blog/app.js:54:14
hostname: '_mongodb._tcp.blog-cluster-0hb5z.mongodb.net' }
For some reason the dns server did not return srv records, changing the dns server to one that returns those records fixed the problem. (I used https://use.opendns.com/ to fix the it)
In some cases, this happens when your IP address is not whitelisted in the MongoDB Atlas cluster. This is why it works with your IP address at home where you originally signed up your account, but doesn't work at a coffee shop WIFI or elsewhere.
So make sure your current IP address is added into your MongoDB cluster.
I had the same problem working in a Starbucks went home and it connected right away try a different wifi connection.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With