MongoDB not connecting in private network
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.
Solution:Jump to solution
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....3 Replies
Project ID:
c91eea90-9200-4a5c-bd45-7ef27e9b091e
c91eea90-9200-4a5c-bd45-7ef27e9b091e
Solution
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.