Kodi randomly clears the media database and/or settings

I have a HTPC running Kodi on Linux which works well. Every so often I test the setup using FreeBSD but after some time Kodi will randomly erase the media database and/or "forget" various settings.

Although I can restore from a ZFS snapshot this isn't really a viable solution for long-term use. Unfortunately I can't find anything online about this issue and I have no idea what causes it. I tried most recently with Kodi version 20 installed via pkg on FreeBSD-13.1-RELEASE yesterday and the issue still occurs.

Has anyone else experienced these problems with Kodi?
 
Don't enable updating the library when it starts. If it starts updating and it cannot find the files then it's going to remove them from the library. Are the files themselves perhaps on an SMB or NFS share? There should also be an option in Kodi to have it wait until the network is up. I've set all my Kodi players to use a central database, and I need that option to make sure Kodi waits until the network is active before doing anything.
 
Yes, media files are stored on a networked share. I've always disabled the Update library on startup option in order to prevent unwanted removals if the network is down.

To expand on my original post, the problem happened to occur shortly after the initial scan of the media library yesterday. I played a few files to test that all was fine (it was) and then the database suddenly erased. The media sources remained, but they have disappeared on previous occasions when this issue causes Kodi to restore all settings to default.
 
There might be something wrong with Kodi itself. I just noticed I'm missing most of my library and had to rescan everything. And I didn't even use Kodi on FreeBSD yet. Looks like something may have gone wrong after the last update. When Kodi is updated it creates a new database to migrate everything to. I'm going to need to check the database itself, see what the older versions had in the database and compare it with what's in the new one.
 
So, checked the databases themselves. MyVideos116 had everything, MyVideos119 started missing a bunch of TV shows and movies and the current MyVideos121 is pretty much a copy of 119. Somewhere during one of the Kodi upgrades things went missing. That might be the case for you too?

It's weird things went missing in my case. I have the library update completely turned off everywhere and only use one Kodi on a Windows machine to update it by manually triggering it. And I haven't done that in a really long time.
 
I've only tried Kodi from version 19.x onwards on FreeBSD. Perhaps this issue was introduced in the version 19 branch of Kodi. I'll see if I can obtain a debug log to submit to Github, but I don't think my family will tolerate this experiment for much longer.
 
I can recommend configuring a MySQL/MariaDB database for Kodi. The cool part about that is that I can watch something downstairs, stop it, then continue where it left off in the bedroom upstairs. And everything is synced up, so all the 'watched' markers are synced too. Only makes sense if you have multiple Kodi installs though. The effort isn't worth it for a single Kodi system.

You do need to have a completely separate MySQL/MariaDB though. The account Kodi uses to access the database needs quite a lot of privileges. So you really don't want to run any other databases on it.
 
I don't recal which KODI update it was, but there was one upgrade reletively recently that recommended starting from scratch because of database changes likely to corrupt or damage the media database if doing an in-place upgrade. There has also been changes to which default scrapers are used which may affect whether some movies or TV series are or are not scraped, eg TMDB scraper used as default for TV Shows now instead of TVDB.
 
Each time I've tested this HTPC with FreeBSD it's been a fresh install with a new media database. The best results so far were with Kodi v19.1 on FreeBSD-13.0-RELEASE; I had an entire week of use before Kodi spontaneously restored itself to factory defaults.

I've had to revert to using Linux on the HTPC as a means of maintaining the peace at home. I hope that a fellow user will be able to take this forward and file a bug report at some point.
 
Back
Top