Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 599
Furkan Arı Avatar asked Nov 19 '25 11:11

Furkan Arı


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.
like image 108
Pedro Fracassi Avatar answered Nov 22 '25 02:11

Pedro Fracassi