Linux Kodi flooding XSession errors and filling up disk.
#1
Bug 
I have a Ubuntu 16.04.1 installed on my NUC.

After I reboot, I can see .xsession-errors increasing in size rapidly. The below is after < 1 minutes.

Code:
-rw-------  1 kodi kodi 3466402072 Jan 20 18:49 .xsession-errors
-rw-------  1 kodi kodi 6548127878 Jan 20 18:46 .xsession-errors.old

Running a tail -f on the file gives me nothing but continious output of:

Code:
extern "Python": function Cryptography_rand_bytes() called, but @ffi.def_extern() was not called in the current subinterpreter.  Returning 0.
extern "Python": function Cryptography_rand_status() called, but @ffi.def_extern() was not called in the current subinterpreter.  Returning 0.


Moving the kodi config folder, no longer presented the issue. I'm guessing some addon is the culprit. Since no major update has been available kodi hence I'm pointing to an addon.

It can also be the cec adapter that has been soldered and it did have a recent driver update. I did run kodi in debug mode and have attached here: http://pastebin.com/WNtEM2Nj

My whole setup worked fine till yesterday. Out of the blue it appeared.

The symptoms it caused:
  1. Library cannot be updated or cleaned
  2. Fan art wont display
  3. hangs up and will not respond till a reboot.


Can someone help me isolate or pin point the issue?
Reply
#2
It's a python addon and the root cause is an outdated python library of your distribution. See: https://bugs.launchpad.net/ubuntu/+sourc...ug/1636573
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#3
(2017-01-21, 08:26)fritsch Wrote: It's a python addon and the root cause is an outdated python library of your distribution. See: https://bugs.launchpad.net/ubuntu/+sourc...ug/1636573

Awesome thanks.

Funny thing, a simple "sudo apt-get install -f" fixed it!
Reply
#4
Same situation here, can you please write the exact steps to follow to solve it?
I don't really understand what should I do.
Thanks.
Reply
#5
I had the same problem, it looks like an upgrade of PyOpenSSL to 16.2.0 fixes this.

To do this, try this
Code:
sudo easy_install --upgrade PyOpenSSL

If this throws an error about missing libffi, install libffi-dev by issueing:
Code:
sudo apt install libffi-dev

and then repeating the easy_install line.
Reply
#6
Done both solutions, but I still have the issue: today my .xsession-errors completely filled my hard disk.
My idea for a workaround would be to truncate the file via crontab, but I don't know if it works, since the process that writes in it is still open.
Another idea would be to restart kodi via command line, but I wasn't able to find a proper way to do that in ubuntu.
Reply
#7
I am running Kodi 17 RC3 on Ubuntu 16.04 LTS. In my case it helped to remove pyopenssl and cryptography installed by pip (or easy_install) and leave the apt-get packages python-cryptography and python-openssl. That way there are no missmatched libraries present on the system at the same time.

Code:
pip uninstall pyopenssl
pip uninstall cryptography

sudo apt-get install python-cryptography
sudo apt-get install python-openssl

Hope this will help someone.
Reply
#8
The line below is filling my Hdd up. My sys log .txt file was 920gb.

kodi.desktop[3099]: extern "Python": function Cryptography_rand_status() called, but @ffi.def_extern() was not called in the current subinterpreter. Returning 0

Will the above post fix the problem.

Thank you
Ubuntu 16.04
Reply
#9
(2017-02-05, 00:18)deshark Wrote: I am running Kodi 17 RC3 on Ubuntu 16.04 LTS. In my case it helped to remove pyopenssl and cryptography installed by pip (or easy_install) and leave the apt-get packages python-cryptography and python-openssl. That way there are no missmatched libraries present on the system at the same time.

Code:
pip uninstall pyopenssl
pip uninstall cryptography

sudo apt-get install python-cryptography
sudo apt-get install python-openssl

Hope this will help someone.

Why did you install these via pip in the first place? Is there a "howto" somewhere on the internet that asks you to do this?
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#10
It is actually a bug, see this:

https://bugs.launchpad.net/ubuntu/+sourc...ug/1636573

What you can do is to install python-cryptography version 1.7.1-2 and python-openssl version 16.2.0-1 from distro Zesty (Ubuntu 17.04). What I did:

Edit /etc/apt/sources.list

add:

#Zesty
deb http://se.archive.ubuntu.com/ubuntu zesty main
deb-src http://se.archive.ubuntu.com/ubuntu zesty main

(for Sweden, you can of course change to your country's repository, fist letters after http://)

sudo aptitude update
sudo aptitude install python-cryptography=1.7.1-2
(will also upgrade python-openssl to latest version)
Reply
#11
How can I replicate your solution on a raspberry pi running debian jessie? Smile
Reply
#12
Thank you @Klasw! can confirm it solves the issue on ubuntu 16.04 LTS as well . Big Grin
Reply
#13
I'm having the same issue with the following error:

Code:
extern "Python": function Cryptography_rand_bytes() called, but @ffi.def_extern() was not called in the current subinterpreter.  Returning 0.

It's filling .cache/upstart/unity7.log up to +100gb in a matter of hours.

I'm running Kodi 17.1
Ubuntu 16.04.2 LTS

Following the answer in post 10 above adding the Zesty archive to my sources list and then running
Code:
sudo apt update
I get:
Code:
1349 packages can be upgraded. Run 'apt list --upgradable' to see them.


Can I edit my sources list again and commit out (#) the Zesty archive and continue on with the 16.04 archive or should I just go ahead and upgrade all 1300 packages? I'd rather not install 1300+ upgrades on my system if this is the only problem I'm having.

Running:
Code:
sudo aptitude install python-cryptography=1.7.1-2

Appears to update the two packages and from what I'm seeing everything appears to be working correctly for now, at least I'm not dumping a ton of errors to my upstart log file.

This also has me questioning why my system is dumping the error in .cache/upstart/unity7.log file and not xsessions or sys.log? Is that a problem with the way I have my server set up or is it not a big deal?

Thanks in advance for any help!
Main HTPC/Server, Ubuntu 18.04, Leia 18.0
ASUS Chromebox, Ubuntu 18.04, Leia 18.0, Aeon Nox 5: SiLVO Mod
Reply
#14
What a mess! Using Ubuntu 17.04 to be able to run Kodi 17 and even 16.01! shess757: It IS a big deal and the developers of Kodi and addons should surely address this asap e.g. with simple error handlers!
Me: I'm running Kodi on virtual machine in Linux on an Ubuntu 16.04 derivate and starting Kodi from a terminal window. Thus all the errors are kept in the terminal window and not logged. Downside is that I'm not able to use Kodi any longer...
Reply
#15
Not getting the real issue is one thing. Blaming kodi devs for something that has nothing to do with kodi is another ...

Go troll elsewhere
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply

Logout Mark Read Team Forum Stats Members Help
Kodi flooding XSession errors and filling up disk.0