poljar / weechat-matrix

Weechat Matrix protocol script written in python
Other
953 stars 118 forks source link

SSO login problem: error in function "sso_login_cb" #215

Open ptman opened 4 years ago

ptman commented 4 years ago
Traceback (most recent call last):
File ".../python/matrix/utf.py", line 89, in wrapper
return function(*args, **kwargs)
File ".../python/autoload/matrix.py", line 430, in sso_login_cb
server.login(token=token)
File ".../python/matrix/server.py", line 870, in login
_, request = self.client.login(
File "$HOME/.local/lib/python3.8/site-packages/nio/client/http_client.py", line 85, in wrapper
raise LocalProtocolError("Not connected.")
nio.exceptions.LocalProtocolError: Not connected.
error in function "sso_login_cb"

rev 71b7f79317b46e67ed0e5872cf5f60a980aed268

ptman commented 4 years ago

I found a solution. The error message is accurate. The TCP connection was closed, because apache httpd (which I have as a reverse proxy) has a default keepalivetimeout of 5 seconds, which was not enough for me to complete the SSO login.

It would be nice if (NIO?) was able to try a new connection instead of failing. But I fixed this for me by increasing the apache timeout

poljar commented 4 years ago

In this case nio isn't opening the connection at all, it's the long standing issue of using a single socket for all requests and using keep-alive. Weechat is opening the connection.

This will be solved in the Rust rewrite.