Plex Server can't delete empty folders, even if I remove their path from library

Server Version#:1.32.0.6973
Player Version#:
Operating System: Windows 10 Pro 22H2

Hi,
I need some help to understand how to delete (or make them disappear) empty folders still visible when I browse my library.

The scenario:

I have a library with two paths added; they refer to two disk drives (and their folders). Y: and G: are their drive letters.

Yesterday I decided to remove “G:” from the library (it’s an external HDD drive with 10 folders; each folder contains some movies).

So, I removed its path from the library and then clicked “save”; Plex immediately started doing its update scan of the library.
After that, I emptied Plex trash and then I physically removed that external HDD (so the files it contains are absolutely unavailable, for Plex and for Windows).

Well, I expected not to see anything related to the contents of “G:” hard disk anymore, in Plex library…
But “G:” folders are still there (they are empty).

I tried to scan the entire library again, I tried to optimize it, I tried to restart Plex server, I tried to readd (and then remove again) the HDD path in the library.
But definitely I could not find a way to to make those empty folders disappear.

I remember that the same problem happened some years ago and I was forced to remove the entire library and readd it. But I don’t want to do it again, Removing everything can’t be the only solution to clean an handful of empty folders.

Why isn’t there simply a button, in Plex web interface, to delete these impossible-to-disappear folders? Or at least an easier and more logical solution that works…

Any idea?

Thank you

Did you remove the drive from the library it’s associated with?

Yes I did. Its path in the library was “G:” and I removed it.

Just ‘G’ not like g:\movies or something similar…

It was just G:\ (so it included all the contents of “G:” HDD: ten folders and their files)

This may or may not be the cause of the issue you’re seeing, but Plex historically has had problems when the library points to just a drive letter. It’s better to put your 10 folders into a folder, such as G:\Movies and point the library to G:\Movies.

Yes, it is an useful advice for next time I add something… but the current issue is not solved, for now (and I’ve just tried to add “G:\movies” path, only to test, with no folders inside “movies” folder. After Plex finishes scanning the library, those empty folders from yesterday are still there).

Check the health of your database file.

  1. activate debug logging (not ‘verbose’!)
  2. quit Plex Server
  3. wait 1 minute
  4. start Plex Server
  5. wait 5 minutes
  6. fetch log files and attach them here

Or inspect them yourself. Take a look at the Plex Media Server.log file and seek for messages about database corrupt or malformed.
If you find these, you may have to repair your database.
https://support.plex.tv/articles/repair-a-corrupted-database/

P.S: what do you mean when you speak of “folders”?

Thanks, I’ll try to check the database file too.

Folders… I mean directories/subdirectories.

Where in the Plex user interface are you expecting to see these?
Please make a screenshot.

“Cartelle” mean folders/subdirectories. This is the main page of the library.
So, these subdirectories (01 to 10) were in root directory of G: drive unit ("G:" was the path configured in Plex interface and pointing to them).
Each directory containing some movies.

(The other 48 directories are from Y:, another path, another disk drive that I want it to remain in the library).

So, currently the only path configured for this library points to Y:\ , since I removed the path to G:\ , but those 10 empty folders from "G:" still appear there, as well as the screenshot shows.

Additionally to checking the health of the database:
Please wait a week. Make sure your server is actually running during the scheduled server maintenance period.

Okay, then I’d better wait another week before performing other operations on the Plex Server/library, seeing what happens. After that I’ll check the database.

Please do the check immediately. The sooner such a fault is discovered, the better the chances of getting it fixed without data loss.

Okay, so I’ll do the check today, following your instructions (and without changing anything else in the library).

Database check done. I inspected “Plex Media Server.log”, no reference to corrupt or malformed database.

However I managed to make these empty folders disappear, not technically solving the issue but sort of “bypassing” it:
since I added the path to “G:” hard disk not long ago, I decided to recover an older copy of “com.plexapp.plugins.library.db” (created before adding that path) and I used it, replacing the newer one. It worked , I just had to take note of the changes in the section “continue watching”.

Then I did the library scan again (to update the media added to the other HDD “Y:” in the time interval between the two databases creation).
Everything is fine now.

So… since I could not find an actual solution to the issue (and I’m pretty sure this empty folders stuff would appear again), next time I want to add and then remove a path, I won’t add it to the existing library: I’ll create a new dedicated library, so, if something goes wrong, I can remove the whole library, without messing with the main one.

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