Connect ECONNREFUSED 0.0.0.0:27017

MongoServerSelectionError: connect ECONNREFUSED 0.0.0.0:27017
Nov 2 12:05:46 AM at EventTarget. (/opt/render/project/src/node_modules/mongodb/lib/sdam/topology.js:276:34)
Nov 2 12:05:46 AM at [nodejs.internal.kHybridDispatch] (node:internal/event_target:807:20)
Nov 2 12:05:46 AM at EventTarget.dispatchEvent (node:internal/event_target:742:26)
Nov 2 12:05:46 AM at abortSignal (node:internal/abort_controller:369:10)
Nov 2 12:05:46 AM at TimeoutController.abort (node:internal/abort_controller:391:5)
Nov 2 12:05:46 AM at Timeout. (/opt/render/project/src/node_modules/mongodb/lib/utils.js:1010:92)
Nov 2 12:05:46 AM at listOnTimeout (node:internal/timers:573:17)
Nov 2 12:05:46 AM at process.processTimers (node:internal/timers:514:7)

My project is working fine from my local VS Code but when deployed on render its not able to connect to Atlas mongoose. Although i have added all the three IP Address into my whitelist IP on Atlas.Also tried with 0.0.0.0/0 to allow all IP address on Atlas

Hi,

I’ve replied to the ticket you also opened. Let’s keep the conversation in one place (on the ticket).

For completeness, I’ll repeat the same response here:

MongoDB won’t be on 0.0.0.0, you’ll need to ensure the hostname for your Mongo server is correct.

If you have a MongoDB instance on Atlas, then they will provide the connection details (the host will likely end with ...mongodb.net)

Alan

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