Server Version#:1.40.5.8897 on Fedora 40
Player Version#:
<If providing server logs please do NOT turn on verbose logging, only debug logging should be enabled>
For the past few days most of my TV Shows no longer appear, even after rescanning the library, but some of them still do. Nothing about the library has changed. It is correctly set up and configured in PMS, the media files are all there, and the file permissions have not changed. The Movie library doesn’t seem to be affected. I admit to having added the TV Shows menu several times recently (by mistake) and then removed all but one of the duplicated entries, so perhaps this has somehow confused the database, but there doesn’t seem to be a way to reset it to a known state.
If I rescan the library, the missing shows all appear one by one in the web interface, then one by one disappear again after showing a trashcan icon. What is going on?
No idea how to proceed. The current PMS version is 1.40.5.8897 on Fedora 40, fully updated but the problem was present in the previous version as well.
You could disable Settings > [Server Name] > Library > Automatically empty trash after every scan – that should avoid Plex dropping your library items (especially any manual edits you made); but it won’t solve the root cause why Plex thinks the files are gone in the first place. Server logs should show some hint of what’s going on.
To be clear, the media files are not actually deleted. They just disappear from the UI.
I’ve taken the server logs after a library scan, but now what?
One point: the media library doesn’t belong to the Plex user:group and has 0775 permissions, so PMS can’t actually delete anything. I don’t want to change that as long as this problem persists.
The logs should show the progress of the scan and why it’s removing certain items from the library. You could e.g. look for the title of a removed item.
For reference… the „automatically empty trash after scanning“ option won’t delete files. It’s only about removing library records in the server’s database (as in: if you don’t find the file, keep/don‘t keep the library record).
There can be a number of reasons why Plex cannot see a file, e.g. (but not limited to) the file is physically gone, drives are (temporarily) disconnected or the mount is otherwise lost, file permissions…
I completely uninstalled Plex (probably overkill, but who cares), deleted the entire database (everything under /var/lib/plexmediaserver (again, probably overkill), then reinstalled Plex, configured the library locations, and started up again.
And the problem is still there. All my Movie titles appear, and only a couple of TV Show titles do. However I then noticed that on visiting one of the shows it appears to have many more seasons than it should, and on diving further it turns out that it has a whole bunch of episodes belonging to other shows.
I stress that my actually media library has not changed (neither the files nor their titles), and file permissions allow reading by the ‘plex’ user. In other words, it looks very much like a database problem, even though the database has been regenerated from scratch.
What you are describing is typically caused by a wrong folder structure,
or by directing Plex to start scanning at the wrong level of that folder hierarchy.
Please show the actual file names, and the folder structure where those files live.
Find out where you pointed the Plex library by editing the library and switching to the “Add Folders” tab.
$ ls -l /storage/Media/TV\ Shows/
total 0
drwxr-xr-x. 1 poc poc 440 Feb 2 2023 Archive
drwxr-xr-x. 1 poc poc 628 Aug 11 11:58 Current
$ ls -l /storage/Media/TV\ Shows/Archive/
total 0
drwxrwxr-x. 1 poc poc 284 Aug 16 2020 ‘Babylon 5’
drwxrwxr-x. 1 poc poc 112 Aug 17 2017 ‘Buffy the Vampire Slayer (1997)’
drwxrwxr-x. 1 poc poc 108 May 6 2015 Cadfael
drwxrwxr-x. 1 poc poc 472 Nov 26 2016 Cracker
drwxrwxr-x. 1 poc poc 136 Dec 20 2010 Emma
drwxrwxr-x. 1 poc poc 736 Jun 7 2018 Firefly
drwxr-xr-x. 1 poc poc 192 Dec 26 2018 Frasier
drwxrwxr-x. 1 poc poc 216 Jun 12 2019 ‘Game of Thrones’
drwxrwxr-x. 1 poc poc 588 Jun 29 2015 ‘Jonathan Strange & Mr Norrell’
drwxrwxr-x. 1 poc poc 36 Jul 28 2014 ‘Noggin the Nog’
drwxrwxr-x. 1 poc poc 160 Sep 21 2015 Seinfeld
drwxrwxr-x. 1 poc poc 384 Dec 27 2010 ‘Sense and Sensibility’
drwxrwxr-x. 1 poc poc 140 Feb 3 2016 ‘The West Wing’
drwxrwxr-x. 1 poc poc 80 Jun 21 2015 ‘The Wire’
drwxrwxr-x. 1 poc poc 1676 Sep 1 2015 ‘War and Peace (1972)’
drwxrwxr-x. 1 poc poc 276 Feb 18 2016 ‘War and Peace (2016)’
$ ls -l /storage/Media/TV\ Shows/Current/
total 0
drwxr-xr-x. 1 poc poc 2034 Apr 6 2023 ‘Agatha Christies Marple’
drwxr-xr-x. 1 poc poc 892 Apr 2 12:21 ‘Big Mood’
drwxr-xr-x. 1 poc poc 2164 Nov 11 2023 ‘Bosch Legacy’
drwxr-xr-x. 1 poc poc 1378 Jul 9 20:58 ‘Colin From Accounts’
drwxr-xr-x. 1 poc poc 818 Oct 29 2023 ‘Dark Winds’
drwxr-xr-x. 1 poc poc 8250 Aug 24 12:22 ‘Father Brown’
drwxr-xr-x. 1 poc poc 1922 Feb 7 2023 Fringe
drwxr-xr-x. 1 poc poc 928 Aug 11 12:02 Granchester
drwxr-xr-x. 1 poc poc 1040 Aug 5 11:26 ‘House of The Dragon’
drwxr-xr-x. 1 poc poc 3964 Aug 10 18:41 KIlljoys
drwxr-xr-x. 1 poc poc 1418 Aug 26 12:36 ‘Miss Marple (1984-92) (Joan Hickson)’
drwxr-xr-x. 1 poc poc 26506 May 22 14:33 ‘Murder She Wrote’
drwxr-xr-x. 1 poc poc 4550 Jul 8 11:24 ‘My Life is Murder’
drwxr-xr-x. 1 poc poc 1100 Jun 16 19:38 ‘Pretty Hard Cases’
drwxr-xr-x. 1 poc poc 2012 May 22 12:59 ‘Save - Murder She Wrote’
drwxr-xr-x. 1 poc poc 9976 Mar 12 13:16 ‘Six Feet Under (2001)’
drwxr-xr-x. 1 poc poc 1616 Mar 15 18:40 ‘The Dry’
drwxr-xr-x. 1 poc poc 2516 Jul 16 2023 ‘The Great’
drwxr-xr-x. 1 poc poc 440 Feb 20 2024 ‘The Pacific’
drwxr-xr-x. 1 poc poc 2496 May 6 2023 ‘The Pallisers’
drwxr-xr-x. 1 poc poc 596 Jun 1 2022 ‘We Own This City’
I previously only had the top level (…/TV Shows) and added the two subfolders to see if it made any difference. It didn’t. Here’s one folder with files:
$ ls -l /storage/Media/TV\ Shows/Current/Dark\ Winds/
total 21319908
-rw-r–r–. 1 poc poc 813455902 Oct 29 2023 Dark.Winds.S01E01.mkv
-rw-r–r–. 1 poc poc 721247762 Oct 29 2023 Dark.Winds.S01E02.mkv
-rw-r–r–. 1 poc poc 736411924 Oct 29 2023 Dark.Winds.S01E03.mkv
-rw-r–r–. 1 poc poc 718775502 Oct 29 2023 Dark.Winds.S01E04.mkv
-rw-r–r–. 1 poc poc 716194492 Oct 29 2023 Dark.Winds.S01E05.mkv
-rw-r–r–. 1 poc poc 647171943 Oct 29 2023 Dark.Winds.S01E06.mkv
-rw-r–r–. 1 poc poc 2990558544 Oct 21 2023 Dark.Winds.S02E01.1080p.WEB.h264-EDITH.mkv
-rw-r–r–. 1 poc poc 2729156632 Oct 21 2023 Dark.Winds.S02E02.1080p.WEB.h264-EDITH.mkv
-rw-r–r–. 1 poc poc 2817778113 Oct 21 2023 Dark.Winds.S02E03.1080p.WEB.h264-EDITH.mkv
-rw-r–r–. 1 poc poc 2953322244 Oct 21 2023 ‘Dark.Winds.S02E04.1080p.WEB.h264-EDITH[eztv.re].mkv’
-rw-r–r–. 1 poc poc 2700214761 Oct 21 2023 ‘Dark.Winds.S02E05.1080p.WEB.H264-DiMEPiECE[eztv.re].mkv’
-rw-r–r–. 1 poc poc 3287272737 Oct 21 2023 ‘Dark.Winds.S02E06.1080p.WEB.h264-EDITH[eztv.re].mkv’
You will ned to add /storage/Media/TV\ Shows/Archive/
and /storage/Media/TV\ Shows/Current/
individually to the library.
Always add the release year of episode 1 in season 1 to the top folder name of a show.
(just as you did with “War and Peace”)
always use subfolders per season (even if the show only has one season)
exclude any optional info from the file name, or mark it as “to be ignored” by enclosing it in one pair of square brackets, i.e. instead of Dark.Winds.S02E06.1080p.WEB.h264-EDITH[eztv.re].mkv
use Dark.Winds.S02E06.[1080p.WEB.h264-EDITH-eztv.re].mkv
ensure that the user account under which Plex server is running has at least “read” privileges to the media files and folders.
After making the changes, you may have to perform the Plex Dance to make Plex forget the wrong matches of the files to the shows.
If this affects the whole library, it is probably faster to just delete the library and re-create it.
I decided to create two libraries for TV Shows, Current and Archived, and added them separately. That seems to have fixed the problem without me having to change anything else, at least as far as I can see.
What I don’t understand is why I never needed to do this before, unless an update to PMS has changed the way it scans the library.
That wouldn’t have been necessary. You can add more than one folder to a library, so you could have added both into one combined library.
You never did it right from the beginning. And the code is written to be forgiving of some mistakes. But newly added features of the new scanner and agent made it necessary, to cut some of the leeway.
Anyway, officially supported is only one way: the one documented in the above linked support article.
Having both folders in one library is exactly what I had before, and which always worked up until the current problem.
I’ll reorganise as you suggest, but if this is really the issue I think Plex could have communicated better the implications of upgrading. Including better release notes in the package would be one way (the release notes currently linked say nothing about having to be stricter in the media organisation).