Win Error deleting file Addons27.db causing crash in Kodi 17.2 (solved manually)
#1
Brick 
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!
Reply
#2
Bollocks... I should have read the first sticky thread, shouldn't I have Smile. Admins: Fee free to delete.
Reply
#3
Hello Attlanttizz,

Haha, yes it was quite a common problem and well known. But 10 points for diagnosing and finding the solution on your own. Smile

Enjoy Kodi.
My Signature
Links to : Official:Forum rules (wiki) | Official:Forum rules/Banned add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create Music Library (wiki) | HOW-TO:Create_Video_Library (wiki)  ||  Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply
#4
https://github.com/xbmc/xbmc/pull/12127 was supposed to fix the issue. I guess it has no chance to work on windows, because the db file is being locked by the OS.

EDIT: the file.Close() should be moved before CFile:Big Grinelete() (and also ensure the fh is closed if the file is not zero-length)
Reply
#5
(2017-05-24, 21:22)stefansaraev Wrote: https://github.com/xbmc/xbmc/pull/12127 was supposed to fix the issue. I guess it has no chance to work on windows, because the db file is being locked by the OS.

EDIT: the file.Close() should be moved before CFile:Big Grinelete() (and also ensure the fh is closed if the file is not zero-length)

Ha Ha, just saw your edit after coming to same conclusion (know next to nothing of C++ but it just seems like if you open a file you have to close it before trying to delete it).

scott s.
.
Reply
#6
This should have been fixed in 17.2 but sadly it persists. Bracing for impact.
Reply

Logout Mark Read Team Forum Stats Members Help
Error deleting file Addons27.db causing crash in Kodi 17.2 (solved manually)0