trakt/Plex-Trakt-Scrobbler

Re-enable Scrobbler API (after disabling it)

Closed this issue · 4 comments

My sister hit the API switch thinking it was reversible when trying to solve a minor Plex /Trakt integration issue. (The issue has been long since forgotten) So, for those who have never tested it, ever since that fateful day, she is the ONLY one (through Plex plugin GUI) who has ANY integration. Attempts to login to the configuration page, upon clicking it, are taunted with a wonderfully mysterious Unknown error shown below the server name and upon further research an "Unable to process request, API is currently disabled" error thrown in Console. (See embedded image below)

TL;DR: [Is it possible to/How can I] re-enable plex-trakt-scrobbler API after having it disabled? (or work around the issue in ANY way to get multi-user working again)

P.S. If the API button is as fatal as it seems there should be a warning upon attempt to deactivate that such actions are ill-advised and irreparable.

Screenshot_20191014_170205

I figured out that the settings are saved in the Plex Media Server\Plug-in Support\Databases folder, and deleting com.plexapp.plugins.trakttv.db* got me back in but all settings were lost and must be rebuilt in case someone else makes this mistake.

Thank you so much for not only making this issue, but explaining how to fix it!

I did not even touch that api button, i was setting this up for the very first time. Deleting those db files still fixed the issue for me :)

@caseyomah
Did you ever figure out what key in the DB caused the issue? For a while, the scrobbler would randomly pick and choose which shows to scrobble, until October 13th, when it decided to just stop scrobbling at all - these are the most recent entries in the action.history table of com.plexapp.plugins.trakttv.db:

id account_id session_id event performed queued_at sent_at rating_key part
14898 1 4379 scrobble/stop scrobble 2019-10-13 23:47:13 2019-10-13 23:47:18 178070 1
14897 1 4379 scrobble/start start 2019-10-13 23:34:56 2019-10-13 23:34:57 178070 1
14896 1 4379 scrobble/pause pause 2019-10-13 23:31:16 2019-10-13 23:31:17 178070 1
14895 1 4379 scrobble/start start 2019-10-13 23:25:06 2019-10-13 23:25:06 178070 1
14894 1 4379 scrobble/pause pause 2019-10-13 23:22:46 2019-10-13 23:22:51 178070 1
14893 1 4379 scrobble/start start 2019-10-13 23:21:39 2019-10-13 23:21:46 178070 1
14892 1 4379 scrobble/stop scrobble 2019-10-13 23:21:39 2019-10-13 23:21:40 178027 1
14891 1 4379 scrobble/start start 2019-10-13 23:21:09 2019-10-13 23:21:10 178027 1
14890 1 4379 scrobble/pause pause 2019-10-13 22:22:49 2019-10-13 22:22:52 178027 1
14889 1 4379 scrobble/start start 2019-10-13 22:04:22 2019-10-13 22:04:31 178027 1
14888 1 4379 scrobble/stop scrobble 2019-10-13 22:04:22 2019-10-13 22:04:26 177957 1
14887 1 4379 scrobble/start start 2019-10-13 21:51:49 2019-10-13 21:51:55 177957 1
14886 1 4379 scrobble/stop scrobble 2019-10-13 21:51:49 2019-10-13 21:51:49 177911 1
14885 1 4379 scrobble/start start 2019-10-13 21:34:19 2019-10-13 21:34:28 177911 1
14884 1 4379 scrobble/stop scrobble 2019-10-13 21:34:18 2019-10-13 21:34:23 177811 1
14883 1 4379 scrobble/start start 2019-10-13 21:30:45 2019-10-13 21:30:47 177811 1
14882 1 4379 scrobble/pause pause 2019-10-13 21:29:15 2019-10-13 21:29:17 177811 1
14881 1 4379 scrobble/start start 2019-10-13 21:24:05 2019-10-13 21:24:07 177811 1
14880 1 4379 scrobble/pause pause 2019-10-13 19:57:25 2019-10-13 19:57:28 177811 1
14879 1 4379 scrobble/start start 2019-10-13 19:44:48 2019-10-13 19:44:57 177811 1
14878 1 4379 scrobble/stop scrobble 2019-10-13 19:44:48 2019-10-13 19:44:52 177670 1
14877 1 4379 scrobble/start start 2019-10-13 19:26:31 2019-10-13 19:26:41 177670 1
14876 1 4379 scrobble/stop   2019-10-13 19:26:31 2019-10-13 19:26:36 177625 1
14875 1 4379 scrobble/start start 2019-10-13 19:23:28 2019-10-13 19:23:31 177625 1
14874 1 4378 scrobble/stop   2019-10-13 19:23:14 2019-10-13 19:23:16 177071 1
14873 1 4378 scrobble/start start 2019-10-13 19:23:04 2019-10-13 19:23:05 177071 1
14872 1 4377 scrobble/stop scrobble 2019-10-13 17:30:42 2019-10-13 17:30:46 177625 1
14871 1 4377 scrobble/pause pause 2019-10-13 15:30:44 2019-10-13 15:30:46 177625 1
14870 1 4377 scrobble/start start 2019-10-13 15:13:28 2019-10-13 15:13:36 177625 1

BUT... Looking at the session table, it continued to maintain a record of everything I watched, just... without scrobbling any of it:

id account_id client_id user_id rating_key session_key state progress duration view_offset updated_at part part_count part_duration
822 1 0e5208b746ce4a58-com-plexapp-android 1 172827 29:34 stop 100.06 1396229 1397000 2019-11-09 20:49:12 1 1 1396229
821 1 0e5208b746ce4a58-com-plexapp-android 1 172827 29:33 stop 71.39 1396229 996772 2019-11-09 20:43:22 1 1 1396229
820 1 0e5208b746ce4a58-com-plexapp-android 1 172827 29:32 stop 45.17 1396229 630701 2019-11-09 20:31:13 1 1 1396229
819 1 c259dbf491de4f89-com-plexapp-android 1 172827 29:31 stop 41.87 1396229 584628 2019-11-09 16:43:25 1 1 1396229
818 1 c259dbf491de4f89-com-plexapp-android 1 171081 29:30 stop 100.07 1432035 1433000 2019-11-09 14:33:57 1 1 1432035
817 1 c259dbf491de4f89-com-plexapp-android 1 171081 29:29 stop 28.21 1432035 403916 2019-11-09 11:42:11 1 1 1432035
4386 1 c259dbf491de4f89-com-plexapp-android 1 177220 19:27 stop 82.38 1427092 1175704 2019-10-14 17:25:57 1 1 1427092
4385 1 c259dbf491de4f89-com-plexapp-android 1 176797 19:26 stop 17.53 1427136 250165 2019-10-14 11:05:23 1 1 1427136
4384 1 c259dbf491de4f89-com-plexapp-android 1 172900 19:25 stop 39.96 1427093 570265 2019-10-14 03:38:06 1 1 1427093
4383       172755 19:24 create     3316 2019-10-14 03:00:15 1 1  
4382 1 c259dbf491de4f89-com-plexapp-android 1 172755 19:23 stop 0.23 1427072 3316 2019-10-14 03:00:14 1 1 1427072
4381 1 c259dbf491de4f89-com-plexapp-android 1 172604 19:22 stop 59.44 1427071 848315 2019-10-14 00:30:52 1 1 1427071
4380 1 c259dbf491de4f89-com-plexapp-android 1 170129 19:21 stop 36.72 1671560 613739 2019-10-14 00:17:14 1 1 1671560

So, I have 268 unscrobbled views that are still in the DB that would all just go *poof* if I simply deleted the DB file. I'm not sure if I can simply rearrange the data from the session table and add it to the action.queue table in order to get it scrobbled, and if wiping/rebuilding the DB would in some way affect the probability of that working, so I was hoping you (or some other enterprising individual) might have discovered what precisely the issue was... I realize that is a long shot, but I thought I'd try.

The only thing that really struck me as odd was the configuration.option table, which had some... interesting values, which I don't really know enough SQL to tell whether they are supposed to be that way, or something got corrupted:

trackt

Usually, when I start seeing symbols I can't even properly paste in most programs as values, I guess corruption, but it could just be they aren't being displayed properly. When copied as SQL commands, it looks like this:

trakt2

Which... is still weird, but... I don't know... having a working example to compare it to would certainly make it a lot simpler.

*sigh*

I miss the days when Plex still officially supported plug-ins, and Trakt just worked...

EDIT:

So I tried viewing the configuration.option table with the value column displayed as a Hex Blob, which at least made it legible - still not sure if the data is correct, though:

account_id key value
0 sync.action.mode C0
0 api.enabled C0
1 sync.lists.liked.playlists C2
1 sync.lists.personal.playlists C2
1 sync.lists.watchlist.playlists C2
0 sync.profiler 1
0 sync.idle_defer C2
0 sync.idle_delay 1E
0 activity.mode C0
0 matcher.mode 0
0 scrobble.duplication_period CD0168
1 sync.lists.watchlist.mode C0
1 sync.ratings.mode 1
1 sync.collection.clean C2
1 sync.playback.mode 2
1 sync.library_update C3
1 sync.collection.mode 2
1 sync.watched.mode 2
1 sync.lists.liked.mode C0
1 sync.ratings.conflict 0
1 scrobble.enabled C3
1 sync.lists.personal.mode C0

OK, I still haven't gotten the scrobbler to scrobble anything (even after wiping the DB), but I did find a solution to the original question that did NOT require deleting the entire database:

  1. Open the DB file in something like DB Browser for SQLite, and open the table configuration.option.
  2. Select the value for the key api.enabled.
  3. Edit the value in Binary Mode from c2 to c0 (In DB Browser for SQLite, the Database Cell Editor is in the top right corner - switch the Mode to Binary, highlight the content in the field, which should be c2, and replace it with c0).
  4. Don't forget to write the changes to the DB!
  5. Voila, API re-enabled.