MongoTimeoutError: Server selection timed out after 30000 ms

Viewed 1585

I am taking "Uncaught Promise Error: { MongoTimeoutError: Server selection timed out after 30000 ms" error in console. What can i do?

1 Answers

Your MongoDB server is down or inaccessible. If you're using MongoDB Atlas, you might have forgotten to whitelist your IP. Here's how to fix it (from the page I just linked):

  1. Go to IP Whitelist view.
    • In the Security section of the left navigation, click Network Access. The IP Whitelist tab displays.
    • Click plus icon Add IP Address.
  2. Enter an IP address, CIDR block, or Security Group ID.

    If you're running the bot locally, you can google "what's my IP" and it should show your public IP right on the search page.

  3. Click Save and Close.
Related