During Plex Server startup, I get a handful of these errors:
Sep 07, 2017 20:56:21.723 [0x2ae83ca00700] ERROR - LPE: unknown item 37126.
Sep 07, 2017 20:56:21.723 [0x2ae83ca00700] ERROR - Sync: failed to generate query for path library://bee3b98c-9470-41db-8406-dd25f30da6e9/item/%2Flibrary%2Fmetadata%2F37126 in sync item 18865339
Sep 07, 2017 20:56:21.723 [0x2ae83ca00700] ERROR - Sync: empty sync set, unable to update status for sync list 2611970, sync item 18865339
I’ve done Scan files, Analyze, Refresh metadata on all my libraries, but I’m not sure what else to try or what’s the issue.
I’m running Plex Media Server 1.8.4, and I’m running inside a docker container on unraid (perhaps I should have posted there, but those subforums don’t seem to get as much traffic, and felt Linux was still relevant).
I’ve attached all my logs, in debug (not verbose) mode. Any other suggestions would be greatly appreciated.
@ChuckPA said:
The database thinks you have something there.
Scan,
Empty Trash
Clean Bundles
Scan again.
If that doesn’t clear it up… delete the library (or whole container) and start again.
If I delete the library, will I lose ‘watched’ status of the shows (you know, when I re-add the libraries later)? What would be the correct way to retain watched status?
Hello,
Just had the same issue. What I did is just renaming the folder containing the broken files (for me it was GoT episode) then rescan (auto scan also worked fine)
Sometimes Sync jobs get orphaned between the client app and PMS.
This will happen if the phone/tablet app was uninstalled and reinstalled (like when you get a new device)
Deleting the sync jobs which are no longer needed / already done will also clean this up.
It’s just a housekeeping duty. (I wish PMS could do it but PMS doesn’t know what the device has without it sync’ing again which can’t happen if the device’s previous incarnation doesn’t exist anymore)
Btw I did find out which files could be causing the issue but it took more of a deep dive into the actual dump file in the ...\AppData\Local\Plex Media Server\Plug-in Support\Databases folder. I am posting it here as it might be helpful.
Going into the actual file with VSCode, when I used the sync item I got from the Plex Media Server.1.log of 30494092 and searched for it in dump:
Trouble is, I removed that from my library some time ago. Thinking that perhaps the db was corrupted, I went through the steps on repairing a corrupt database but that did not help.
@ChuckPa,
Are there any SQL I can perform with SQLLite which will allow me to trim out these entries? Would it be safe to just remove them manually from dump file and replace the com.plexapp.plugins.library with the dump file doing:
sqlite3 com.plexapp.plugins.library.db < dump.sql
The reason I ask is that I did notice also in the dump entry that there are a lot of INSERT INTO statements which could make it tricky just removing those lines.
I have installed the DB Browser for SQLite and there is a lot of interesting info…I see test user accounts that I deleted a long time ago that are still in the tables, device entries for devices I have not had in years (and do not show up in PMS), and lots of other things from years ago with lots of empty or NULL values.
Reminds me of the mess that is my garage
Since everything is backed up time to get the scalpel and the sledgehammer and see which one works the best
this will make it easier to see which table(s) the missing id was put into
Using Agent Ransack, search the dump for the specific entry of the id found in the logs (e.g. 20888)
there should be a lot of INSERT SQL statements about which tables were used
Open the DB Browser for SQLite and open the com.plexapp.plugins.library under
C:\Users\<user>\AppData\Local\Plex Media Server\Plug-in Support\Databases
Select the Browse Data tab
Use the drop down to select the table
Since the dump file referenced play_queue_generators I opened it up and filtered the various columns using 20888…eventually the URI column had an entry which matched the library path of the error
[2724] ERROR - Sync: failed to generate query for path library://4b7036c9-fd1c-475b-8b1f-f82a2d00b73f/item/%2Flibrary%2Fmetadata%2F20888 in sync item 30494092
In the same row there was an id of 17092
Searching the dump file again, id 17092 corresponded to the metadata_item_accounts table
In that table, 17092 corresponded to an account id of a home user I manage
In PMS, I logged in with the user, went to the sync area and spotted the corresponding sync item which had an error icon by it (since that item was removed from the server a long time back and the user did not clean up their sync items from their device)
After removing the bad sync item, going through another round of scans the error is then gone
Thanks @Stormdragon for the details; using those infos, I was able to find the culprit user using a few SQL commands, on the com.plexapp.plugins.library.db sqlite3 database:
My error was: ERROR - LPE: unknown item 209513.
$ sqlite3 Library/Application Support/Plex Media Server/Plug-in\ Support/Databases/com.plexapp.plugins.library.db
SQLite version 3.27.2 2019-02-25 16:06:06
Enter ".help" for usage hints.
sqlite> -- Find the playlist ID:
sqlite> SELECT playlist_id FROM play_queue_generators WHERE uri LIKE '%209513';
213218
sqlite> -- How owns the playlist:
sqlite> SELECT account_id FROM metadata_item_accounts WHERE metadata_item_id = 213218;
22035366
sqlite> -- Who's that user:
sqlite> SELECT name FROM accounts WHERE id = 22035366;
BobTheBuilder
sqlite> .quit