Bug 192374 - Severe Album and Images table corruption
Summary: Severe Album and Images table corruption
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Database-Albums (show other bugs)
Version: 0.10.0
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-11 22:57 UTC by Alphazo
Modified: 2017-07-19 13:59 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.0.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alphazo 2009-05-11 22:57:02 UTC
Version:           0.10.0-1ubuntu3 (using KDE 4.2.1)
OS:                Linux
Installed from:    Ubuntu Packages

I recently moved my pictures from iMatch to Digikam 0.10.0-1ubuntu3 (Ubuntu 9.04 Jaunty).

My digikam4.db is about 11MB and contains the following items:

- 1 albumroot
- 444 albums
- 15323 images (tiff, jpg, dng) with built-in tags
- 242 tags
- 574 tagtree items

I was adding some tags to some of the pictures when Digikam crashed. However this time when I restarted it back the library was empty...and I felt very bad!
I looked at the database content using an SQLite browser and found out that all the pictures data have been corrupted in a snap.

Here is the result of my investigation.

** AlbumRoots Table **
"id","label","status","type","identifier","specificPath"
"1","ORIGINALS-DNG","0","1","volumeid:?uuid=DCA8EED3A8EEAB6A","/PHOTOS/ORIGINALS-DNG"

--> No problem on this one.


** Albums table **
"id","albumRoot","relativePath","date","caption","collection","icon"
"1","0","1-/","2009-03-01","","",""
"2","0","1-/1999-12","2009-01-14","","",""
"3","0","1-/1999-12/Scans","2009-04-24","","",""
"4","0","1-/2000-10","2008-07-15","","",""
"5","0","1-/2000-10/Fly_Surf","2009-04-25","","",""
"6","0","1-/2000-10/Le_Luc","2009-04-24","","",""
...
--> "albumRoot" column is corrupted (all rows)... it should be "1" not "0"
--> "relativePath" is corrupted (all rows)... i.e. "1-/1999-12/Scan" should be "/1999-12/Scan"


** Images table **
"id","album","name","status","category","modificationDate","fileSize","uniqueHash"
"1","","1999-12_955_Noir.tif","3","1","2007-01-12T02:58:41","4328652","eaee50804f7ddfe244eebf2385c43a19"
"2","","1999-12_955_Rouge.tif","3","1","2007-01-12T02:58:43","4387788","8334c19a77cd95f56d7bebac262c5383"
"3","","1999-12_Bebe.tif","3","1","2009-04-25T22:46:20","5428320","4967c779c5f9fb63fcbf9e79c34ee07c"

--> "album" number has been wiped out for each image... how can this be recovered besides reimporting the pictures?
--> "status" column is corrupted (all rows)...it should be "1" and not "3"


 Restoring some of the table to their original content almost fixed the problem however the image table is still missing links to albums. I rescanned the album and the pictures appeared again but then the database needed some cleaning still contains orphaned entries.

I'm now so scared to use DigiKam again. Is there any way to have at least an automatic backup of the database?

I'm sorry but I don't have any backtrace to show, only the corrupted database. 
Thank you
Dany
Comment 1 caulier.gilles 2009-06-19 13:01:53 UTC
Can you try with digiKam 1.0.0-beta1

Gilles Caulier
Comment 2 Alphazo 2009-06-21 10:22:31 UTC
I would be glad to test this out. However I don't want to break my system with all the KDE dependencies.

Is there an easy way to install this beta under Ubuntu Jaunty?

Thank you
Dany
Comment 3 Marcel Wiesweg 2009-06-21 10:40:21 UTC
This is no random corruption. You had a collection scanner running while it thought for whatever reason that no images are left. All images are marked as removed and all albums are orphaned.
The question is if you can reconstruct the situation. In any case, without manual intervention you lose your album thumbnails but no information assigned to images.
Comment 4 Alphazo 2009-06-21 10:47:20 UTC
Found a repo for the beta1 over there : http://philip.magicalforest.se/

I'll give it a try however for this specific bug it might difficult to duplicate.
Comment 5 caulier.gilles 2009-12-25 20:07:03 UTC
digiKam 1.0.0 is out since few days...

http://www.digikam.org/drupal/node/491

Please try with this version coming with more than 400 bug-fixes.

Thanks in advance

Gilles Caulier
Comment 6 caulier.gilles 2010-01-25 21:47:34 UTC
digiKam 1.1. release will be done in few days. Please check if this entry still valid.

Thanks in advance

Gilles Caulier
Comment 7 caulier.gilles 2010-04-04 10:42:20 UTC
digiKam and Kipi-plugins 1.2.0 are out. Please check if crash is still valid there.

Thanks in advance

Gilles Caulier
Comment 8 caulier.gilles 2010-10-06 11:54:15 UTC
We need feedback with digiKam 1.4.0

Gilles Caulier
Comment 9 caulier.gilles 2015-07-04 06:04:32 UTC
New digiKam 4.11.0 is available.

https://www.digikam.org/node/740

Can you reproduce the problem with this release ?
Comment 10 caulier.gilles 2016-07-02 15:42:40 UTC
With 5.0.0, the crash is not reproducible anymore.

I close this file now. Don't hesitate to re-open if necessary.

Gilles Caulier