Items in library are disappearing -- even though files are still there?

I’ve got a very odd issue where my library (which is on my server and mounted via AutoFS) occasionally has items that disappear from the interface. There is still the correct Unwatched count on the poster or thumbnail but clicking into the TV source there will be no files (or sometimes only a single missing season.)

The weird part is that sometimes (but not always) the files will then return during a regular update, but the unwatched count will increase like they are completely new files that are being added. If I remove the source and then do an update, it will re-add the missing files and correctly update the unwatched count.

I’ve verified that it doesn’t appear that files are being deleted or modified by any external tool.

Example: In the below log there was originally only (2) files displayed from Search Party. Both were from Season 4 and Season 5 was missing. Unwatched count indicated 12. I watched one episode, unwatched count dropped to 11 but Season 5 was still missing. A few hours later, Season 5’s (10) episodes appeared again but Unwatched count increased to 21.

https://paste.osmc.tv/ofarugivab

The only two things I can think of is that cleanonupdate you have in your advancedsettings.xml is maybe removing some files for some reason periodically or else you have some corruption in your database. I’d suspect the former. I’d take that line out and see if your problem disappears.

That’s a great catch. The idea is that if I deleted files outside of OSMC I wanted them removed from the library but in practice that hasn’t worked perfectly either.

I’d gladly give up the current issue and have to manually remove if it was a fix. I’ll report back after a few days.

You shouldn’t have to manually remove the files, just manually kick off a clean library instead of running it automatic with the library update. The automatic seems a less reliable method for some reason. If your finding yourself have to run the clean library often it is possible to kick it off with the web interface or via jsonrpc to save yourself the hassle of digging through the settings menu on the box itself.