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
dumpfile
- I used this because I was initially analyzing multiple files and directories…editors like VSCode would work fine for looking at just the
- SQLite
- DB Browser for SQLite
- various SQL from Repair a Corrupt Database | Plex Support
- mainly to create the
dumpfile and a backup of the Plex db
- mainly to create the
Caveats
- I suspect this might be completely unsupported
- 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
- 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
- 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
- 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.libraryunder
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_generatorsI opened it up and filtered the various columns using20888…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_accountstable - 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
I hope this helps 