0

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 2 minutes.

-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:

extern "Python": function Cryptography_rand_bytes() called, but @ffi.def_extern() was not called in the current subinterpreter.  Returning 0.
2
  • I'm just really lazy and made it a fifo, sudo mkfifo .xsession-errors Jun 22 '17 at 22:41
  • @JacobEvans true but from the looks of it it is not recommended as it seems the kodi addons are using forcing the updated lib to update and if it fails sudo apt install -f fixes it. Jun 24 '17 at 1:58
1

The python in my error message provoked my curiosity. The NUC is used as a mediacenter and has Kodi installed and runs at startup.

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

It could also be the cec adapter that has been soldered and it did have a recent driver update.

1

I have a workaround with Kodi 16.1 on Ubuntu.

Signs of my problem with kodi 16.1 came after the mid-January updates. I woke up that morning to my hard drive not having any space for security updates.

Hardware

I'm running Kodi on the Voyager-16.04.1.1-amd64, Lenovo ThinkPad E530 that I have installed a 120 GB "SandDisk SSD Plus" hard drive. It's partition off for 3 operating systems (for just these moments) the partition that I'm working on has 89.4 GB, The size of my OS at root is ranged between 7.6 GB and 10.2 GB. It floored me to wake up to see that all 89.4 GB was gone.

After going through my files I found an over sized hidden text file "startxfce4.log" located in the Home directory ( /home/mrbobs/.cache/upstart/ ). It was two lines of text that was repeating.

Over 70GB of

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.

I was able to delete the file but, when Kodi was running the “startxfce4.log" it came back and started growing again.

I tried installing different builds, and after I restarted Kodi the file once again grew. I pasted the two lines in Google, and seen that this all came down do to the Python library not handling SSH well.

Looking at my Kodi logs I can also see this:

20:10:00 T:139622927554304   ERROR: EXCEPTION Thrown (PythonToCppException) : 
-->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!

Error Type: <class 'urllib2.URLError'>
Error Contents: <urlopen error [Errno 0] Error>
Traceback (most recent call last):
File "/home/mrbobs/.kodi/addons/plugin.video.youtube/default.py", line 7, in <module> runner.run(__provider__)
File "/home/mrbobs/.kodi/addons/plugin.video.youtube/resources/lib/kodion/runner.py", line 32, in run __RUNNER__.run(provider, context)
File "/home/mrbobs/.kodi/addons/plugin.video.youtube/resources/lib/kodion/impl/xbmc/xbmc_runner.py", line 23, in run results = provider.navigate(context)
File "/home/mrbobs/.kodi/addons/plugin.video.youtube/resources/lib/kodion/abstract_provider.py", line 93, in navigate result = method(context, re_match)
File "/home/mrbobs/.kodi/addons/plugin.video.youtube/resources/lib/kodion/register_provider_path.py", line 12, in wrapper return func(*args, **kwargs)
File "/home/mrbobs/.kodi/addons/plugin.video.youtube/resources/lib/youtube/provider.py", line 392, in _on_yt_specials return yt_specials.process(category, self, context, re_match)
File "/home/mrbobs/.kodi/addons/plugin.video.youtube/resources/lib/youtube/helper/yt_specials.py", line 256, in process return _process_live_events(provider, context, re_match)
File "/home/mrbobs/.kodi/addons/plugin.video.youtube/resources/lib/youtube/helper/yt_specials.py", line 95, in _process_live_events json_data = provider.get_client(context).get_live_events(event_type='live', page_token=page_token)
File "/home/mrbobs/.kodi/addons/plugin.video.youtube/resources/lib/youtube/client/youtube.py", line 426, in get_live_events return self._perform_v3_request(method='GET', path='search', params=params, quota_optimized=True)
File "/home/mrbobs/.kodi/addons/plugin.video.youtube/resources/lib/youtube/client/youtube.py", line 615, in _perform_v3_request result = requests.get(_url, params=_params, headers=_headers, verify=False, allow_redirects=allow_redirects)
File "/home/mrbobs/.kodi/addons/plugin.video.youtube/resources/lib/kodion/simple_requests/api.py", line 189, in get return _request('GET', url, **kwargs)
File "/home/mrbobs/.kodi/addons/plugin.video.youtube/resources/lib/kodion/simple_requests/api.py", line 165, in _request response = opener.open(request)
File "/usr/lib/python2.7/urllib2.py", line 429, in open response = self._open(req, data)
File "/usr/lib/python2.7/urllib2.py", line 447, in _open '_open', req)
File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 1241, in https_opencontext=self._context)
File "/usr/lib/python2.7/urllib2.py", line 1198, in do_open raise URLError(err)
URLError: <urlopen error [Errno 0] Error> -->End of Python script error report<--

20:10:01 T:139625223715136   ERROR: GetDirectory - Error getting plugin://plugin.video.youtube/special/live/
20:10:01 T:139625223715136   ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.youtube/special/live/) failed
20:10:01 T:139622927554304  NOTICE: [plugin.video.youtube] Running: YouTube (5.3.8) on Jarvis (Kodi-16.1) with Python 2.7.12
20:10:17 T:139623858685696 WARNING: [xbmcswift2] No converter provided, unicode should be used, but returning str value
20:10:17 T:139622927554304 WARNING: Previous line repeats 2 times.

Then I seen Zanna's answer saying that she just moved her Kodi config file.

The python in my error message provoked my curiosity. The NUC is used as a mediacenter and has Kodi installed and runs at startup.

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

It could also be the cec adapter that has been soldered and it did have a recent driver update.

Thank you Zanna you got me thinking.

{( Doing what Zanna said will returns Kodi back to the out of the box settings and I wanted to save my settings )}

After reading this I started going through my Kodi add-ons file and removed them one by one to see which one had been breaking my Kodi. After setting up all night I found that it was a combination of two files. One was an old Kodi add-on named “script.xbmcbackup”, and the other was the Python requests library packed ( This also broke the YouTube add-on, and all the time I was thinking it was my API key ) named “script.module.requests”..

After I deleted both of these my hard drive stopped filling up with repeating text and my YouTube also worked.

It needs to be noted that the “script.module.requests” may come back as a dependency to other add-ons and updates.

  • The first thing to look for when this happens is you will lose YouTube, and its dependencies

  • The 2nd is the CPU runs over time if not removed. The hard drive will once again fill

  • The 3rd you will lose icons and Kodi will start running sluggish, and may even freeze at times

Well, that's it, I’m just hoping that the guys at Python can get the SSH problem fixed soon. I know that their going to get this fixed so I’m just hoping that it will be soon. Thank all of you for the work that your putting into SSH Everywhere. This work will help protect us all from man-in-the-middle attacks not just with my little Kodi, but also in the bigger picture of Global National Security of IoT the Internet of Things. Keep up the hard work that you're doing and have done.

I’m not a programmer so this is just a workaround

I don’t know the under the hoods of this, I need to do more homework, and If you do what I have done all I can say is back your data up before you start. I can also say is this works for me for now.

Holding down the “Ctrl” key then click on your “H” key to unhides the hidden files and folders. (when this was done I saw a dot in front of the folder names). Then I went to my Home directory where I saw the (.cache) and the (.kodi) along with other folders.

(The .cache folder is where I found my over-sized text file) ( /home/mrbobs/.cache/upstart/startxfce4.log ) if you're doing this replace the “mrbobs” user name with your user user name.

Then with Kodi closed I Deleted my ”startxfce4.log” file. Afterwards while still having Kodi closed I deleted the two add-on folders “script.module.requests” and the “script.xbmcbackup” located in ( /home/mrbobs/.kodi/addons/ )

After this all ran fine for me. ( if you do this you may have to re-delete your “script.module.requests” I had to and I also did the same with my “startxfce4.log” the first reopening of Kodi may do an add-on updates, but after re-deleting my kodi ran well. ).

One more thing. The over texting file may not be your "startxfce4.log" it could be the ".xsession-errors.old" in your Home folder. The best way to see this is by right-clicking and looking at Properties.

3
  • Thanks bob, but a simple force install fixed it for me. One of the Kodi Developers helped me here: forum.kodi.tv/showthread.php?tid=304613&pid=2519370 Feb 7 '17 at 23:27
  • I'm going to try this. It's better to have a fix then a workaround Feb 8 '17 at 1:27
  • Thank you this stops the repeating text in "startxfce4.log" :) but now I need to find a way of getting YouTube to work... Feb 8 '17 at 2:06
0

This might help, I have noticed that when an add-on starts caching this symptom comes in to picture. Such as if I open Exodus or youtube then this happens, before that with kodi open also the log file stays normal.

0

It is a valid work-around to delete script.module.requests. It DOES have very much to do with the fact that I updated python and installed python-requests!

Here is more evidence! .cache/upstart/Unity7.log growing to consume the entire free disk space. Python cypto suspected

The solution posted at that link also solves this problem and is a more permanent solution as you need not worry about script.module.requests being reinstalled

In short the best solution is:

wget http://launchpadlibrarian.net/292839640/python-openssl_16.2.0-1_all.deb

for 32 bit

wget https://launchpad.net/ubuntu/+source/python-cryptography/1.7.1-2/+build/11756123/+files/python-cryptography_1.7.1-2_i386.deb

or for 64 bit

wget http://launchpadlibrarian.net/299484105/python-cryptography_1.7.1-2_amd64.deb

for 64 bit

sudo dpkg -i python-cryptography_1.7.1-2_amd64.deb 

for 32 bit

sudo dpkg -i python-cryptography_1.7.1-2_i386.deb 

Then:

sudo dpkg -i python-openssl_16.2.0-1_all.deb
sudo apt-get -f install

Problems related to python have now manifested themselves on 4 systems and now testing with second system.

Enough to say it can also cause addons to not update as well as other weird problems, as seen here: https://forum.kodi.tv/showthread.php?tid=324635

Not the answer you're looking for? Browse other questions tagged or ask your own question.