WebSocket Not Connecting and MongoDB Atlas Timing out

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=

I'd recommend taking a look at this StackOverflow Post for further information.


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct