MongoSErverSelection Error

Hello Im having an issue when it comes to deploying my site , once the site has been successfully deployed and the servie is started with npm start, when i go to the site I get an Internal Server Error for each page that I try to access , then eventually the Home page presenst the same error. I was wondering if anyone could help me with this issue.

After checking the logs I get the following

“Dec 27 11:15:25 AM MongoServerSelectionError: connection to closed
Dec 27 11:15:25 AM at Timeout._onTimeout (/opt/render/project/src/node_modules/mongodb/lib/sdam/topology.js:293:38)
Dec 27 11:15:25 AM at listOnTimeout (internal/timers.js:555:17)
Dec 27 11:15:25 AM at processTimers (internal/timers.js:498:7)”

Im not really sure what this means, was hoping to get help from support or another knowlegable user.

Looks like my issue was related to not white listing the IP Addresses that Render uses in my Mongo Atlas Database. If you are having this issue got to CONNECT and select the dropdown, then select OUTBOUND to see the addresses that Render uses.

To whiltelist the addresses in Mongo DB got to NETWORK ACCESS and add the IPs by selecting ADD IP ADDRESS

Hi Darren,

Thanks for sharing your solution with the community.

As you found, Static Outbound IP Addresses are useful when allowlisting IPs with external service providers.


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.