-
Notifications
You must be signed in to change notification settings - Fork 115
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
Youtube plugin crashes on Ubuntu 22.04 #298
Comments
I have the same issue in debian testing/unstable. Python is to blame for that. Most addons are developed on python 3.8, so issues on later versions of it are probable. |
Crashlog from plugin crashing kodi on Ubuntu 22.04 Is there a way to get more useful python stack traces from kodi? |
I have the same problem with the latest Ubuntu LTS, except kodi doesn't crash. The first video starts without any issues, but on the 2nd one (no matter if in playlist or new one) Kodi's UI hangs indefinitely. No entry in log, just stuck. The only way out is to kill Kodi complete. If this is a problem with the new python version (currently 3.10.4), this will impact a lot of users when the 22.04.1 comes out in August. At this release the 20.04 LTS users will get this update nearly automatically. |
One thing to try is to activate the python faulthandler module and see if it gives any additional insights. Modify addons/plugin.video.youtube/resources/lib/default.py to look like the following:
Update:
Kodi draws the main menu, freezes for ~60 seconds, then crashes with a segmentation fault. Faulthandler files are empty. |
Sometimes it works for me as well (~ 1 out of 5 times). I've attached a log with debugging enabled: Workflow:
I've enabled the faulthandler, but the file is empty. |
I noticed that when ssl verify is set to false everything works ok so it can be something with new openssl in last LTS (22.04). In ~/.kodi/userdata/addon_data/plugin.video.youtube/settings.xml settings.xml change true to false in line:
This is not a good solution (potential security risk), but it can help plugin developers solve the problem if we determine where the problem is. So @dchristl Can you try this solution to confirm my assumption? But remember no cert verification makes you vulnerable to man in the middle attack). I don't know how risky is using this hack but I found in youtube plugin sources code that turns off verification when you have old python installed.
|
for whatever reason, simple.requests.ssl.verify was set to false already on my install and i'm unfortunately still seeing crashes, especially after pressing OK after opening the settings (without changing anything) for the youtube addon:
setting it back to true didn't make a difference in brief testing. maybe there are multiple issues affecting python 3.10? ubuntu 22.04/x86_64 w/6:19.4+git20220330.0719-b738e65ae5-0~jammy and python 3.10.4-3ubuntu0.1 |
I've done a little research and the problem is indeed python, like mentioned. Precisely it is the python invoker. The main bug is python/cpython#90228. There are several issues, caused by this in Kodi and other plugins (i.e. xbmc/xbmc#21243 or python/cpython#92036 . So, the current bug is not caused by the youtube-plugin. The python-bug seems to be fixed in main and the latest python 3.11 (some says it is also fixed in 3.10.5). The problem is that Kodi uses the default system python and this is not updateable in Ubuntu, because a lot of tools (like apt) depending on specific versions. So, there is no solution after all, but I've found a workaround for me avoiding the problem without breaking the system. This is based on installing latest python, patching Kodi to use this and use the newest python version only for Kodi and nothing else.
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3.11-full libpython3.11 patchelf
sudo patchelf --replace-needed libpython3.10.so.1.0 libpython3.11.so.1.0 /usr/lib/x86_64-linux-gnu/kodi/kodi.bin
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 2
python3 -V outputs sudo update-alternatives --config python3 The output should be someting like this:
Press python3 -V outputs now At this point you can start Kodi and all issues should be gone.
At this point apt (and maybe some other Ubuntu tools) are broken, because they are depending on fixed python versions. So change back to default by: sudo update-alternatives --config python3 and pressing You can start kodi with a wrapper script or as oneliner by: echo "2" | sudo update-alternatives --config python3; kodi; echo "0" | sudo update-alternatives --config python3 This sets python3.11 before starting Kodi and revert this change after closing it.
Before starting and after cosing Kodi you have to input your sudo password everytime to set the correct python. To avoid this add a line to sudoers by: sudo visudo Go to the end and add (Replace yourUsername with output of Now you can start and close Kodi without typing any password. I use this workaround since almost a week and Kodi and the system are running without any problems. This works for me until Ubuntu's python-Version will be updated. The only drawbacks are:
|
Looks like this issue will be fixed in a future python3 update for ubuntu 22.04. https://bugs.launchpad.net/ubuntu/+source/python3.10/+bug/1982108 |
i enabled the proposed repos per https://wiki.ubuntu.com/Testing/EnableProposed and ran the following to update python3.10 before disabling the repo:
kodi is no longer crashing when saving youtube settings. thanks! it's too early to call it 100% fixed but it was consistently crashing upon saving settings before. the actual package version is |
Ubuntu has updated libpython3.10 to version 3.10.6 and the issue is now resolved. Closing issue. |
Context
Add-on Version: 6.8.18+matrix.1
Kodi Version: Kodi (19.4 (19.4.0) Git:19.4-Matrix). Platform: Linux 64-Bit
Kodi GUI Language: English
Operating System: Ubuntu 22.04, kernel: 5.15.0-27-generic
Operating System Language: English
Expected Behavior
Youtube videos play without crashing kodi.
Current Behavior
Playing a youtube video then exiting the youtube addon then playing another youtube video crashes kodi.
Steps to Reproduce
Play a youtube video, exit youtube addon, go back and try play another youtube video and it will crash kodi.
or
Goto youtube addon settings -> http server -> click on check my ip then once it shows the IP click check my ip again, kodi then crashes.
Other Info
Crashes with MPEG-Dash disable as well.
This shows up in dmesg after the crash
LanguageInvoker[944]: segfault at 8 ip 0000150c5df97aa0 sp 0000150c20bb9270 error 4 in libpython3.10.so.1.0[150c5deff000+2b5000
kodi_crashlog-20220425_090223.log
The text was updated successfully, but these errors were encountered: