Error deleting file Addons27.db causing crash in Kodi 17.2 (solved manually)

Hi all,

First off: thanks for Kodi guys! Wonderful product!

The story. I installed Kodi 17.1 a while ago and it crashed at startup. It didn’t even show anything, it went straight to the crash dialog. I didn’t find a way to directly solve it so I went back to my 16.x installation (that still worked). But now with the recent news of possible hacking of Kodi with tweaked subtitles, I decided to give 17.2 a try. Same problem, straight up crash, directly to crash dialog.

I enabled debugging output by making an advancedsettings.xml in the userdata folder, everything enabled. I saw that Kodi has a problem with the file Addons27.db. You can see this in the log file here: https://pastebin.com/zX2Vk9yB. In short it first warns that the file is empty, then errors trying to delete the file, then errors on querying the database as it’s empty. I checked for the file at that location and indeed it’s empty (0 bytes).

I decided to rename the file (added an underscore, like this: Addons27.db_) thinking that Kodi might have a better chance and indeed it did. Kodi now starts up without crashing. The Addons27.db file was recreated and is now non-empty. It’s weird that Kodi cannot delete the file while I can rename it and delete it. I did not have another process (like another Kodi version) that was running at that time, so I don’t think the file was locked or anything.

Perhaps it’s an interaction with the previous installations I had? I can’t say. The log file doesn’t reveal something like that.

For completeness sake, some more info:
* Kodi 17.2 (same problem with 17.1)
* Windows 8.1 Pro (version 6.3, build 9600)
* 64 bit
* 16 Gb RAM
* Detailed sysinfo: https://pastebin.com/Fa1p02Kx
* Reproduce: I had a previous installation of 16.? and before that probably 15.? with several popular addons. Installed first 17.1, uninstalled when it crashed, then installed 17.2 (which still crashed). I have two other Addon.db’s in %AppData%\Roaming\Kodi\userdata\Database: Addons19.db and Addons20.db. Perhaps these are from previous versions and caused a problem?
* Debug log: https://pastebin.com/zX2Vk9yB

Hope this can help to make Kodi even better. Cheers!