Skip to content
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

Sync library not working #487

Open
m00kfu opened this issue Jan 1, 2020 · 48 comments
Open

Sync library not working #487

m00kfu opened this issue Jan 1, 2020 · 48 comments

Comments

@m00kfu
Copy link

m00kfu commented Jan 1, 2020

So I've been using trakt with Kodi on a windows machine for years, no problem. Even tried having it sync on the windows machine earlier today to make sure it wasn't an issue with the trakt api itself. I decided to set up a raspberry pi 4 running raspbian buster as a dedicated media center. For some reason the trakt plugin just doesn't get any data to sync the watched status on my library in the new setup. I've installed/uninstalled/reinstalled the trakt plugin multiple times, restarted kodi, rebooted the machine, reset my auth token for tract multiple times (both through kodi and by revoking access through the website)... nothing seems to work. Any suggestions for what to try next would be more than welcome!

Here's the log file showing what's happening... https://paste.kodi.tv/qesafopevo.kodi

@m00kfu
Copy link
Author

m00kfu commented Jan 1, 2020

Also just confirmed that scrobbling works fine, so it's not an account issue.

@razzeee
Copy link
Collaborator

razzeee commented Jan 4, 2020

I can't get the same problem with linux. But I don't have an 32bit ARM, can you try with the latest v18 release?

@m00kfu
Copy link
Author

m00kfu commented Jan 4, 2020

Unfortunately v18.4 is the latest release available for the raspberry pi 4 at the moment. I was also wondering if it was something specific to the pi4 build that was causing it, because my windows install was also 18.4 still and didn't have this issue. It's been years since I've done the compiling thing myself but maybe I'll spend some time today playing around and see if I can get 18.5 compiled myself.

@razzeee
Copy link
Collaborator

razzeee commented Jan 4, 2020

Can you maybe diff the dependencies your raspberry pi lists versus the ones you windows does? I mean the ones shown in the Kodi UI for the trakt addon.

@m00kfu
Copy link
Author

m00kfu commented Jan 4, 2020

Just checked them both and they match, both the dependencies and the version numbers.

@razzeee
Copy link
Collaborator

razzeee commented Jan 4, 2020

And your using it with the same trakt user?

@m00kfu
Copy link
Author

m00kfu commented Jan 4, 2020

Yep, same trakt account

@m00kfu
Copy link
Author

m00kfu commented Jan 4, 2020

The only thing I can think of is maybe it's something to do with kodi's database? The windows install went back years, at least until Jarvis. Unfortunately I switched the windows install over to use upnp last night and cleaned the library so I can't get log data to compare the shows info submitted to trakt in the plugin.

@razzeee
Copy link
Collaborator

razzeee commented Jan 4, 2020 via email

@m00kfu
Copy link
Author

m00kfu commented Jan 4, 2020

Nope, no nfo files. Everything is just scraped from thetvdb and stored in kodi's database.

@journeym
Copy link

I have the same problem, trakt is not syncing.
Im using Raspbian booster, and latest Kodi.
It was working fine before 14 of december 19, as mentioned here https://forum.kodi.tv/showthread.php?tid=220547

@egrueda
Copy link

egrueda commented Jan 13, 2020

Same problem here, I get a "200 None" response from API
https://pastebin.com/Bjgh3AhF

@journeym
Copy link

All right, my problem was because of expired token. After i enabled debug in kodi and in settings .xml for an addon in userdata (for some strange reason button in addon never REALLY enables the debug mode for the addon, even after disabling/enabling.
I got the relevant logs i could work with
2020-01-23 14:49:38.175 T:2413035728 DEBUG: [script.trakt] resources.lib.syncMovies: [Movies Sync] Getting movie data from Kodi 2020-01-23 14:49:38.393 T:2413035728 DEBUG: [script.trakt] resources.lib.syncMovies: [Movies Sync] Getting movie collection from Trakt.tv 2020-01-23 14:49:38.395 T:2413035728 INFO: [script.trakt] trakt.core.http: OAuth - Current username is not available ("username" parameter hasn't been defined) 2020-01-23 14:49:38.395 T:2413035728 INFO: [script.trakt] trakt.core.http: OAuth - Token has expired, refreshing token... 2020-01-23 14:49:38.401 T:2413035728 DEBUG: [script.trakt] urllib3.connectionpool: Starting new HTTPS connection (1): api.trakt.tv:443 2020-01-23 14:49:38.645 T:2413035728 DEBUG: [script.trakt] urllib3.connectionpool: https://api.trakt.tv:443 "POST /oauth/token HTTP/1.1" 401 213 2020-01-23 14:49:38.650 T:2413035728 WARNING: [script.trakt] trakt.core.http: OAuth - Unable to refresh expired token (rejected) 2020-01-23 14:49:38.651 T:2413035728 DEBUG: [script.trakt] trakt.core.emitter: [trakt.client.TraktClient ]:emit(event: 'oauth.refresh.rejected', args: (None,), kwargs: {}) 2020-01-23 14:49:38.651 T:2413035728 DEBUG: [script.trakt] resources.lib.syncMovies: [Movies Sync] Error getting Trakt.tv movie list, aborting movie Sync.
So, after re-connecting to trakt all started working.

@razzeee
Copy link
Collaborator

razzeee commented Jan 23, 2020

That's by design, as that was how it was meant to be implemented according to the kodi guys.

@Pebaar
Copy link

Pebaar commented Jan 26, 2020

All right, my problem was because of expired token. After i enabled debug in kodi and in settings .xml for an addon in userdata (for some strange reason button in addon never REALLY enables the debug mode for the addon, even after disabling/enabling.
I got the relevant logs i could work with
2020-01-23 14:49:38.175 T:2413035728 DEBUG: [script.trakt] resources.lib.syncMovies: [Movies Sync] Getting movie data from Kodi 2020-01-23 14:49:38.393 T:2413035728 DEBUG: [script.trakt] resources.lib.syncMovies: [Movies Sync] Getting movie collection from Trakt.tv 2020-01-23 14:49:38.395 T:2413035728 INFO: [script.trakt] trakt.core.http: OAuth - Current username is not available ("username" parameter hasn't been defined) 2020-01-23 14:49:38.395 T:2413035728 INFO: [script.trakt] trakt.core.http: OAuth - Token has expired, refreshing token... 2020-01-23 14:49:38.401 T:2413035728 DEBUG: [script.trakt] urllib3.connectionpool: Starting new HTTPS connection (1): api.trakt.tv:443 2020-01-23 14:49:38.645 T:2413035728 DEBUG: [script.trakt] urllib3.connectionpool: https://api.trakt.tv:443 "POST /oauth/token HTTP/1.1" 401 213 2020-01-23 14:49:38.650 T:2413035728 WARNING: [script.trakt] trakt.core.http: OAuth - Unable to refresh expired token (rejected) 2020-01-23 14:49:38.651 T:2413035728 DEBUG: [script.trakt] trakt.core.emitter: [trakt.client.TraktClient ]:emit(event: 'oauth.refresh.rejected', args: (None,), kwargs: {}) 2020-01-23 14:49:38.651 T:2413035728 DEBUG: [script.trakt] resources.lib.syncMovies: [Movies Sync] Error getting Trakt.tv movie list, aborting movie Sync.
So, after re-connecting to trakt all started working.

How did you resolve this issue? I have the same "Error getting Trakt.tv movie list, aborting movie Sync" problem (not seeing any oath issues though) with rpi4 on raspbian buster. (works fine on rpi4 libreelec and on windows 10)
You mention re-connecting solved this problem. Did you just delete and reinstall the add-on? I've done that a number of times.

@journeym
Copy link

journeym commented Jan 26, 2020

For reference, my hardware/software versions
root@amn:~# lsb_release -a No LSB modules are available. Distributor ID: Raspbian Description: Raspbian GNU/Linux 10 (buster) Release: 10 Codename: buster
root@amn:~# cat /proc/device-tree/model Raspberry Pi 4 Model B Rev 1.1

root@amn:~# apt list kodi Listing... Done kodi/testing,now 2:18.5-1~buster all [installed]
I just pushed the how to connect button in trakt addon config, and entered provided key using provided url.

@Pebaar
Copy link

Pebaar commented Jan 26, 2020

For reference, my hardware/software versions
root@amn:~# lsb_release -a No LSB modules are available. Distributor ID: Raspbian Description: Raspbian GNU/Linux 10 (buster) Release: 10 Codename: buster
root@amn:~# cat /proc/device-tree/model Raspberry Pi 4 Model B Rev 1.1

root@amn:~# apt list kodi Listing... Done kodi/testing,now 2:18.5-1~buster all [installed]
I just pushed the how to connect button in trakt addon config, and entered provided key using provided url.

Thanks for the reply. It does not look like a linking issue considering scrobbling is working. I just can't get the watched flags to sync from trakt.

@journeym
Copy link

My log for reference
https://pastebin.com/6NFAGnEE

@journeym
Copy link

trakt seems overwhelmed with requests today, got a few timeouts on a web

@Pebaar
Copy link

Pebaar commented Jan 27, 2020

trakt seems overwhelmed with requests today, got a few timeouts on a web

I also noticed this. I will test again tonight and see if it is any better.
Although it was working on LibreELEC and Windows 10 yesterday.

@Pebaar
Copy link

Pebaar commented Jan 27, 2020

2020-01-26 19:46:22.819 T:2688540880 DEBUG: [script.trakt] urllib3.connectionpool: https://api.trakt.tv:443 "GET /sync/watched/shows HTTP/1.1" 200 None
2020-01-26 19:46:22.996 T:2688540880 DEBUG: [script.trakt] resources.lib.syncEpisodes: [Episodes Sync] Invalid Trakt.tv show list, possible error getting data from Trakt, aborting Trakt.tv collection/watched/rated update.
2020-01-26 19:46:23.000 T:2688540880 DEBUG: [script.trakt] resources.lib.syncEpisodes: [Episodes Sync] Error getting Trakt.tv collected show list, aborting tv show sync.

How can I determine what the error is getting the show list?

@egrueda
Copy link

egrueda commented Jan 27, 2020

This is the part of the log where my windows machine does sync and my linux oen doesn't:

Kodi 18.5 on win7

2020-01-27 08:33:55.775 T:15580   DEBUG: [script.trakt] resources.lib.syncEpisodes: [Episodes Sync] Getting episode collection/watched/rated from Trakt.tv
2020-01-27 08:33:56.099 T:15580   DEBUG: [script.trakt] urllib3.connectionpool: https://api.trakt.tv:443 "GET /sync/collection/shows HTTP/1.1" 200 None
2020-01-27 08:33:59.169 T:15580   DEBUG: [script.trakt] urllib3.connectionpool: https://api.trakt.tv:443 "GET /sync/watched/shows HTTP/1.1" 200 None
2020-01-27 08:34:00.052 T:15580   DEBUG: [script.trakt] urllib3.connectionpool: https://api.trakt.tv:443 "GET /sync/ratings/shows HTTP/1.1" 200 None
2020-01-27 08:34:00.204 T:15580   DEBUG: [script.trakt] urllib3.connectionpool: https://api.trakt.tv:443 "GET /sync/ratings/episodes HTTP/1.1" 200 None
2020-01-27 08:34:00.380 T:15580   DEBUG: [script.trakt] resources.lib.syncEpisodes: [Episodes Sync] 24 show(s) have episodes (125) to be added to your Trakt.tv collection.

Kodi 18.5 on raspbian

2020-01-27 09:04:00.503 T:2166796496   DEBUG: [script.trakt] resources.lib.syncEpisodes: [Episodes Sync] Getting episode collection/watched/rated from Trakt.tv
2020-01-27 09:04:03.674 T:2166796496   DEBUG: [script.trakt] urllib3.connectionpool: https://api.trakt.tv:443 "GET /sync/collection/shows HTTP/1.1" 200 None
2020-01-27 09:04:03.781 T:2166796496   DEBUG: [script.trakt] resources.lib.syncEpisodes: [Episodes Sync] Invalid Trakt.tv show list, possible error getting data from Trakt, aborting Trakt.tv collection/watched/rated update.
2020-01-27 09:04:03.784 T:2166796496   DEBUG: [script.trakt] resources.lib.syncEpisodes: [Episodes Sync] Error getting Trakt.tv collected show list, aborting tv show sync.

Does this point to a urllib3-related failure?
P.S.: in both machines, script.module.urllib3 is version 1.25.6, so might be related to python... don't know for sure

@egrueda
Copy link

egrueda commented Jan 27, 2020

I've edited syncEpisodes.py (line 143) just before "Invalid Trakt.tv show list" for debugging the exception.
I just added:

        except Exception as e:
            z = e
            logger.debug("** Start **")
            logger.debug(z)
            logger.debug("** Stop **")

And this is what I get:

2020-01-27 09:25:21.488 T:2682224848   DEBUG: [script.trakt] urllib3.connectionpool: https://api.trakt.tv:443 "GET /sync/collection/shows HTTP/1.1" 200 None
2020-01-27 09:25:21.564 T:2682224848   DEBUG: [script.trakt] resources.lib.syncEpisodes: ** Start **
2020-01-27 09:25:21.564 T:2682224848   DEBUG: [script.trakt] resources.lib.syncEpisodes: "arrow" module is not available
2020-01-27 09:25:21.565 T:2682224848   DEBUG: [script.trakt] resources.lib.syncEpisodes: ** Stop **
2020-01-27 09:25:21.565 T:2682224848   DEBUG: [script.trakt] resources.lib.syncEpisodes: [Episodes Sync] Invalid Trakt.tv show list, possible error getting data from Trakt, aborting Trakt.tv collection/wa

Which module is it missing? any clues?

@razzeee
Copy link
Collaborator

razzeee commented Jan 27, 2020

@egrueda
Copy link

egrueda commented Jan 27, 2020

That's the arrow module http://ftp.snt.utwente.nl/pub/software/xbmc/addons/leia/script.module.arrow/

But I do have that addon installed, that's the thing
I've forced update to version 0.15.5 but error persists

@Pebaar
Copy link

Pebaar commented Jan 27, 2020

I've edited syncEpisodes.py (line 143) just before "Invalid Trakt.tv show list" for debugging the exception.
I just added:

        except Exception as e:
            z = e
            logger.debug("** Start **")
            logger.debug(z)
            logger.debug("** Stop **")

And this is what I get:

2020-01-27 09:25:21.488 T:2682224848   DEBUG: [script.trakt] urllib3.connectionpool: https://api.trakt.tv:443 "GET /sync/collection/shows HTTP/1.1" 200 None
2020-01-27 09:25:21.564 T:2682224848   DEBUG: [script.trakt] resources.lib.syncEpisodes: ** Start **
2020-01-27 09:25:21.564 T:2682224848   DEBUG: [script.trakt] resources.lib.syncEpisodes: "arrow" module is not available
2020-01-27 09:25:21.565 T:2682224848   DEBUG: [script.trakt] resources.lib.syncEpisodes: ** Stop **
2020-01-27 09:25:21.565 T:2682224848   DEBUG: [script.trakt] resources.lib.syncEpisodes: [Episodes Sync] Invalid Trakt.tv show list, possible error getting data from Trakt, aborting Trakt.tv collection/wa

Which module is it missing? any clues?

Thanks for this. I'll do a similar test tonight and report back.

@razzeee
Copy link
Collaborator

razzeee commented Jan 27, 2020

You could try if you get more infos with https://stackoverflow.com/a/4564595/2859813

@journeym
Copy link

i also have 0.15.5

@egrueda
Copy link

egrueda commented Jan 27, 2020

You could try if you get more infos with https://stackoverflow.com/a/4564595/2859813

Sure! Here you have it

2020-01-27 12:02:08.527 T:2684326096   DEBUG: [script.trakt] resources.lib.syncEpisodes: [Episodes Sync] Getting episode collection/watched/rated from Trakt.tv
2020-01-27 12:02:08.837 T:2684326096   DEBUG: [script.trakt] urllib3.connectionpool: https://api.trakt.tv:443 "GET /sync/collection/shows HTTP/1.1" 200 None
2020-01-27 12:02:08.910 T:2684326096   DEBUG: [script.trakt] resources.lib.syncEpisodes: "arrow" module is not available
2020-01-27 12:02:08.919 T:2684326096   DEBUG: [script.trakt] resources.lib.syncEpisodes: Traceback (most recent call last):
                                              File "/home/pi/.kodi/addons/script.trakt/resources/lib/syncEpisodes.py", line 128, in __traktLoadShows
                                                traktShowsCollected = self.sync.traktapi.getShowsCollected(traktShowsCollected)
                                              File "/home/pi/.kodi/addons/script.trakt/resources/lib/traktapi.py", line 189, in getShowsCollected
                                                Trakt['sync/collection'].shows(shows, exceptions=True)
                                              File "/home/pi/.kodi/addons/script.module.trakt/lib/trakt/interfaces/base/__init__.py", line 22, in wrap
                                                return func(*args, **kwargs)
                                              File "/home/pi/.kodi/addons/script.module.trakt/lib/trakt/interfaces/sync/core/mixins.py", line 53, in shows
                                                **kwargs
                                              File "/home/pi/.kodi/addons/script.module.trakt/lib/trakt/interfaces/sync/collection.py", line 25, in get
                                                **kwargs
                                              File "/home/pi/.kodi/addons/script.module.trakt/lib/trakt/interfaces/base/__init__.py", line 22, in wrap
                                                return func(*args, **kwargs)
                                              File "/home/pi/.kodi/addons/script.module.trakt/lib/trakt/interfaces/sync/core/mixins.py", line 45, in get
                                                **self.flags
                                              File "/home/pi/.kodi/addons/script.module.trakt/lib/trakt/mapper/sync.py", line 24, in process
                                                **kwargs
                                              File "/home/pi/.kodi/addons/script.module.trakt/lib/trakt/mapper/sync.py", line 200, in map_items
                                                **kwargs
                                              File "/home/pi/.kodi/addons/script.module.trakt/lib/trakt/mapper/sync.py", line 46, in item
                                                **kwargs
                                              File "/home/pi/.kodi/addons/script.module.trakt/lib/trakt/mapper/sync.py", line 92, in show
                                                cls.show_episode(client, season, episode_num, i_episode, **kwargs)
                                              File "/home/pi/.kodi/addons/script.module.trakt/lib/trakt/mapper/sync.py", line 113, in show_episode
                                                **kwargs
                                              File "/home/pi/.kodi/addons/script.module.trakt/lib/trakt/mapper/sync.py", line 274, in map_item
                                                obj = cls.construct(client, media, i_data, keys, **kwargs)
                                              File "/home/pi/.kodi/addons/script.module.trakt/lib/trakt/mapper/core/base.py", line 107, in construct
                                                return Episode._construct(client, keys, item, **kwargs)
                                              File "/home/pi/.kodi/addons/script.module.trakt/lib/trakt/objects/episode.py", line 156, in _construct
                                                episode._update(info, **kwargs)
                                              File "/home/pi/.kodi/addons/script.module.trakt/lib/trakt/objects/episode.py", line 134, in _update
                                                super(Episode, self)._update(info, **kwargs)
                                              File "/home/pi/.kodi/addons/script.module.trakt/lib/trakt/objects/video.py", line 105, in _update
                                                self.collected_at = from_iso8601_datetime(info.get('collected_at'))
                                              File "/home/pi/.kodi/addons/script.module.trakt/lib/trakt/core/helpers.py", line 124, in from_iso8601_datetime
                                                raise Exception('"arrow" module is not available')
                                            Exception: "arrow" module is not available
2020-01-27 12:02:08.919 T:2684326096   DEBUG: [script.trakt] resources.lib.syncEpisodes: [Episodes Sync] Invalid Trakt.tv show list, possible error getting data from Trakt, aborting Trakt.tv collection/watched/rated update.
2020-01-27 12:02:08.922 T:2684326096   DEBUG: [script.trakt] resources.lib.syncEpisodes: [Episodes Sync] Error getting Trakt.tv collected show list, aborting tv show sync.
2020-01-27 12:02:08.929 T:2684326096   DEBUG: [script.trakt] resources.lib.sync: [Sync] Finished synchronization with Trakt.tv

Hope it helps

@Pebaar
Copy link

Pebaar commented Jan 27, 2020

I've edited syncEpisodes.py (line 143) just before "Invalid Trakt.tv show list" for debugging the exception.
I just added:

        except Exception as e:
            z = e
            logger.debug("** Start **")
            logger.debug(z)
            logger.debug("** Stop **")

And this is what I get:

2020-01-27 09:25:21.488 T:2682224848   DEBUG: [script.trakt] urllib3.connectionpool: https://api.trakt.tv:443 "GET /sync/collection/shows HTTP/1.1" 200 None
2020-01-27 09:25:21.564 T:2682224848   DEBUG: [script.trakt] resources.lib.syncEpisodes: ** Start **
2020-01-27 09:25:21.564 T:2682224848   DEBUG: [script.trakt] resources.lib.syncEpisodes: "arrow" module is not available
2020-01-27 09:25:21.565 T:2682224848   DEBUG: [script.trakt] resources.lib.syncEpisodes: ** Stop **
2020-01-27 09:25:21.565 T:2682224848   DEBUG: [script.trakt] resources.lib.syncEpisodes: [Episodes Sync] Invalid Trakt.tv show list, possible error getting data from Trakt, aborting Trakt.tv collection/wa

Which module is it missing? any clues?

I'm getting the same issue:

"arrow" module is not available

I also have 0.15.5 installed though

@journeym
Copy link

Interesting. I have the same hardware/software versions, and dont have that problem.
Feel free to ask for any info to narrow down the issue.

@Pebaar
Copy link

Pebaar commented Jan 27, 2020

Interesting. I have the same hardware/software versions, and dont have that problem.
Feel free to ask for any info to narrow down the issue.

Thanks but I'm out of ideas at the moment. I'm gonna trash the OS and start from scratch and hope for the best.

@egrueda
Copy link

egrueda commented Jan 27, 2020

Thanks but I'm out of ideas at the moment. I'm gonna trash the OS and start from scratch and hope for the best.

I whish I could give you some more information, but I have no idea :-(
System is a clean install or Raspbian 10 Buster.
Installed kodi version: 2:18.5-1~buster using apt
All has been installed manually, no distros, images or scripts.

pi@rpi4:~ $ python --version
Python 2.7.16
pi@rpi4:~ $ python
Python 2.7.16 (default, Oct 10 2019, 22:02:15) 
[GCC 8.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import arrow
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/pi/.local/lib/python2.7/site-packages/arrow/__init__.py", line 3, in <module>
    from .api import get, now, utcnow
  File "/home/pi/.local/lib/python2.7/site-packages/arrow/api.py", line 10, in <module>
    from arrow.factory import ArrowFactory
  File "/home/pi/.local/lib/python2.7/site-packages/arrow/factory.py", line 18, in <module>
    from arrow import parser
  File "/home/pi/.local/lib/python2.7/site-packages/arrow/parser.py", line 15, in <module>
    from backports.functools_lru_cache import lru_cache  # pragma: no cover
ImportError: No module named functools_lru_cache

Is that functools_lru_cache error important? :-D

@razzeee
Copy link
Collaborator

razzeee commented Jan 27, 2020

Can you check if the arrow dependency is enabled? settings > system > addons > manage dependencies

functools_lru_cache might be relevant, as that's a dependency of requests for python 2.7 but not with python 3 (or kodi matrix therefore)

Anyway functools_lru_cache should have been installed via dependency in kodi too

@egrueda
Copy link

egrueda commented Jan 27, 2020

Can you check if the arrow dependency is enabled? settings > system > addons > manage dependencies

Yes, I can see it, attached relevant screenshots

screenshot000
screenshot001
screenshot002
screenshot003

@Pebaar
Copy link

Pebaar commented Jan 27, 2020

Can you check if the arrow dependency is enabled? settings > system > addons > manage dependencies

Yes, I can see it, attached relevant screenshots

I have the same versions running after a fresh Raspbian Buster reinstall -> install Kodi -> install Trakt plugin ... but I still get the same error

@carlosg85
Copy link

Same problem with Raspbian & RASPY 4... cannot get my showed films in kodi

@razzeee
Copy link
Collaborator

razzeee commented Jan 28, 2020

Can any of you edit the code here https://github.com/Razzeee/script.module.trakt/blob/master/lib/trakt/core/helpers.py#L8-L11 so that we get a log of the error and a stacktrace too?

@Pebaar
Copy link

Pebaar commented Jan 28, 2020

Can any of you edit the code here https://github.com/Razzeee/script.module.trakt/blob/master/lib/trakt/core/helpers.py#L8-L11 so that we get a log of the error and a stacktrace too?

I'll try that when I get home if someone doesn't beat me to it :) Thanks

@Pebaar
Copy link

Pebaar commented Jan 28, 2020

Can any of you edit the code here https://github.com/Razzeee/script.module.trakt/blob/master/lib/trakt/core/helpers.py#L8-L11 so that we get a log of the error and a stacktrace too?

Got the following output:

No module named functools_lru_cache

EDIT: confirmed backports.functools_lru_cache 1.6.1 is in list under manage dependencies

EDIT2: code generating the above output:

from backports.functools_lru_cache import lru_cache

@razzeee
Copy link
Collaborator

razzeee commented Jan 28, 2020

Can you try #486 (comment) or if that doesn't work arrow-py/arrow#495 (comment)

@egrueda
Copy link

egrueda commented Jan 28, 2020

I did:
sudo apt install python-backports.functools-lru-cache

Then I tried again to import arrow manually, and this time it didn't fail:

pi@rpi4:~ $ python
Python 2.7.16 (default, Oct 10 2019, 22:02:15) 
[GCC 8.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import arrow
>>> 
pi@rpi4:~ $ 

So something had been fixed.
Then I restarted kodi and tried again.
Run without errors :-D
It's working! Fixed.
Thank you, @razzeee !!

pi@rpi4:~ $ dpkg -L python-backports.functools-lru-cache
/.
/usr
/usr/lib
/usr/lib/python2.7
/usr/lib/python2.7/dist-packages
/usr/lib/python2.7/dist-packages/backports
/usr/lib/python2.7/dist-packages/backports/functools_lru_cache.py
/usr/lib/python2.7/dist-packages/backports.functools_lru_cache-1.5.egg-info
/usr/lib/python2.7/dist-packages/backports.functools_lru_cache-1.5.egg-info/PKG-INFO
/usr/lib/python2.7/dist-packages/backports.functools_lru_cache-1.5.egg-info/dependency_links.txt
/usr/lib/python2.7/dist-packages/backports.functools_lru_cache-1.5.egg-info/namespace_packages.txt
/usr/lib/python2.7/dist-packages/backports.functools_lru_cache-1.5.egg-info/requires.txt
/usr/lib/python2.7/dist-packages/backports.functools_lru_cache-1.5.egg-info/top_level.txt
/usr/share
/usr/share/doc
/usr/share/doc/python-backports.functools-lru-cache
/usr/share/doc/python-backports.functools-lru-cache/changelog.Debian.gz
/usr/share/doc/python-backports.functools-lru-cache/changelog.gz
/usr/share/doc/python-backports.functools-lru-cache/copyright
/usr/share/python
/usr/share/python/ns
/usr/share/python/ns/python-backports.functools-lru-cache

@Pebaar
Copy link

Pebaar commented Jan 29, 2020

Can you try #486 (comment) or if that doesn't work crsmithdev/arrow#495 (comment)

Thanks for this! As @egrueda mentioned, installing python-backports.functools-lru-cache has gotten things going.

@carlosg85
Copy link

Now is working! thank you very much all of you

@MasterCATZ
Copy link

MasterCATZ commented Jul 3, 2020

even with sudo apt install python-backports.functools-lru-cache
that dependancy is listed as orphened v1.6.1 no updates available and incompatible with kodi ?

traktv still errors out , has not been in sync all year unsure why it is not loading resources.lib

2020-07-04 08:51:23.506 T:140401717528320 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.ImportError'>
Error Contents: No module named resources.lib
Traceback (most recent call last):
File "/home/aio/.kodi/addons/script.trakt/default.py", line 5, in
from resources.lib import kodilogging
ImportError: No module named resources.lib
-->End of Python script error report<--

https://pastebin.com/X8XUy3WD

whereis python python: /usr/bin/python3.6 /usr/bin/python3.6m /usr/bin/python3.8-config /usr/bin/python3.8 /usr/bin/python2.7 /usr/bin/python /usr/lib/python2.7 /usr/lib/python3.8 /usr/lib/python3.6 /usr/lib/python3.7 /etc/python3.8 /etc/python /etc/python2.7 /etc/python3.6 /etc/python3.7 /usr/local/lib/python3.8 /usr/local/lib/python2.7 /usr/local/lib/python3.6 /usr/include/python3.8 /usr/include/python2.7 /usr/include/python3.8m /usr/share/python
which python3 /usr/bin/python3

and de-installed nightly version of kodi and installed version supplied with apt for ubuntu 20.04 LTS

Screenshot from 2020-07-04 17-48-58

Screenshot from 2020-07-04 17-46-20

odly what seemed to fix this was loading up kodi as root , installing traktv then copying the addons folder over the top of the normal kodi profile

@DarthMuppet54
Copy link

I had the same symptoms on Raspberry Pi OS 10 (buster), freshly downloaded and installed today.

sudo apt install python-backports.functools-lru-cache

fixed it. I also did a fresh install of Ubuntu 20.04 elsewhere last night, and it worked without intervention on there. Kodi is 18.7, current for the 32-bit ARM-based Pi 4.

@slm020
Copy link

slm020 commented Jan 21, 2021

Been having the same problem for nearly a year.

Reinstalled Pi with latest Raspbian two weeks ago and stumbled across this just now. "sudo apt install python-backports.functools-lru-cache" solved this problem on my Pi immediately.

Pi 4
Kodi 18.7
Raspbian 10 (Buster)

@maarten682
Copy link

Just leaving some more search terms here, this is still a valid solution for some setups

Im running Kodi installed through retropie_setup --> optional packages via binary (granted a bit of an old retropie setup) but been having this problem across multiple installs;

Invalid Trakt.tv show list, possible error getting data from Trakt, aborting Trakt.tv collection/watched/rated update.

and running a quick

sudo apt install python-backports.functools-lru-cache

followed by a reboot instantly fixed everything!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants