WebSocket Not Connecting and MongoDB Atlas Timing out
Linode
Linode Staff
I'm getting this timeout error when trying to connect to MongoDB Atlas:
(self._error_message(selector), timeout, self.description))
pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [Errno 111]
Regarding WebSockets, I am not receiving an error.
1 Reply
I would recommend following this guide on WebSockets and using the examples to compare with your own configurations.
Regarding the MongoDB error, it looks like the 111 error could be caused by a firewall or iptable configuration. If there are two rules stating that the port is open, it will default to closed. In order to make connections to the server externally, you'll want to edit the /etc/mongod.conf file and set the bind_ip=0.0.0.0
I'd recommend taking a look at this StackOverflow Post for further information.