Plex not removing files like it used to

Server Version#: 4.138.0
Player Version#:

When I add a file, Plex scans for it and adds it no problem. But then if I remove that file, the poster is still there, but the file has been deleted. In the past, when I deleted a file Plex would scan and remove the poster. Now it is not doing it. I have tried manually scanning, and that doesn’t work either. How do I fix this?

Have you disabled Settings > [Server Name] > Library > Empty trash automatically after every scan?

I have. It does not matter if that setting is enabled or disabled. I still have the same issue.

While it’s disabled, Plex will keep the library records even if the files are gone (this can be useful if the drive could be slow to react when you trigger a scan).

In that case, the items should go away when you manually trigger the Empty Trash action of this library.

If the items remain there no matter what, you might want to take a look at your server logs for indicators of database corruption (mentions of sqlite issues or „database malformed“ statements).

I encountered the same issue after upgrading to 1.41.1.9057. In the previous version, if I removed files externally and didn’t enable the automatic emptying of the trash can, a trash can icon would appear on the corresponding poster. When I executed the empty trash can action, the trash can icon would disappear. If I deleted all content of the corresponding item, the entire poster would vanish.

Now, I’ve replaced some files and deleted some files for a TV show, and a trash can icon has appeared on the show poster. However, no matter how many times I refresh, scan, or empty the trash can, this trash can icon won’t disappear.

Plex will not emtpy the trash (either automatically or manually) under either of these 2 conditions:

  • the library has a storage location added which is not available. Either because the folder does no longer exist, or because the hard drive on which it was stored is either temporarily unplugged or has changed its drive letter (which can easily happen when unplugging to free up a USB port and temporarily inserting another drive). This can be prevented by assigning fixed drive letters.
    Edit the library, go to the “Add Folders” tab, and review all the paths listed in there. They must all still exist, be available and powered on, with sufficient access permissions for the Windows user account under which Plex server is running.
  • the server’s database file is corrupt. You need to repair it or restore a database backup.

In my case, my file locations are accessible, and the files can be played. I also checked the integrity of the database, and the results of “PRAGMA integrity_check;” show that both “com.plexapp.plugins.library.blobs.db” and “com.plexapp.plugins.library.db” are “OK,” indicating that the database is not corrupted.

So, I moved the TV show to a different location, scanned it out of the library, and then re-added it to the library. The problem was resolved, but I think there is a bug here.

This check is not able to detect all types of database damage. Use the linked .bat file to perform a thorough rebuild of both datebase files, if you want to be sure.

I see the .bat file, but can’t figure out how to download it from Github. How do I download it?

Update: I was able to download the .bat. Ran it, issue still persists.

I have gone under Settings > Manage > Libraries and emptied the trash manually from here, followed by a rescan and still no change.

Some people have mentioned having a trash can icon. I am not seeing this. My files look 100% normal in Plex, but they should not appear at all as they have been removed/deleted. If you were to try to play one of these files you would get a “Playback Error: Please check that the file exists and the necessary drive is mounted” message. If I open the the movie or episode the furthest Plex will allow, there is a red box marking the movie or episode as unavailable.

Please re-read my initial response above.

Look at the plex media info of an affected item. Compare the drive letter and folder name under which Plex expects the file to sit. Now look at the hard drives of your server machine. Is the whole drive letter missing? Then you’ll have to edit the library and remove any mentioning of that drive letter from the “Add Folders” tab.

No. That is not the issue. The drive is correct. The path is correct. That is where the file was, but now it is gone. My “paths” are not the problem. Plex seeing things that are no longer there is my problem.

I have been searching the logs using ctrl+f and using the keywords “sqlite” and “malformed” and nothing comes up.

Edit the library, go to the “Add Folders” tab, and review all the paths listed in there.

  1. They must all still be existing,
  2. be available and powered on,
  3. and must not be completely empty.

Verify points 1 and 3 in particular.

Shut down and restart Plex server, just in case there has been a change in drive availabilities after it has been started before.

Aha! Now that helped. So, there was an extra folder path listed there. I removed the extra folder path, cleared the trash and rescanned the library and all the extra files are gone.

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