Bug 135286 - Collection had disappeared and cannot be restored with backup .db
Summary: Collection had disappeared and cannot be restored with backup .db
Status: RESOLVED INTENTIONAL
Alias: None
Product: amarok
Classification: Applications
Component: Collections/Local (show other bugs)
Version: 1.4.3
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-08 13:28 UTC by Frédéric COIFFIER
Modified: 2008-09-04 12:41 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frédéric COIFFIER 2006-10-08 13:28:00 UTC
Version:           1.4.3 (using KDE KDE 3.5.4)
Installed from:    Gentoo Packages
Compiler:          gcc (GCC) 4.1.1 (Gentoo 4.1.1) 
OS:                Linux

Today, when I launched Amarok (without any upgrade), the collection was empty and Amarok didn't try to rebuild it.
After stopping Amarok, I can see in ~/.kde/apps/amarok :
-rw-r--r--  1 fcoiffie users 5827584 oct  8 12:55 collection.db
So, I copy the 1 month older collection.db-... backup file (which is really smaller : 2Mb instead of 5.6Mb) to collection.db, but instead of using this file, Amarok has completely rebuilt the collection.

As the following command works :
sqlite3 collection.bak ".dump"
I think my 5.6Mb collection.db isn't corrupted.
Is there a way to restore the content of my collection.db file ?
Comment 1 Frédéric COIFFIER 2006-11-18 18:05:11 UTC
Is there a solution to this problem ? How a backup db can be restored ?
Comment 2 ermonnezza 2007-06-27 17:41:33 UTC
I kept losing the collection since I started using amarok, a few versions ago, and I could never find out why. I do have backups so knowing at least how to restore them would be really useful. Knowing why amarok sometimes looses the collection would be even better. Any ideas?
Comment 3 Mark Kretschmann 2007-06-27 18:03:43 UTC
All SQLite 3.3 versions contain a bug that can possibly lead to database corruption. See here:

http://www.sqlite.org/cvstrac/wiki?p=CorruptionFollowingBusyError

It's unclear whether this bug affects Amarok. Some users have never seen any problems with their collections, but sometimes we get reports like yours.

In SVN we have upgraded to SQLite 3.4.0, which fixes this problem. So you might want to check out SVN stable branch or wait for 1.4.7. But, as I said, I can't tell whether this is related to your problem or not.
Comment 4 Frédéric COIFFIER 2007-06-27 21:03:16 UTC
I think the bug in SQLite 3.3 causes a database corruption. But, in the problem I describe, the database seems not te be corrupted as I can dump its content.
I also tried to dump the content of the first file in a second new one but Amarok doesn't load the new database.

Nevertheless, the problem seems less frequent since 1.4.4.

Is there a way the check the collection load with the source code in gdb ? Which function should be checked ? 
Comment 5 richlv 2007-06-28 08:28:18 UTC
so basically the information is in the db, but collection is empty ?
what output do you have from 'dcop kded mediamanager fullList' when the collection is empty ?
Comment 6 Edward Hades 2008-06-16 16:45:08 UTC
Due to lack of reporter feedback, this bug is presumed fixed.

Thank you for your report, please return if you experience any bugs in the future.
Comment 7 Frédéric COIFFIER 2008-06-24 19:56:15 UTC
Problem not reproduced since I use ext3 instead of ReiserFS. I don't know if the problem can be linked...
Comment 8 Frédéric COIFFIER 2008-09-04 10:27:35 UTC
Problem reproduced with Amarok 1.4.10.
To reply to the previous question :

$ dcop kded mediamanager fullList

$

So, it returns nothing. And I confirm that the collection.db isn't corrupted as I'm able to dump it.
Comment 9 Seb Ruiz 2008-09-04 12:41:37 UTC
Amarok 1.4 development has closed as we have directed all activity towards Amarok 2. Closing this bug for this reason, sorry.