Kodi Community Forum

Full Version: frodo B1 - Music DB Cleanup fails
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am running frodo Beta 1 on ubuntu 12.10.

When I try to clean the music database it will run for about a minute, then I get a popup window with the message "Error cleaning songs". This is what I see at the end of the dubug log:
Code:
12:09:28 T:140607397746560   DEBUG: Mysql execute: delete from song where idSong in (33630,33833)
12:09:28 T:140607397746560   ERROR: SQL: Undefined MySQL error: Code (1142)
                                            Query: delete from song where idSong in (33630,33833)
12:09:28 T:140607397746560   ERROR: Exception in CMusicDatabase::CleanupSongsFromPaths()
12:09:28 T:140607397746560   DEBUG: Mysql rollback transaction
12:09:28 T:140607397746560   DEBUG: CAnnouncementManager - Announcement: OnCleanFinished from xbmc
12:09:28 T:140607397746560   DEBUG: GOT ANNOUNCEMENT, type: 32, from xbmc, message OnCleanFinished
12:09:28 T:140607397746560   DEBUG: ------ Window Init (DialogOK.xml) ------
12:09:28 T:140607397746560   DEBUG: ------ Window Deinit (Pointer.xml) ------
Any help is greatly appreciated.
I have the same issue with Frodo. My log:
Code:
15:02:18 T:5000   DEBUG: Mysql execute: delete from song where idSong in (23142,23143,23144,23145,23256,23257,23258,23259,23260,23261,23262,23263,23264,23265,23266)
15:02:18 T:5000   ERROR: SQL: Undefined MySQL error: Code (1436)
                                            Query: delete from song where idSong in (23142,23143,23144,23145,23256,23257,23258,23259,23260,23261,23262,23263,23264,23265,23266)
15:02:18 T:5000   ERROR: Exception in CMusicDatabase::CleanupSongsFromPaths()
15:02:18 T:5000   DEBUG: Mysql rollback transaction
15:02:18 T:5000   DEBUG: CAnnouncementManager - Announcement: OnCleanFinished from xbmc
15:02:18 T:5000   DEBUG: GOT ANNOUNCEMENT, type: 32, from xbmc, message OnCleanFinished
What I did was adding music to the library. I found that some ID-tags must be wrong so I edited these in another program.
I edited tags, filenames and moved the files to another folder.
I then updated the library. The old information was still there but the files were added a second time with the corrected information
Since the library update didn't remove the old files I tried the cleanup tool and after a while got the error message "Error cleaning songs".

As a test I copied one of the "ghost files" to it's original location and filename and updated the library. It was added a second time. I could verify that in the SQL database there was a new entry (with a new SongID) for it. I deleted the file and updated the library again. It stayed in the library.
It seems that some or all songs cannot be removed once the are added to the database and that the cleanup function is not working, at least not properly. The library update function might also be broken because it doesn't always (if ever) remove files from the library if the file no longer exists.
It looks like I may have fixed my problem last night. It is a little early to tell for sure.

As I was doing queries on the MyMusic30 database, I noticed at the end of the output for album.strArtists that sometimes I would see a letter U with the umlaut above it. I was running the default character set (I don't remember which one). As a test, I backed up the MyMusic30 database, then converted the database character set to utf8, based on google queries I did. The conversion did not take long and I don't seem to have lost any data. There are cautions online about the exact syntax to enter into the /etc/mysql/my.cnf. This file will ensure all future database creations use the utf8 character set. There was a change with the required configuration entries in mysql 5. I first input the old syntax and mysql refused to start..

I have restarted xbmc a few times and everything seems good now. The Clean Music Database is working too!

I have added the utf8 information to my notes for installing xbmc. I will make these edits to my.cnf before I install xbmc in the future.
Hi GodreyDanials,
I just checked my database but it is already utf8, at least it says "utf8_general_ci" so I am not too sure that's the problem. Maybe the conversion solved another problem as well.
I made some progress. My SQL database is running on a Synology NAS and I looked up the problematic songs. I tried to delete these records from the database directly through the MySQL portal and it refused to delete them also! I got an error message about an thread stack overrun and an error number: 1436. I had seen that same number in the XBMC log but there it says: undefined MySQL error.

Since I now had a specific error message I could use Google for a solution. I found I needed to increase the thread_stack value in the my.cnf.
I was able to solve the problem by increasing the thread_stack variable from 128K to 256K.
After that I could remove the files by using the clean library option in XBMC.

I don't know whether the problem lies with XBMC or with MySQL. It might be that XBMC uses queries that are unnecessarily heavy, else it might be a problem with MySQL. Maybe someone with some knowledge of SQL could explain what's going on.
Thanks for the tip on increasing the thread_stack variable. It resolved an issue I was running into where forcing a refresh on a TV Show would fail and leave a ghost entry in my library that could not be cleaned. XBMC was throwing what I assume to be the same thread stack overrun error you were seeing while trying to clean up the old episode info before performing the refresh.
This just saved my whole setup! Thank you. This needs to be on every wiki/forum related to the issue.
Wow! what a life saver - this problem even exists on mysql5.1 on OpenIndiana too. It has been driving me mad for ages.
Thanks, spent a lot of hours trying to solve this but this seems to do the trick!!
(2012-12-12, 06:42)redrock Wrote: [ -> ]Thanks for the tip on increasing the thread_stack variable. It resolved an issue I was running into where forcing a refresh on a TV Show would fail and leave a ghost entry in my library that could not be cleaned. XBMC was throwing what I assume to be the same thread stack overrun error you were seeing while trying to clean up the old episode info before performing the refresh.

Thank you! I had the same problem and I couldn't figure it out. I even opened a new thread. Now it is working!
OMG THANK YOU SOOOO MUCH, this fixed an error I was having with refreshing shows Big Grin