MongoDB not connecting in private network

jesuspaletaHOBBY

10 months ago

I'm running a Python API and everything is working correctly except the MongoDB connection. I always get this error:

localhost:27017: [Errno 111] Connection refused (configured timeouts: socketTimeoutMS: 20000.0ms

My code runs correctly in local environment, I have a MONGOURI environment var that calls for MONGOPRIVATEURL, I have also tried MONGOURL but it is the same error.

0 Replies

jesuspaletaHOBBY

10 months ago

c91eea90-9200-4a5c-bd45-7ef27e9b091e


10 months ago

as per your logs - [localhost:27017](localhost:27017)
meaning you are not using the mongo client correctly, please refer to its documentation on how to use a url with it.


MongoDB not connecting in private network - Railway Help Station