LPE: unknown item XXXXX sync empty set errors in log

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.

Thanks!

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.

1 Like

@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?

This is the procedure. “Watched” status is “ViewState”

https://support.plex.tv/hc/en-us/articles/201154527-Move-Viewstate-Ratings-from-One-Install-to-Another

thanks, I had that page up, but wasn’t sure if that process would in turn carry whatever issue I have; I’ll mess with it later; thanks!

Did you ever manage to fix this? Did recreating the library stop the error? I have been getting the same error

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)

No need to destroy your db :slight_smile:

Any tip on how to find you which items/episodes that are generating errors? I can only see an ID in the console.

  1. Rescan all the library sections
  2. Empty Trash
  3. Clean Bundles
  4. Clean out all the obsolete Sync jobs.

I was curious about this as well. I have searched the entire logs and I cannot see a reference to what the specific id relates to.

Is there another way to find out exactly the item having the issue?

Also, how to do this?

Is it only a matter of going to the Sync area and clicked on the refresh button and get the green pop up that states “Synced Items were refreshed”?

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:

library://4b7036c9-fd1c-475b-8b1f-f82a2d00b73f/item/%2Flibrary%2Fmetadata%2F20888 Ü2019-11-23 14:22:402019-11-23 14:22:40B©<bp%3Asettings=%3FadvancedSubtitles%3Dburn%26autoAdjustQuality%3D0%26directPlay%3D1%26directStream%3D1%26directStreamAudio%3D1%26musicBitrate%3D192%26photoQuality%3D74%26photoResolution%3D1920x1080%26subtitles%3Dauto%26videoBitrate%3D4000%26videoQuality%3D99%26videoResolution%3D1280x720&bp%3Atitle=The%20Meg&bp%3Atype=1&sy%3Ascope=0&sy%3AsyncItemID=30494092&sy%3AsyncListID=23832759e

From that I spotted the title entry of The Meg.

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.

1 Like

If you understand the schema, you can remove the items from the different tables.

I’ve seen the schema and I don’t understand all the nuances.

Thanks @ChuckPa

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 :stuck_out_tongue_winking_eye:

Since everything is backed up time to get the scalpel and the sledgehammer and see which one works the best :smile:

I was able to find and correct the LPE issue and wanted to share the steps I took so that others might unblock themselves.

Prerequisits

  • Agent Ransack (or any other file content reader)
    • I used this because I was initially analyzing multiple files and directories…editors like VSCode would work fine for looking at just the dump file
  • SQLite
  • DB Browser for SQLite
  • various SQL from Repair a Corrupt Database | Plex Support
    • mainly to create the dump file and a backup of the Plex db

Caveats

  • I suspect this might be completely unsupported :wink:
  • this was done with Windows 10 even though the steps should be universal outside of the OS-specific paths and apps used
  • this is not for altering the Plex db but doing some investigation/reading
  • this is a black box approach as I have no previous knowledge of the inner Plex db workings (so it’s probable there is an easier way to do this)
  • make a back up first (as per Repair a Corrupt Database | Plex Support)
  • the following steps were what I used to find a specific entry and cross reference it…for the following example I use
   [18704] ERROR - LPE: unknown item 20888

Steps

  1. Get information on the LPE issue, specifically the id it cannot find (e.g. 20888)…there are two ways to do this
  • in PMS, go to Settings > Console and look for it in the logs when an action happens (i.e. adding/removing something from a library)
    • note the page is really slow to refresh and show any info
  • in PMS, go to Settings > Troubleshooting and select to download the logs
    • once downloaded and unzipped, open the Plex Media Server.log and find the unknown item id
  1. Create the dump file from Repair a Corrupt Database | Plex Support
  • this will make it easier to see which table(s) the missing id was put into
  1. 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
  1. 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
  1. Select the Browse Data tab
  2. Use the drop down to select the table
  3. 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
  1. In the same row there was an id of 17092
  2. Searching the dump file again, id 17092 corresponded to the metadata_item_accounts table
  3. In that table, 17092 corresponded to an account id of a home user I manage
  4. 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)
  5. After removing the bad sync item, going through another round of scans the error is then gone

I hope this helps :smiley:

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

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.