trakt / Plex-Trakt-Scrobbler

Add what you are watching on Plex to trakt.tv
1.44k stars 167 forks source link

Sync delay & no realtime scrobbling #598

Open vibos07 opened 3 years ago

vibos07 commented 3 years ago

Using plugin for about a week and it has an issue with scrobbling:

  1. No matter what settings are selected, plex syncs data once in a 60 minutes.
  2. It does not sync what im watching right now.

No plex pass. No trakt VIP. Same settings works on my other plex servers. Debug and info logs & settings screenshot attached.

Снимок экрана 2021-06-24 в 15 20 19 com.plexapp.plugins.trakttv-5.log com.plexapp.plugins.trakttv-4.log

Can someone explain what im doing wrong and what i can try to fix this? I was thinking of deleting plugin and reinstalling it, but plex wont allowing me to remove it and if i just delete the bundle from plugins folder, it will keep all associated files, so this is just useless (i've tried btw). Maybe if someone can tell where all files are located, i can try to manually remove them and then upload just bundle again via smb.

vibos07 commented 3 years ago

Update: removed all files from plex that had trakt in their names, then deleted bundle. After a clean installation and setup i'm still getting same issue.

darkcoderrises commented 2 years ago

Series scrobbling is not working for me either for the past couple of weeks. Was something changed recently at trakt?

smailpouri commented 2 years ago

same here

darkcoderrises commented 2 years ago

One curious thing: I can see on track what's being played right now, but it doesn't save that episode was watched.

darkcoderrises commented 2 years ago

I was going through the logs and saw this

2021-08-04 03:15:09,810 - exception_wrappers.database.apsw.base (7f853894eb38) :  INFO (exception_wrappers.database.apsw.base:34) - Exception raised in apsw: IOError: disk I/O error
Traceback (most recent call last):
  File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Libraries/Shared/exception_wrappers/database/apsw/raw.py", line 25, in execute
    return self.__cursor.execute(*args, **kwargs)
  File "src/cursor.c", line 1019, in APSWCursor_execute.sqlite3_prepare
  File "src/statementcache.c", line 386, in sqlite3_prepare
IOError: IOError: disk I/O error
2021-08-04 03:15:09,813 - plugin.core.message              (7f853894eb38) :  CRITICAL (plugin.core.message:77) - Trakt cache raised an input/output error (disk I/O error)
Traceback (most recent call last):
  File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Libraries/Shared/exception_wrappers/database/apsw/raw.py", line 25, in execute
    return self.__cursor.execute(*args, **kwargs)
  File "src/cursor.c", line 1019, in APSWCursor_execute.sqlite3_prepare
  File "src/statementcache.c", line 386, in sqlite3_prepare
IOError: IOError: disk I/O error
2021-08-04 03:15:09,918 - plugin.sync.main                 (7f853894eb38) :  WARNING (plugin.sync.main:85) - Unable to construct task: Database has been automatically disabled, check the plugin logs for more information
Traceback (most recent call last):
  File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Libraries/Shared/plugin/sync/main.py", line 83, in queue
    task = SyncTask.create(account, mode, data, media, trigger, **kwargs)
  File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Libraries/Shared/plugin/sync/core/task/main.py", line 191, in create
    task.load()
  File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Libraries/Shared/plugin/sync/core/task/main.py", line 98, in load
    self.state.load()
  File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Libraries/Shared/elapsed/main.py", line 64, in inner
    return func(*args, **kwargs)
  File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Libraries/Shared/plugin/sync/core/task/state/main.py", line 20, in load
    self.trakt.load()
  File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Libraries/Shared/plugin/sync/core/task/state/trakt_.py", line 36, in load
    self.cache = self._build_cache()
  File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Libraries/Shared/plugin/sync/core/task/state/trakt_.py", line 49, in _build_cache
    cache = Cache(self.task.media, self.task.data, storage)
  File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Libraries/Shared/trakt_sync/cache/main.py", line 17, in __init__
    self.collections = self.storage('collections')
  File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Libraries/Shared/plugin/sync/core/task/state/trakt_.py", line 44, in storage
    ApswArchive(DatabaseManager.cache('trakt'), name),
  File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Libraries/Shared/stash/archives/a_apsw.py", line 32, in __init__
    c.execute('create table if not exists "%s" (key PRIMARY KEY, value BLOB)' % self.table)
  File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Libraries/Shared/exception_wrappers/database/apsw/raw.py", line 27, in execute
    self.__connection.on_exception(ExceptionSource.APSW, sys.exc_info())
  File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Libraries/Shared/exception_wrappers/database/apsw/base.py", line 47, in on_exception
    raise DatabaseDisabledError(exc_info[1])
DatabaseDisabledError: Database has been automatically disabled, check the plugin logs for more information
2021-08-04 03:15:09,925 - plugin.modules.scheduler.handlers.h_sync.interval (7f853894eb38) :  INFO (plugin.modules.scheduler.handlers.h_sync.interval:53) - Queue error: Unable to construct task: Database has been automatically disabled, check the plugin logs for more information

I have tried deleting the plex.db and trakt.db from the PMS support/cache folder. I will update if that fixes the problem for me.

aidanmacgregor commented 2 years ago

I was going through the logs and saw this

2021-08-04 03:15:09,810 - exception_wrappers.database.apsw.base (7f853894eb38) :  INFO (exception_wrappers.database.apsw.base:34) - Exception raised in apsw: IOError: disk I/O error
Traceback (most recent call last):
  File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Libraries/Shared/exception_wrappers/database/apsw/raw.py", line 25, in execute
    return self.__cursor.execute(*args, **kwargs)
  File "src/cursor.c", line 1019, in APSWCursor_execute.sqlite3_prepare
  File "src/statementcache.c", line 386, in sqlite3_prepare
IOError: IOError: disk I/O error
2021-08-04 03:15:09,813 - plugin.core.message              (7f853894eb38) :  CRITICAL (plugin.core.message:77) - Trakt cache raised an input/output error (disk I/O error)
Traceback (most recent call last):
  File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Libraries/Shared/exception_wrappers/database/apsw/raw.py", line 25, in execute
    return self.__cursor.execute(*args, **kwargs)
  File "src/cursor.c", line 1019, in APSWCursor_execute.sqlite3_prepare
  File "src/statementcache.c", line 386, in sqlite3_prepare
IOError: IOError: disk I/O error
2021-08-04 03:15:09,918 - plugin.sync.main                 (7f853894eb38) :  WARNING (plugin.sync.main:85) - Unable to construct task: Database has been automatically disabled, check the plugin logs for more information
Traceback (most recent call last):
  File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Libraries/Shared/plugin/sync/main.py", line 83, in queue
    task = SyncTask.create(account, mode, data, media, trigger, **kwargs)
  File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Libraries/Shared/plugin/sync/core/task/main.py", line 191, in create
    task.load()
  File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Libraries/Shared/plugin/sync/core/task/main.py", line 98, in load
    self.state.load()
  File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Libraries/Shared/elapsed/main.py", line 64, in inner
    return func(*args, **kwargs)
  File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Libraries/Shared/plugin/sync/core/task/state/main.py", line 20, in load
    self.trakt.load()
  File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Libraries/Shared/plugin/sync/core/task/state/trakt_.py", line 36, in load
    self.cache = self._build_cache()
  File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Libraries/Shared/plugin/sync/core/task/state/trakt_.py", line 49, in _build_cache
    cache = Cache(self.task.media, self.task.data, storage)
  File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Libraries/Shared/trakt_sync/cache/main.py", line 17, in __init__
    self.collections = self.storage('collections')
  File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Libraries/Shared/plugin/sync/core/task/state/trakt_.py", line 44, in storage
    ApswArchive(DatabaseManager.cache('trakt'), name),
  File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Libraries/Shared/stash/archives/a_apsw.py", line 32, in __init__
    c.execute('create table if not exists "%s" (key PRIMARY KEY, value BLOB)' % self.table)
  File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Libraries/Shared/exception_wrappers/database/apsw/raw.py", line 27, in execute
    self.__connection.on_exception(ExceptionSource.APSW, sys.exc_info())
  File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Trakttv.bundle/Contents/Libraries/Shared/exception_wrappers/database/apsw/base.py", line 47, in on_exception
    raise DatabaseDisabledError(exc_info[1])
DatabaseDisabledError: Database has been automatically disabled, check the plugin logs for more information
2021-08-04 03:15:09,925 - plugin.modules.scheduler.handlers.h_sync.interval (7f853894eb38) :  INFO (plugin.modules.scheduler.handlers.h_sync.interval:53) - Queue error: Unable to construct task: Database has been automatically disabled, check the plugin logs for more information

I have tried deleting the plex.db and trakt.db from the PMS support/cache folder. I will update if that fixes the problem for me.

any luck? i cant get up and running at all, i dont need what im watching now, but the ability to sync watched history every now and again would be awesome

vibos07 commented 2 years ago

any luck? i cant get up and running at all, i dont need what im watching now, but the ability to sync watched history every now and again would be awesome

Dont try to run it. If you’ll even find a way for this plug in to work, it will kill your hard drives in a few months. Just forget about trakt on plex or use vip account :(

btw im switched to trakt vip and this shit not working correctly for tv shows, so ive made a refund and stopped using plex (returned to infuse with integrated trakt sync)

darkcoderrises commented 2 years ago

For me, the problem was that there is one .db.journal file that couldn't be deleted. I fixed the HDD, then I was facing another issue. When I fixed that, trakt plex sync started working for me. @vibos07 could you explain? it will kill your hard drives in a few months

vibos07 commented 2 years ago

For me, the problem was that there is one .db.journal file that couldn't be deleted. I fixed the HDD, then I was facing another issue. When I fixed that, trakt plex sync started working for me. @vibos07 could you explain? it will kill your hard drives in a few months

Explaining: plugin constantly writes nothing to everywhere and making 100% load on hdd, which will kill it very fast

darkcoderrises commented 2 years ago

Got it. Seems like this project is mostly dead. I might create a fork and try to fix the load on HDD.

SasSam commented 2 years ago

Series scrobbling is not working for me either for the past couple of weeks. Was something changed recently at trakt?

@darkcoderrises Most likely it's not trakt issue, but the plex agent. They updated it and they not using tvdb/imdb ids anymore, but something internal guid. Check this issue: https://github.com/trakt/Plex-Trakt-Scrobbler/issues/596

vibos07 commented 2 years ago

@SasSam this is not agent issue, because scrobbling isnt working with old “imdb” or “tvdb” agents too. Thats just plex in general. They killed ALL plugins and all agents forever and soon everything will crush.

SasSam commented 2 years ago

@vibos07 read the linked issue carefully, and you will see it's an agent issue. Just to prove it, the movie scrobbler is still working.

carlosmg2 commented 2 years ago

Series scrobbling is not working for me either for the past couple of weeks. Was something changed recently at trakt?

@darkcoderrises Most likely it's not trakt issue, but the plex agent. They updated it and they not using tvdb/imdb ids anymore, but something internal guid. Check this issue: #596

they fixed that. https://forums.plex.tv/t/implemented-native-plex-agents-allow-access-to-external-provider-ids-for-media-eg-imdb-tmdb-tvdb/619090/130?u=carlosmg2 Third party plugins should update something...

SasSam commented 2 years ago

they fixed that. https://forums.plex.tv/t/implemented-native-plex-agents-allow-access-to-external-provider-ids-for-media-eg-imdb-tmdb-tvdb/619090/130?u=carlosmg2 Third party plugins should update something...

Yes, I'm aware of that.. but still... it's doesn't work properly yet with TV shows.

jeff15110168 commented 2 years ago

what is the most recent trakt plex plugin? is it the one from rg9400?

vibos07 commented 2 years ago

what is the most recent trakt plex plugin? is it the one from rg9400?

Correct

jeff15110168 commented 2 years ago

i see there's also a commit from @cosmincc that seems to be forked from rg9400. Do you know what the differences are to rg9400's?

https://github.com/cosmincc/Plex-Trakt-Scrobbler

vibos07 commented 2 years ago

Its completely different, because non of them are working

jeff15110168 commented 2 years ago

What do you mean it’s completely different. How is it different?

SasSam commented 2 years ago

@jeff15110168 you can use this repo's master branch because @rg9400 merged his changes into that. However, it still doesn't work for me for TV shows. It works with Movies only. It does not scrobble TV shows.

jeff15110168 commented 2 years ago

Did anyone figure out how to solve the issue of sync working properly but real time scrobbling not working? I'm using cornishman's fork which fixes the tv show issues broadly.

EDIT (12/19/21): Cornishman’s new updated fork from #596 fixed all my issues :)

@jeff15110168 Try this branch instead, direct zip link. It's a separate branch that includes both my fix from here as well as the PlexOnlineToken fix pending in #615.

Let me know how you get on 👍