Thanks got it!
I’ve tracked down the exact bug causing your issue, I’ve already pushed a fix internally but don’t yet know which release this will be in.
It’s easy to fix though by making a single database query, if you’re comfortable doing that.
The instructions for using the SQLite database command are here: https://support.plex.tv/articles/repair-a-corrupted-database/#toc-1 (You don’t need to run any of the recovery commands here, and only need to run the one below).
Any time you work with the database just make sure that PMS is shut down first.
Then using the instructions above, open your database the SQLite command linked above and run the following query:
delete from metadata_items where library_section_id = -4 and guid = '';
Then just call:
.quit
And start the server up again. The clean up operation that was locking up the database should not complete successfully.