jofftiquez
jofftiquez

Reputation: 7708

MLab database created with microsoft azure resulting to Connection error: MongoError: getaddrinfo ENOTFOUND

I have two mongo databases created in mLab. The first one is created directly from my personal account on mLab.

mongodb://nottheactualuser:[email protected]:11168/db1

The other was created from Microsoft Azure Portal > Marketplace.

mongodb://nottheactualuser:[email protected]:64278/db1

The first one is connecting successfully while the other one created from Azure is producing this error.

Connection error: MongoError: getaddrinfo ENOTFOUND

Has anyone encountered this yet? How do I solve this? Thanks.

Upvotes: 0

Views: 432

Answers (1)

jofftiquez
jofftiquez

Reputation: 7708

Upon contacting the mlab support they told me this.

I cannot use the URL directly from mLab -

-Because the ICMP protocol is not permitted through the Azure load balancer, you will notice that you are unable to ping an Azure VM from the internet. You can read more about that here: https://blogs.msdn.microsoft.com/mast/2014/06/22/use-port-pings-instead-of-icmp-to-test-azure-vm-connectivity/

my mistake was I assumed that it would be fine to use the link directly from mLab. So I search further more and I came across with this post.

TL;DR

  • Login you youre azure classic portal
  • Navigate to Market Place and select your mLab database and click connection info. enter image description here

  • A window will appear containing the MONGOLAB_URI you needed.

  • Copy and use that.
  • And lastly don't be like me.

I hope this helps.

Upvotes: 1

Related Questions