Furkan Arı
Furkan Arı

Reputation: 33

MongoTimeoutError: Server selection timed out after 30000 ms

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

Upvotes: 3

Views: 2129

Answers (1)

Pedro Fracassi
Pedro Fracassi

Reputation: 3905

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.

Upvotes: 1

Related Questions