I'm a happy Amarok user, using it for playing/browsing/querying my music collection, but this weekend I encountered a problem: Amarok didn't start anymore. When I launched Amarok (version 1.3.1, that is) from the command line I got the following error:

$> amarok
amaroK: [Loader] Starting amarokapp..
amaroK: [Loader] Don't run gdb, valgrind, etc. against this binary! Use amarokapp.
QLayout: Adding KToolBar/mainToolBar (child of QVBox/unnamed) to layout for PlaylistWindow/PlaylistWindow
kio (Scheduler): FATAL: BUG! _ScheduleJob(): No extraJobData for job!

I experimented with changing/deleting my Amarok settings in ~/.kde/share/apps/amarok and it became clear that there was some problem with collection.db. Deleting (after a backup of course) that file would solve the problem, but I did not want to lose the statistical information about my music collection in that file.

Another observation was the fact that Amarok did not crash if there was no internet connection, it only complained it could not contact some amazon server (for information about cd cover images, I presume). Consequently I assumed some amazon synchronisation/update job was the culprit for the crashing. This amazon thing was apparently triggered by some contents in collection.db, so I tried the following.

The file collection.db is a sqlite version 3 database file (the alternative is using a MySQL database, but that seems a bit overkill to me). I installed the sqlite3 command line client and made a SQL dump of the file as follows:

$> sqlite3 collection.db .dump > collection.sql

Next, I removed all the entries in the "amazon" table from the SQL file (with grep and its match inverting option "-v"):

$> grep -v 'INSERT INTO "amazon"' collection.sql > collection_edit.sql

Then I backed up my old collection.db file and imported the edited SQL in a new collection.db database file:

$> mv collection.db collection.db.backup
$> sqlite3 collection.db < collection_edit.sql

Now Amarok starts up again and I still have my collection/statistical data.