Unable to delete episode from Plex: file deleted, library scanned, trash is empty

Server Version#: 1.41.0.8994

Hi all, I’m trying to delete a tv show from plex but this time i’m unable to delete just one episode.

These are the steps that I always did for the past few years that always worked:

  1. Delete the file/s from the hard drive
  2. Scan Library (plex doesn’t have the option to automatically empty the trash after rescan)
  3. Check if all and only the deleted media are into the plex trash
  4. Empty trash

The problem here is that this show didn’t go automatically into the trash after deleting it from hard drive and rescanning plex.

After searching on the plex subreddit i decided to enable the option to delete media directly from plex to delete media. This way i was at least able to delete the entire show apart from just one episode.

When i try to delete it from plex it gives me the error “There was a problem deleting this item” while the log shows [Req#42a] Exception inside transaction (inside=1) (/home/runner/actions-runner/_work/plex-media-server/plex-media-server/Library/MetadataItem.cpp:856): Null value fetched and no indicator defined.

I also thought the database was corrupted but following plex website instruction (https://support.plex.tv/articles/repair-a-corrupted-database/) the integrity check gave me no issues.

Any clues?

That check is not reliable.
Repair the database anyway, using this GitHub - ChuckPa/PlexDBRepair: Database repair utility for Plex Media Server databases

Yes, it does. https://support.plex.tv/articles/200289526-library/

By chance, was this file the last remaining one on a particular drive or file share which was added to a Plex library? If it was, edit the library and remove that storage location from the library.
OR put some other file into it, a small .txt file would suffice.

I did it with automatic option, everything seems okay but the problem persist

I’m sorry i meant that the option is not enabled on my end.

No, there are still plenty of files in the same hard drive.

I tried to add the file again in the same path, now i can play the vide from plex but if i try to delete it from plex i still get the same error.

If it can help, trying to refresh metadata, it does nothing and the option become unavailable

After another library scan the show got the bin icon but the episode didn’t (even if it’s the only one episode for the show). The trash is empty but if i try to empty it i get the error “There was a problem emptying the trash” with the same log as above

Well I ended up fixing it by myself.

I opened the database with Plex SQLite editor and deleted all entries related to that episode across multiple tables.

I started looking for episode ID from metadata_items table and then went through media_items, media_streams and media_parts.

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