[SOLVED] Lost Kodi settings after crash

After Kodi crashed (OSMC still was running and I rebooted via SSH) I lost all the Kodi Settings (e.g. webserver, airplay,… wasn’t configured anymore).

I will reconfigure everything as I need it I am just wondering if with this I might have also lost any OSMC specific configuration of Kodi that I might not configure correctly.

Besides the fact that I don’t have an idea how a crash of Kodi and a clean reboot can lead to that situation.

If Kodi crashes in such a way that guisettings.xml is corrupted on next start Kodi will detect it is corrupted and throw it away generating a new, default guisettings.xml.

This is normal Kodi behaviour if a corrupt file is detected on start. So Kodi must have been writing to guisettings.xml at the time it crashed.

Hi @DBMandrake,

thanks for the info, I was just stopping watching a movie at the time of the crash, so would wonder why he was writting to the guisettings.xml.
But from what you are writting only my personal guisettings.xml in the userdata directory should be affected so no OSMC specific setting are lost, or?

Cheers

Fred

guisettings.xml only contains the settings that are under the settings menu in Kodi.

Libraries, file sources, skin preferences, addon data and so on are all stored elsewhere so won’t be affected.

Unfortunately kodi writes to guisettings.xml fairly frequently even when you are not actively changing system settings - this is because there is some data like total system uptime (which you can see in system information) which gets periodically updated and written back to guisettings.xml. So if it crashes while that happens it can corrupt the file. In a way guisettings.xml has the same problems as the windows registry in that it is prone to corruption because it gets written to so frequently.

This is a known design flaw of Kodi and while there has been some discussion of what to do about it by Kodi devs thus far the situtation remains. Fortunately not too many settings are lost on the rare occasion that this happens, and we will also be providing a way of backing up guisettings.xml in the backup function. (Not quite working properly yet but will be very soon)

What I do is actually manually taking a backup of the working guisettings.xml file, and put it into the same directory as guidsettings.xml_working. If Kodi breaks the currently active file, i just restore from the working one.
It could also be automated to be copied in place on every start.