MongoDB not connecting in private network
jesuspaleta
HOBBYOP

2 years 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 MONGO_URI environment var that calls for MONGO_PRIVATE_URL, I have also tried MONGO_URL but it is the same error.

2 Replies

jesuspaleta
HOBBYOP

2 years ago

c91eea90-9200-4a5c-bd45-7ef27e9b091e


2 years ago

as per your logs - localhost:27017

meaning you are not using the mongo client correctly, please refer to its documentation on how to use a url with it.


Welcome!

Sign in to your Railway account to join the conversation.

Loading...