The errors you may face for not whitelisting the IP Address (0.0.0.0) in your MongoDB Network Access

shafia

Shafia Rahman Chowdhury

Posted on November 7, 2022

The errors you may face for not whitelisting the IP Address (0.0.0.0) in your MongoDB Network Access

You might face two common errors for not whitelisting the 0.0.0.0 IP address in MongoDB Network access and they are the following:

Problem-1

You may encounter an error like the one below in your local server:

MongoServerSelectionError: connection to 52.64.0.234:27017 closed at Timeout._onTimeout (C:\Users\YOUNG\node_modules\mongodb\lib\core\sdam\topology.js:430:30) at listOnTimeout (internal/timers.js:549:17) at processTimers (internal/timers.js:492:7)

Problem-2

when you host your app in Vercel, you may find an error similar to the one shown in the picture:

Image description

Solution

To fix these errors, you will just have to add 'allow access from anywhere' in your MongoDB Network Access. But how???

Here are some easy steps you can follow:

1) Login into your MongoDB Atlas account, go to the Network Access and click 'Add IP Address'

Image description

2) Click 'Allow Access From Anywhere' and then click the 'Confirm' button

Image description

Well done!!! You have successfully whitelisted the 0.0.0.0 IP Address in your Network Access.

Image description

Now, you will just have to restart your local server(nodemon index.js/node index.js/npm start/nodemon start) to fix the error discussed in problem 1 and redeploy your app in Vercel to fix the error discussed in problem 2:
vercel
vercel --prod

💖 💪 🙅 🚩
shafia
Shafia Rahman Chowdhury

Posted on November 7, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related