jurialmunkey / plugin.video.themoviedb.helper

GNU General Public License v3.0
200 stars 95 forks source link

[BUG] Random Crashes on Nexus Nightlies #948

Closed xen0m0rph2020 closed 1 year ago

xen0m0rph2020 commented 1 year ago

Skin section

Other

Current Behavior

Randomly when moving around home screen or widgets or playing video Kodi crashes and restarts This does not happen on nightlies prior to 15th October and on skins without TVMBHelper,

Expected Behavior

Does not crash

Steps To Reproduce

Move down or left or right selection or do nothing

Screenshots and Additional Info

kodi_crashlog_20221130182515.log

Checklist

jurialmunkey commented 1 year ago

@tekker @MoojMidge - Unfortunately RottenTomatoes is only available via XML. When you get the metadata via JSON it is always an empty field.

I think losing RottenTomatoes would be losing the biggest drawcard of OMDb. The Awards info, IMDb rating, and Metacritic score are all still nice to have but, for me personally at least, the RottenTomatoes Critics Consensus and Audience scores are my main go to.

I would actually prefer it to be JSON formatted. XML is only used out of necessity to get RT.

AakashC2020 commented 1 year ago

Hi @jurialmunkey,

For the time being you can shift to the JSON format for OMDB API so that we can get the other ratings apart from Rotten Tomatoes. At least, something is better than nothing. Later on if the XML issue is resolved you can switch back to that again. Just a suggestion. 🙂 I personally want to see the IMDB ratings again.

Thanks and Regards, ShibajiCh.

jurialmunkey commented 1 year ago

For the time being you can shift to the JSON format for OMDB API so that we can get the other ratings apart from Rotten Tomatoes. At least, something is better than nothing. Later on if the XML issue is resolved you can switch back to that again.

@ShibajiCh It is not that simple. The JSON format is a different data structure so it is incompatible with the existing cached data. It would be a breaking change and breaking changes are not suitable as temporary fixes.

jurialmunkey commented 1 year ago

Could everyone please test this branch with OMDb enabled: https://github.com/jurialmunkey/plugin.video.themoviedb.helper/archive/refs/heads/nexus_alt_xmlparsing.zip

This branch uses an alternative method of parsing xml via MiniDOM instead of ElementTree. I don't think MiniDOM uses _elementtree.c but not 100% certain so needs to be tested to confirm before pushing to main branch.

It is very much a bespoke monkey patch custom built specifically for OMDb's XML data structure, so it won't be a suitable long term solution. However, it will at least ensure backwards compatibility with the existing cache database. Which means that when ElementTree does finally get an upstream fix, the bandaid can be removed and the original method restored without much fuss.

AakashC2020 commented 1 year ago

For the time being you can shift to the JSON format for OMDB API so that we can get the other ratings apart from Rotten Tomatoes. At least, something is better than nothing. Later on if the XML issue is resolved you can switch back to that again.

@ShibajiCh It is not that simple. The JSON format is a different data structure so it is incompatible with the existing cached data. It would be a breaking change and breaking changes are not suitable as temporary fixes.

Fine @jurialmunkey. Thanks for the explanation! I can understand.

Regards, ShibajiCh.

AakashC2020 commented 1 year ago

Could everyone please test this branch with OMDb enabled: https://github.com/jurialmunkey/plugin.video.themoviedb.helper/archive/refs/heads/nexus_alt_xmlparsing.zip

This branch uses an alternative method of parsing xml via MiniDOM instead of ElementTree. I don't think MiniDOM uses _elementtree.c but not 100% certain so needs to be tested to confirm before pushing to main branch.

It is very much a bespoke monkey patch custom built specifically for OMDb's XML data structure, so it won't be a suitable long term solution. However, it will at least ensure backwards compatibility with the existing cache database. Which means that when ElementTree does finally get an upstream fix, the bandaid can be removed and the original method restored without much fuss.

Hi @jurialmunkey,

I tested this branch on my Nvidia Shield TV Pro 2019 for a while, which has Android v11. So far there were no crashes. I guess this temporary fix has resolved the issue for now. Thank you so much! 🙂 I guess you can put this version on the repo if others don't face the crashing issue as well.

Thanks and Regards, ShibajiCh.

tekker commented 1 year ago

@jurialmunkey I'll give your MiniDom version a test now...

Actually I'd knocked up a pure python version hack based on some code I found because I hadn't figured out how to install lxml for example... Maybe its of some interest for performance testing or as a curiosity

request.py

from xbmcgui import Dialog
from resources.lib.addon.window import get_property
from resources.lib.addon.plugin import get_localized, get_condvisibility, get_setting
from tmdbhelper.parser import try_int
from resources.lib.addon.tmdate import get_timestamp, set_timestamp
from resources.lib.files.bcache import BasicCache
from resources.lib.addon.logger import kodi_log
from resources.lib.addon.consts import CACHE_SHORT, CACHE_LONG

import re
from collections import OrderedDict

class Attr(OrderedDict):
    pattern = re.compile(r"([\w\-\.:]+?)\s*=\s*(\"[^\"&<]+?\"|\'[^\'&<]+?\')")
    def __init__(self, attr_str):
        super(Attr, self).__init__()
        if attr_str:
            for hit in self.pattern.finditer(attr_str):
                key, value = hit.groups()
                self[key] = value[1:-1]

class Tag:
    def __init__(self, tag, nested=False, attr_only=False, attr_pattern=None):
        '''
        Tag object.
        Parameters
        ----------
        tag : string
            tag name
        nested : boolean
            True if elements with a same tag exist on different levels. Then the innermost
            element will be parsed. False if not nested.
        attr_only : boolean
            True when to parse attributes only.
        attr_pattern : regex pattern
            If not None, tag elements with attributes including this regex pattern will be
            parsed.
        '''
        self.tag = tag
        self.pattern = self.get_pattern(
            tag,
            nested=nested,
            attr_only=attr_only,
            attr_pattern=attr_pattern
        )

    @classmethod
    def get_pattern(cls, tag, nested=False, attr_only=False, attr_pattern=None):
        """
        Return a regular expression object for parsing XML by a given tag name.
        See Tag class for parameters.
        Parameters
        ----------
        tag : string
            tag name
        nested : boolean
            True if elements with a same tag exist on different levels. Then the innermost
            element will be parsed. False if not nested.
        attr_only : boolean
            True when to parse attributes only.
        attr_pattern : regex pattern
            If not None, tag elements with attributes including this regex pattern will be
            parsed.
        Returns
        -------
        o : regex object
            A compiled Python regex object
        """
        if attr_pattern:
            re_string = r"<{0}\s+(?P<attr>%s[^&<]*|[^&<]+\s+%s[^&<]*)" % (attr_pattern, attr_pattern)
        else:
            re_string = r"<{0}(?:\s*|\s+(?P<attr>[^&<]*))"
        if attr_only:
            re_string += r"(>|/>)"
            return re.compile(
                re_string.format(tag),
                re.DOTALL
            )
        if nested:
            re_string += r"(?:>(?P<inner>(?:(?!<{0}[ >]).)*?)</{0}>|></{0}>|\/>)"
        else:
            re_string += r"(?:>(?P<inner>.*?)</{0}>|/>)"
        return re.compile(
            re_string.format(tag),
            re.DOTALL
        )

    def finditer_from_file(self, fileobj, chunk_size=300000):
        xml = fileobj.read(chunk_size)
        while True:
            end_index = 0
            for m in self.pattern.finditer(xml):
                end_index = m.end()
                yield m
            chunk = fileobj.read(chunk_size)
            if chunk:
                if end_index:
                    xml = xml[end_index:] + chunk
                else:
                    xml += chunk
            else:
                break

    def finditer(self, string):
        for g in self.pattern.finditer(string):
            yield g

    def search_from_file(self, fileobj, chunk_size=300000):
        for m in self.finditer_from_file(fileobj, chunk_size=chunk_size):
            return m

    def search(self, string):
        return self.pattern.search(string)

""" Lazyimports
import xml.etree.ElementTree as ET
from copy import copy
from json import dumps
import requests
"""

def translate_xml(request):
    root_re = Tag("root", nested=False)
    movie_re = Tag("movie", nested=False, attr_only=True)
    attrs = Attr(next(root_re.finditer(request.content.decode('utf-8'))).group("inner"))
    my_dict = dict(attrs)
    return my_dict

def translate_xml_elementtree(request):
    def dictify(r, root=True):
        if root:
            return {r.tag: dictify(r, False)}
        from copy import copy
        d = copy(r.attrib)
        if r.text:
            d["_text"] = r.text
        for x in r.findall("./*"):
            if x.tag not in d:
                d[x.tag] = []
            d[x.tag].append(dictify(x, False))
        return d
    if request:
        import xml.etree.ElementTree as ET
        request = ET.fromstring(request.content)
        request = dictify(request)
    return request
tekker commented 1 year ago

@jurialmunkey Testing the nexus_alt_xmlparsing, it seems a pretty good solution :) Stable so far...

krzysztofwinnik commented 1 year ago

@jurialmunkey I'm not a programmer, but I'm very interested in solving this issue, since I experience numerous crashes lately on my CoreElec Nexus nigtly setup (running python 3.9.4).

I've read this thread with interest and have introduced the following changes:

The upside of this procedure was that it resolved https://github.com/jurialmunkey/skin.arctic.horizon.2/issues/386 (EPG crashes I've reported some time ago). As far as crashes are concerned - they do not look random any longer, but seem to happen only on widget refreshing. For example - when navigating home screen if widgets haven't finished loading after skin initialization (which is the most common crash scenerio). Another example would be when a video has finished / stopped, and this forced widgets to refresh.
I've also noticed one more scenerio - crashes seem to happen also when navigating a list after changing view mode (eg. open YouTube addon -> go to my subscriptions -> change view mode -> move selectbox -> experience crash.

Then I installed your latest TMDBhelper from nexus_alt_xmlparsing branch and re-activated OMDB. Unfortunatelly, unlike
others, I have not noticed any change. Crashes still seem to happen on all three scenerios described above.

jurialmunkey commented 1 year ago

@krzysztofwinnik can you get me crash logs (not standard Kodi log - the crash log with backtrace)? If coreelec is same as libreelec the nighties will generate a the crash log with backtrace which will help identify the issue.

Lots of plugins use elementtree so it is very possible you have other plugins causing a crash. This will be exacerbated by skinshortcuts (which also uses elementtree) being triggered on load of the homescreen.

Essentially the more threads attempting to use elementtree at the same time, the more likely the crash. So multiple plugins as widgets using elementtree with skinshortcuts and skinvariables running simultaneously are all going to increase the chance -- educated guess but that sounds like what's happening here.

krzysztofwinnik commented 1 year ago

@jurialmunkey Sure - please find attached 10 crashlogs from last 2 hours.

I only have 3 sources of widgets: TMDBhelper (and TRAKT from TMDBhelper), AutoWidget, native (such as video sources, programms, video plugins).

Hope this helps... kodi_crashlog_20230102112224.log kodi_crashlog_20230102112408.log kodi_crashlog_20230102112621.log kodi_crashlog_20230102112649.log kodi_crashlog_20230102132808.log kodi_crashlog_20230102132837.log kodi_crashlog_20230102132902.log kodi_crashlog_20230102132928.log kodi_crashlog_20230102132954.log kodi_crashlog_20230102133321.log

jurialmunkey commented 1 year ago

@krzysztofwinnik - Lots of _elementtree crashes and lots of plugins using ElementTree.

For instance these three addons all use ElementTree (I'm sure others do too but these were the ones I was immediately drawn to look at due to log messages). CAddonMgr::FindAddons: plugin.video.ezra v0.2.5d installed CAddonMgr::FindAddons: plugin.video.fen v3.0.33 installed CAddonMgr::FindAddons: service.coreelec.settings v20.0.1 installed

At least six of the crashes are explicitly listed as _elementtree segfaults. The last messages in those crash logs indicate the EZRA service and CoreELEC service both running functions that specifically use ElementTree for parsing.

These two addons are almost certainly the cause of significant majority of your crashes and the fact that they run side-by-side will exacerbate the issue -- The ElementTree bug in Python causes SegFault crashes when separate threads attempt to access the ElementTree library at the same time, so two services attempting to use it at the same time is likely to cause a crash.

###EZRA###: CheckSettingsFile Service Starting kodi_crashlog_20230102112224.log kodi_crashlog_20230102132902.log kodi_crashlog_20230102133321.log

## CoreELEC Addon ## updates::set_auto_update ## manual kodi_crashlog_20230102112649.log kodi_crashlog_20230102132837.log

## CoreELEC Addon ## xdbus Monitor started. ## kodi_crashlog_20230102132928.log

^^^ Those are all _elementtree segfaults likely triggered by those two addons using ElementTree and running simultaneously

This crash log is also EZRA and likely _elementtree but the interpretor detected the abnormal state and preemptively force quit with a SIGABRT signal before the segfault occurred so it wasn't listed in the backtrace: kodi_crashlog_20230102132954.log

The other three crashes are a bit more unusual appear to relate to CGUIControlLookup::RemoveLookup(). I'm not exactly sure this function does as my C++ is very rudimentary. However, this is a far less frequent issue. The main issue appears to be related to the two services running that I mentioned above.

At least 7 out of those 10 crashes are _elementtree related and so highly unlikely to be related to TMDbHelper since it has been removed.

hyzor commented 1 year ago

Could everyone please test this branch with OMDb enabled: https://github.com/jurialmunkey/plugin.video.themoviedb.helper/archive/refs/heads/nexus_alt_xmlparsing.zip

This branch uses an alternative method of parsing xml via MiniDOM instead of ElementTree. I don't think MiniDOM uses _elementtree.c but not 100% certain so needs to be tested to confirm before pushing to main branch.

It is very much a bespoke monkey patch custom built specifically for OMDb's XML data structure, so it won't be a suitable long term solution. However, it will at least ensure backwards compatibility with the existing cache database. Which means that when ElementTree does finally get an upstream fix, the bandaid can be removed and the original method restored without much fuss.

Good job mate. Done my usual testing routine and the issue seems to be eradicated. My testing env:

2023-01-02 15:27:44.651 T:77887    info <general>: Starting Kodi (20.0-RC2 (19.90.905) Git:20230102-01f4d336ac). Platform: Linux x86 64-bit
2023-01-02 15:27:44.651 T:77887    info <general>: Using Release Kodi x64
2023-01-02 15:27:44.651 T:77887    info <general>: Kodi compiled 2023-01-02 by GCC 11.3.0 for Linux x86 64-bit version 5.15.64 (331584)
2023-01-02 15:27:44.651 T:77887    info <general>: Running on Ubuntu 22.04.1 LTS, kernel: Linux x86 64-bit version 5.15.0-56-generic

With Python 3.11.1. The only 3rd party addons installed is TMDBHelper addon + Arctic Horizon 2 (and the dependencies).

I've had some initial unrelated crashes (i.e. not caused by ElementTree), I'm hoping that is due to my local env, Kodi really is a piece of fragile software. 😆

jurialmunkey commented 1 year ago

@hyzor - Excellent, thanks for testing. I've also been testing it tonight on my loungeroom setup without any issue so I can't see any reason not to merge the change.

Kodi really is a piece of fragile software

At least in terms of elementtree it is actually CPython itself which is segfaulting not Kodi. Kodi's not really to blame here.

There's a test script in the linked CPython issue thread that will reliably cause segfaults in an external python 3.11 interpreter without Kodi running at all: https://github.com/python/cpython/files/8599659/bug.py.txt

If I run that script in a Python 3.11 interpreter running a in Windows powershell terminal or command prompt, I can reliably cause it to unexpectedly crash to desktop. I had to bump the NTHREAD count up a bit for my machine but it will otherwise fairly reliably crash any application containing a Python interpreter that runs the script.

hyzor commented 1 year ago

@hyzor - Excellent, thanks for testing. I've also been testing it tonight on my loungeroom setup without any issue so I can't see any reason not to merge the change.

Kodi really is a piece of fragile software

At least in terms of elementtree it is actually CPython itself which is segfaulting not Kodi. Kodi's not really to blame here.

There's a test script in the linked CPython issue thread that will reliably cause segfaults in an external python 3.11 interpreter without Kodi running at all: https://github.com/python/cpython/files/8599659/bug.py.txt

If I run that script in a Python 3.11 interpreter running a in Windows powershell terminal or command prompt, I can reliably cause it to unexpectedly crash to desktop. I had to bump the NTHREAD count up a bit for my machine but it will otherwise fairly reliably crash any application containing a Python interpreter that runs the script.

Wow that is crazy, probably a good idea for the Python devs to implement that code snippet into their regression test suite, haha. Pretty cool find to be honest, it was an interesting issue for me to dive into and investigate. When I started investigating I couldn't find any report on this issue, and Python is used by millions of projects so that's why I'm a bit surprised!

I wasn't putting the blame on Kodi in regards to the ElementTree issue, it's just that in general it seems easy to break Kodi and my local env had some unrelated crashes before it went stable. Kodi is extremely customizable but that comes with a cost, also their codebase is pretty damn complex. Regardless I think Kodi is an amazing piece of software, and the things people can achieve with it is inspiring.

Also speaking of 3rd party addons, I'm sure you'll still get a lot of complaints even after fixing TMDbHelper, since lots of other grey zone addons utilize ElementTree.

krzysztofwinnik commented 1 year ago

@jurialmunkey - wow! I didn't expect such a detailed advice and commitment - many, many thanks for that.

Just for your intererst - as you suggested I uninstalled EZRA and FEN (don't use them anyway) - they turned out to cause majority of issues. CoreElec Addon service can't be disabled in CoreElec setups, as it is integral part of it. The result is more than satisfying. There are no more crashes on startup and I can navigate my widgets without any problems even if they are being loaded / reloaded. That's great!

However, there is still one situation that came to my attention, which still causes regular crashes. That is when ReloadSkin() function is invoked (I have it mapped in Power Menu). I wonder how could this be? All of my widgets are TMDBhelper widgets or standard widgets (like PVR channels, video sources etc.). I also have 2 rows of AutoWidget widgets, but disabling AutoWidget has no impact on this problem. There must be something else that causes it... Anyway, just like you've said - it's unlikely to be related to TMDbHelper.

Just out of curiosity - what is your best practice recommendation for TMDBhelper / Arctic Horizon / other addons compatibility? I found several suggestions in this thread, but need some clarification which of them are really relevant - like:

jurialmunkey commented 1 year ago

@krzysztofwinnik - Yeah there will always be some addons like coreelec service which need to use ET but that can't be disabled (same goes for skinshortcuts and skinvariables). And to make it clear, the crashes arent directly the fault of any of the addons. It's simply that the more addons attempting to use ET at the same time increases the chance of triggering the underlying bug in CPython.

Reloadskin could possibly be exacerbating the elementtree issue by forcing several addons to all restart/retrigger at once (eg skinshortcuts will trigger). It could also be triggering an unrelated issue -- need to look at the backtrace and see what Thread 1 was doing to confirm.

Re reuselanguageinvoker. This is an unrelated but known issue. I only mentioned it to rule out known crashes from other sources. Essentially reuselanguageinvoker plugins cannot run in widgets (ie media window use only). I reported a test case a while ago that is the most stripped back simplest plugin possible with reuselanguageinvoker and even it can reliably crash Estuary when used in a widget. Also note the combined views use a widget for the second part (eg the seasons are the "view" and the episodes are a widget based on the view) so you must only use plain uncombined views for those plugins (or disable reuselanguageinvoker).

Thredding is only relevant if the addon is using multiple threads with elementtree. So it won't be necessary to reduce on tmdbhelper in terms of this bug. However on some low powered devices there does seem to be an unrelated issue with too many threads spawning crashing Kodi. Usually this only happens in really intensive lists like your next episodes and going from a starting point where no data has been previously cached. It is relatively rare and only worth reducing threads if you know accessing a specific list like your next episodes is causing a problem.

Off-screen rebuilding is like a "safe" mode for preventing a separate bug but comes at the expense of the service taking slightly longer to add ratings and processed artwork. Many systems will be completely fine with it disabled, so it is worth experimenting with. It is one of those things where technically it should be enabled as it might otherwise cause a crash, but the issue very rarely occurs (if at all) on most systems and the performance benefits of having it disabled by default significantly outweigh the risk.

tekker commented 1 year ago

@jurialmunkey Hi jurial, just wanted to thank you for your work on this and let you know that the actual user experience of AH2 / TMDB / Autowidget combined is light-years from a few weeks back on LE11-Pi4 and Android FireTV 4K Max.

I am currently using TMDBHelper with readahead enabled and without the "rebuild offscreen" workaround, responsiveness is really amazing (not using Fanart.tv for widget / plugin artwork, Fanart.tv enabled for service monitor).

Have had no crashes for the last few days at all.

krzysztofwinnik commented 1 year ago

Reloadskin could possibly be exacerbating the elementtree issue by forcing several addons to all restart/retrigger at once (eg skinshortcuts will trigger). It could also be triggering an unrelated issue -- need to look at the backtrace and see what Thread 1 was doing to confirm.

@jurialmunkey Hi jurial, I've analysed crashlog related to ReloadSkin event we have discussed recently. Thread 1 suggests it is related to C++ function CGUIControlLookup::RemoveLookup(), so it is far from the problem we're dealing with in here, but judging from last log entries seems to be more AH2 skin related:

2023-01-03 22:18:44.304 T:1053     info <general>: Loading skin file: Home.xml, load type: KEEP_IN_MEMORY
2023-01-03 22:18:44.918 T:1053  warning <general>: Skin has invalid include: 
2023-01-03 22:18:44.967 T:1053    error <general>: Misplaced ]
2023-01-03 22:18:44.967 T:1053    error <general>: Error parsing boolean expression [container(2601).isupdating | ] + integer.isequal(container(2601).numitems,0)

Container 2601 is set for FeatureBanner style mdbList if that helps.

kodi_crash.log

PS. Didn't have time to say how thankful I am for your work and advice.

jurialmunkey commented 1 year ago

@krzysztofwinnik - A misformed boolean might create some unexpected skin behaviour with visibility conditions -- e.g. a condition which should evaluate True unintentionally evaluates False -- but it shouldn't cause a crash (I should still fix it though!).

Logs can only report events that have already occurred. A segfault crashes the application immediately and unexpectedly before it can log information about the event occurring. Which means, realistically, the last log messages will only be relevant where the message indicates the start of a script executing -- that allows us to inspect that script code to see what it does next and if it might be connected to the backtrace messages (e.g. like those service addons above using ElementTree).

In general there's no reason to assume the last log message is related. A 1 ghz CPU has a billion clock cycles a second, so a crash even a second after the last logged message could mean many millions of unrelated operations have occurred.


In terms of CGUIControlLookup::RemoveLookup -- as far as I gather this method removes control references from containing groups when the layout is destroyed (e.g. like on a ReloadSkin() command). As to the cause, it could be a skin engine bug.

Long shot guess but it could be an issue where the skin reload destroys the listitem that TMDbHelper was working on. Just wanted to check that you definitely have the Rebuild Offscreen setting enabled? If so, possibly might be worth seeing how it goes without it enabled.

krzysztofwinnik commented 1 year ago

Long shot guess but it could be an issue where the skin reload destroys the listitem that TMDbHelper was working on. Just wanted to check that you definitely have the Rebuild Offscreen setting enabled? If so, possibly might be worth seeing how it goes without it enabled.

@jurialmunkey, you were right again! I had the Rebuild Offscreen setting enabled. When I disabled it, at first there was a crash after ReloadSkin (probably because there were some processes started before the setting was changed?), but afterwards I performed several more tests and there seem to be no more crashes anymore. So it is save to say all crash related scenarios are addressed now - at least all that I managed to identify on my CoreElec setup. Thanks for help!

jurialmunkey commented 1 year ago

@krzysztofwinnik - Oh wow, that was a real long shot. Interesting. That sounds like there might be an underlying Kodi bug there but I guess it's also a bit of an unusual scenario and probably just unlucky timing.

And yeah Kodi needs to restart for changes to that setting to take effect (which the crash would've inadevertently done for you).

SoulReaverFan commented 1 year ago

Issue has been fixed upstream in Python and is now merged and backported to Python 3.10 and 3.11 as well! Yay 🎉 Just wanted to update you guys and thank you so much jurial for all your great work on Kodi 🙂👍

siliconhippy commented 1 year ago

I have had youtube and other widget crashes on AE-PCx86-11.0.18 (Nexus beta) and 11.0.19 (Nexus RC2) versions, from alexelec.tv, a fork of CoreElec. Using Arctic Zephyr2-Reloaded v2.0.0 skin.

  1. So I posted my problem here on Arctic Zephyr2-Reloaded forum, #5158: https://forum.kodi.tv/showthread.php?tid=337862&page=344

And got the answer (not a Skin issue, but Py 3.11 upgrade crash related): https://forum.kodi.tv/showthread.php?tid=367352&pid=3123465#pid3123465

I couldn't find this v 5.0.38+, only your v4.10.14 in Kodi Repo, already part of Arctic Zephyr2-Reloaded 2.0.0 now available from Kodi Repo.

  1. Reading this thread, I get the solution: https://github.com/jurialmunkey/plugin.video.themoviedb.helper/archive/refs/heads/nexus_alt_xmlparsing.zip

  2. However your original post above says Enable, and there are remarks here that say Disable Settings-Other- Rebuild Service listitems offscreen !

  3. So what is the correct solution/workaround to date ? :) Btw, here is my crash log: https://paste.kodi.tv/akohemamab.kodi (Lots of ListItem.setInfo() depecated errors and CCurl crash after Youtube logs. But you are the judge. )

siliconhippy commented 1 year ago

Unluckily the attempt to install zip from 2nd point above failed on my Nexus RC2 AE-PCx86-11.0.19 distro ! https://github.com/jurialmunkey/plugin.video.themoviedb.helper/archive/refs/heads/nexus_alt_xmlparsing.zip

I get an error: "the dependency on xxx moviedbhelper 0.0.7 could not be satified ."

Please advise further ...

jurialmunkey commented 1 year ago

@siliconhippy The testing version is NOT for normal usage. Install from my repository https://jurialmunkey.github.io/repository.jurialmunkey/

siliconhippy commented 1 year ago

@jurialmunkey Thanks for help. No luck still. See Kodi log: https://paste.kodi.tv/pedadafulu.kodi

  1. Installed TMDb-Helper 5.0.46 (also appears under AZ2R Skin-Addons.)
  2. Tried both Enable and then the default Disable listitems (as suggested above) menus, followed by OK, then Kodi restart. There is no OMDb API key anyway. All other default settings are same.
  3. Either way, still have Youtube widget crashes, but seems in different places with Enable v Disable Settings> Other > Rebuild service listitems off screen.
  4. So I guess need a new hack...or wait for Kodi Nexus Stable which still may (not) help !
SoulReaverFan commented 1 year ago

@jurialmunkey Thanks for help. No luck still. See Kodi log: https://paste.kodi.tv/pedadafulu.kodi

  1. Installed TMDb-Helper 5.0.46 (also appears under AZ2R Skin-Addons.)
  2. Tried both Enable and then the default Disable listitems (as suggested above) menus, followed by OK, then Kodi restart. There is no OMDb API key anyway. All other default settings are same.
  3. Either way, still have Youtube widget crashes, but seems in different places with Enable v Disable Settings> Other > Rebuild service listitems off screen.
  4. So I guess need a new hack...or wait for Kodi Nexus Stable which still may (not) help !

Nexus stable has been released now in case you didn’t see. Try using default settings in TMDBHelper with that release and type in your omdb api key. Works for me.

jurialmunkey commented 1 year ago

Why do you think tmdbhelper is going to fix youtube crashes? Those are completely different addons.

SoulReaverFan commented 1 year ago

Why do you think tmdbhelper is going to fix youtube crashes? Those are completely different addons.

Sorry missed that one. Maybe reuse language invoker in YouTube addon could be causing issues?

btw thank you for all that you’ve done for Kodi jurial!

Have a good one! :-)

btw I am not a dev. Just trying to be helpful :-)

jurialmunkey commented 1 year ago

@SoulReaverFan - no worries! My comment was directed at @siliconhippy not you.

And yes plugins using reuselanguageinvoker will have issues when used as widgets. It's been well documented and even specifically for youtube. Nothing to do with tmdbhelper

See https://github.com/xbmc/xbmc/issues/16844 https://github.com/xbmc/xbmc/issues/21653

siliconhippy commented 1 year ago

Why do you think tmdbhelper is going to fix youtube crashes? Those are completely different addons.

Hi @jurialmunkey !

Good news: I turned off resuselanguageinvoker in addon.xml for plugin.video.youtube, and the Youtube widgets crashes have disappeared at least for now.

Hopefuly Nexus Stable or some other update will not create new crashes...Python really is unstable itself !

So thanks.

Re: your question, I was lead to your Nexus Nightly Crashes TMDb v 5.038+ solution by @beastmasterrs. And also included Kodi logs as above for review, if needed. You then gave your repo for TMDb update.

Since I am a noob, and not a dev, I assumed the Skin experts would know...but the new question re: Youtube addon not TMDb issue is something I could have been pointed to earlier.

In any case, not all Youtube issues are related to its addon bugs. Many problems seem related to Skin coding.

Regardless, we should all appreciate the stellar work of volunteers for Kodi and its addons and associated OSes. The fact is that Kodi related crashes are not necessarily more than those of Google, FB and other Big Techs !

siliconhippy commented 1 year ago

@jurialmunkey Thanks for help. No luck still. See Kodi log: https://paste.kodi.tv/pedadafulu.kodi

  1. Installed TMDb-Helper 5.0.46 (also appears under AZ2R Skin-Addons.)
  2. Tried both Enable and then the default Disable listitems (as suggested above) menus, followed by OK, then Kodi restart. There is no OMDb API key anyway. All other default settings are same.
  3. Either way, still have Youtube widget crashes, but seems in different places with Enable v Disable Settings> Other > Rebuild service listitems off screen.
  4. So I guess need a new hack...or wait for Kodi Nexus Stable which still may (not) help !

Nexus stable has been released now in case you didn’t see. Try using default settings in TMDBHelper with that release and type in your omdb api key. Works for me.

Hi @SoulReaverFan !

Thanks for the update. Now how do I get the OMDb API key, assuming the default (blank) key cannot work ?

SoulReaverFan commented 1 year ago

@jurialmunkey Thanks for help. No luck still. See Kodi log: https://paste.kodi.tv/pedadafulu.kodi

  1. Installed TMDb-Helper 5.0.46 (also appears under AZ2R Skin-Addons.)
  2. Tried both Enable and then the default Disable listitems (as suggested above) menus, followed by OK, then Kodi restart. There is no OMDb API key anyway. All other default settings are same.
  3. Either way, still have Youtube widget crashes, but seems in different places with Enable v Disable Settings> Other > Rebuild service listitems off screen.
  4. So I guess need a new hack...or wait for Kodi Nexus Stable which still may (not) help !

Nexus stable has been released now in case you didn’t see. Try using default settings in TMDBHelper with that release and type in your omdb api key. Works for me.

Hi @SoulReaverFan !

Thanks for the update. Now how do I get the OMDb API key, assuming the default (blank) key cannot work ?

Register for one here and don’t forget to actually activate the key when you receive the email by clicking the activation link and you should have your ratings after typing it in to the TMDBHelper settings.

siliconhippy commented 1 year ago

@SoulReaverFan

OK, noted. Now what happens if I don't use an OMDb API key? I don't need to have ratings etc.

SoulReaverFan commented 1 year ago

@SoulReaverFan

OK, noted. Now what happens if I don't use an OMDb API key? I don't need to have ratings etc.

Nothing happens. You just don’t get as many different ratings sources displayed.

KookieMonster commented 1 year ago

Hey @jurialmunkey , any chance yesterday's release (5.0.50-nexus) might have broken the addon in any way? As soon as I select any player the addon changes screen, starts loading and after a second or so Kodi freezes or crashes. This wasn't happening before. I tried getting the log from openwizard when I re-launch Kodi but it says that there's no error log. I have Kodi installed on my Xbox Series X, so getting files isn't that easy.

PS: sorry to bother you, mate.

meesterexx commented 1 year ago

Hey @jurialmunkey , any chance yesterday's release (5.0.50-nexus) might have broken the addon in any way? As soon as I select any player the addon changes screen, starts loading and after a second or so Kodi freezes or crashes. This wasn't happening before. I tried getting the log from openwizard when I re-launch Kodi but it says that there's no error log. I have Kodi installed on my Xbox Series X, so getting files isn't that easy.

On Win 11 here, I didn't get a crash, but first attempt to use player after update threw an error in skin (Arctic Horizon 2). So I went to TMDBHelper settings Expert > Delete Cache and deleted all five caches listed there, repeated player attempt and it worked correctly.

KookieMonster commented 1 year ago

Hey @jurialmunkey , any chance yesterday's release (5.0.50-nexus) might have broken the addon in any way? As soon as I select any player the addon changes screen, starts loading and after a second or so Kodi freezes or crashes. This wasn't happening before. I tried getting the log from openwizard when I re-launch Kodi but it says that there's no error log. I have Kodi installed on my Xbox Series X, so getting files isn't that easy.

On Win 11 here, I didn't get a crash, but first attempt to use player after update threw an error in skin (Arctic Horizon 2). So I went to TMDBHelper settings Expert > Delete Cache and deleted all five caches listed there, repeated player attempt and it worked correctly.

Thanks for the reply, mate. I'll be sure to try that later today. Cheers

meesterexx commented 1 year ago

Thanks for the reply, mate. I'll be sure to try that later today. Cheers

Scratch what I said. Looks like it was unrelated. After digging some more I realized the first item I tried to play was the first movie in Movies > Popular and it also happened to be one that I had forgotten I had on my NAS. TMDBH Players was set to play local Kodi files automatically and my NAS had gone to sleep so it bombed. I set it to play Manual to correct the issue in the future.

Sorry for the misinformation. I should have looked deeper before responding.

KookieMonster commented 1 year ago

Scratch what I said. Looks like it was unrelated. After digging some more I realized the first item I tried to play was the first movie in Movies > Popular and it also happened to be one that I had forgotten I had on my NAS. TMDBH Players was set to play local Kodi files automatically and my NAS had gone to sleep so it bombed. I set it to play Manual to correct the issue in the future.

Sorry for the misinformation. I should have looked deeper before responding.

No problem mate. Doesn't hurt trying that anyway.

jurialmunkey commented 1 year ago

@KookieMonster - The update shouldn't have any impact on players. It is only for the service monitor.

You can test to confirm by installing 5.0.49 manually via zip from releases https://github.com/jurialmunkey/plugin.video.themoviedb.helper/releases/tag/v5.0.49

However it didn't change anything with players so it is highly unlikely to be the issue.

KookieMonster commented 1 year ago

@KookieMonster - The update shouldn't have any impact on players. It is only for the service monitor.

I messed up. I've been having a few issues with Trakt personal lists showing TMDB logo instead of the movie/show posters and on one of my experiments I might have turned on the wrong option. I'm not sure but I think it was "Rebuild service listitems offscreen" that was crashing Kodi 'cause I turned it off and now it seems to be ok. Sorry 'bout that.

Btw, the Trakt personal lists issue... do you have any clue why this happens?! PXL_20230214_222045050.jpg

jurialmunkey commented 1 year ago

Closing as workaround added in TMDbHelper and broader ElementTree issue is resolved in Nexus 20.1 which will release soon.