New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error while doing SSL handshake: Unknown error #248
Comments
This is commit: 81be90c |
@sanjayankur31 are you using wee-slack as well by chance, or just weechat-matrix? Did you recently got updated to python 3.9? |
Ah, yes, I've also got wee-slack here, and yes, Fedora 33 is on Python 3.9 too. So, it's probably the same issue. |
Same issue, I recently upgraded to |
is there any chance of getting this fixed? Edit: a |
@demlak are you using other python plugins, or just weechat-matrix? |
i'm using |
Given the problem, I suspect that if you only use "matrix.py" the problem will go away (just to verify, I know this is not a solution). |
i gave it a try.. if i start without |
I suppose weemustfeed is doing some connection underneath. As expected, this is similar to wee-slack. |
Having similar issue, don't have |
@wavexx : not a python pro either, but I can try to help with this. Any hints on getting started? @SharkIng : if you can help diagnose the issue, that'll be helpful. @wavexx has already noted that this isn't an easy one to diagnose. (See also: wee-slack/wee-slack#812) |
The error happens here. Adding a `print(error) reveals this error message:
I have no idea why that would start happening, seems like the other scripts start messing with the existing SSLContext. If a |
There's this comment on the Python bug tracker pointing in the same direction as well:
|
Just throwing more logs here, after running
|
I found a few issues which all pointed to this upstream bug: https://bugs.python.org/issue12343, which is related to non-blocking SSL behaviour. I'll go tinker around and see if I can get some more info. |
That doesn't seem right, it's form 2011 and has |
Hi, I'm working on Python upstream and a colleague asked me to look into this issue.
It seems like the websocket module uses non-blocking SSL socket but is not prepared to handle ssl.SSLWantReadError error. Where does this module come from? https://pypi.org/project/websocket/ looks unrelated (11 years old). I tried to install weechat-matrix using:
But it doesn't install a "websocket" module and find cannot find any file called _socket.py. Is there a simple way to reproduce the issue? I'm using Fedora 33. Should I install weechat and the matrix plugin in weechat? I'm not used to weechat, can someone please explain me how to install these things? I tried to use the matrix plugin in weechat using:
In weechat:
Logs:
I fail to reproduce the issue. Also, I cannot find websocket/ or _socket.py in ~/.local/lib/python3.9/site-packages/. |
Hey.. thx for digging in.. |
My main question is: where does the websocket/_socket.py file come from? How can I get it? I'm not sure why a traceback related to wee_slack.py was reported here. Does it use weechat-matrix? |
The the The traceback was reported because there seems to be some weird interaction with weechat-matrix (a script that implements the Matrix protocol for Weechat) and wee-slack (a script that implements Slack protocol support for Weechat). It was later on discovered that the issue isn't specific to wee-slack but any Python script that opens a connection messes up the connection for weechat-matrix. This happens since Python 3.9 and it seems to be somehow related to the SSL context, though I have not investigated in depth. |
I am pretty sure I have had this issue on Python 3.8 as well, which my distro still defaults to. It is the reason I disabled weechat-matrix. Not sure why y'all are only hitting it on 3.9, maybe it was caused by a websocket-client update instead? |
@mweinelt Did you figure out any work around? It looks like your on nixos as well from your bumps of the weechat version. Maybe we can change the version in the scripts package. Do you happen to have a config floating around I could take a peak at as well? |
@emiller88 This is my weechat config on NixOS 20.09, where python3.8 is the default. { config, pkgs, ... }:
let
weechat = pkgs.wrapWeechat pkgs.weechat-unwrapped {
configure = { availablePlugins, ... }: {
plugins = builtins.attrValues (availablePlugins // {
python = (availablePlugins.python.withPackages (ps: [
pkgs.weechatScripts.wee-slack
# pkgs.weechatScripts.weechat-matrix
]));
});
scripts = [
pkgs.weechatScripts.wee-slack
# pkgs.weechatScripts.weechat-matrix
];
};
};
tmuxConf = pkgs.writeText "tmux.conf" ''
set -g default-terminal "screen-256color"
set -g status off
'';
in {
imports = [
./nginx.nix
];
users = {
groups.weechat = {
members = [ "hexa" ];
};
users.weechat = {
group = "weechat";
createHome = true;
home = "/var/lib/weechat";
useDefaultShell = true;
isSystemUser = true;
};
};
systemd.services.weechat = {
environment.WEECHAT_HOME = "/var/lib/weechat";
after = [ "network.target "];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
User = "weechat";
Group = "weechat";
Type = "forking";
RemainAfterExit = "yes";
ExecStart = "${pkgs.tmux}/bin/tmux -f ${tmuxConf} -S /var/lib/weechat/tmux.session new-session -d -s irc '${weechat}/bin/weechat'";
ExecStop = "${pkgs.tmux}/bin/tmux -f ${tmuxConf} -S /var/lib/weechat/tmux.session kill-session -t irc";
};
postStart = ''
chmod 660 /var/lib/weechat/tmux.session
chmod g+rX /var/lib/weechat
'';
#reload = ''
# echo "*/upgrade -yes ${weechat}/bin/weechat" > /var/lib/weechat/weechat_fifo
#'';
#reloadIfChanged = true;
restartIfChanged = false;
};
services.nginx = {
appendHttpConfig = ''
limit_req_zone $binary_remote_addr zone=weechat:10m rate=5r/m;
'';
virtualHosts = {
"${config.networking.hostName}.${config.networking.domain}" = {
locations."/weechat" = {
proxyPass = "http://localhost:11000/weechat";
proxyWebsockets = true;
extraConfig = ''
proxy_read_timeout 4h;
limit_req zone=weechat burst=1 nodelay;
'';
};
};
};
};
} |
Thanks! I tried overriding the python version for weechat matrix. (weechatScripts.weechat-matrix.override {
buildPythonPackage = python37Packages.buildPythonPackage;
python = python37;
pyopenssl = python37Packages.pyopenssl;
webcolors = python37Packages.webcolors;
future = python37Packages.future;
atomicwrites = python37Packages.atomicwrites;
attrs = python37Packages.attrs;
Logbook = python37Packages.Logbook;
pygments = python37Packages.pygments;
matrix-nio = python37Packages.matrix-nio;
aiohttp = python37Packages.aiohttp;
requests = python37Packages.requests;
}) But weechat didn't like trying to run a python3.7 script with python 3.8.9. |
I have investigated the issue. It is a regression in Python 3.9, that was recently fixed in main/3.10. I have opened this bug report for Python 3.9: https://bugs.python.org/issue44050 There is also some more discussion around my investigation here: wee-slack/wee-slack#812 |
Oh nice, it wasn't my fault doing weird things in the end after all. 😅 |
Is there a hotfix for this issue? Due to this bug it currently it seems impossible to use both |
It looks like there's a PR pending review? python/cpython#27794 |
If I understand correctly (and I'm not well versed in Python), that PR makes changes to the Python interpreter? Which would require users to either wait until it's implemented in their distribution, or build and replace python themselves, or build and have weechat plugins use the fixed build. @jonorthwash by 'hotfix' I was wondering if there was an easier temporary fix for end users so they could avoid one of those I mentioned above? |
Will the issue be fixed with Python 3.10? |
As far as I know, yes, this should be fixed in Python 3.10. |
And also in Python 3.9.9 as well |
Just upgraded from Python 3.9.7 to 3.9.10 and things work again! Just over a year from encountering the issue to having it solved. Thanks to everyone who helped figure this out and get Python fixed! |
Hiya,
Could someone please help me connect to matrix.org (element.io)? I've followed the instructions and set up my username/password etc. However, when I try to connect, I get:
I've got a virtual enviroment set up, so all the deps should be installed correctly. I'm on Fedora 33 if that makes a difference.
Cheers!
The text was updated successfully, but these errors were encountered: