Bug 253062 - Database of 80,000+ images wiped out
Summary: Database of 80,000+ images wiped out
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Database-Albums (show other bugs)
Version: 1.2.0
Platform: Unlisted Binaries Linux
: NOR major
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-02 23:21 UTC by Claudio Piombetti
Modified: 2017-07-26 06:54 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.7.0


Attachments
Error message from Digikam regarding the schema updating process failure (771.72 KB, image/png)
2010-10-02 23:21 UTC, Claudio Piombetti
Details
.session-errors, 2010.10.07 (10.61 KB, application/octet-stream)
2010-10-07 11:23 UTC, Claudio Piombetti
Details
Digikam output (77.98 KB, text/plain)
2010-10-07 21:28 UTC, Claudio Piombetti
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Claudio Piombetti 2010-10-02 23:21:36 UTC
Created attachment 52179 [details]
Error message from Digikam regarding the schema updating process failure

Version:           1.2.0 (using KDE 4.4.5) 
OS:                Linux

After a crash, Digikam is left running as a zombie. Closing it and restarting it, my database is gone. 80,000 pics.

Reproducible: Sometimes

Steps to Reproduce:
1) apply a tag to 200-300 hundred pics (JPEGs and Nikon D300 RAW files);
2) wait. It will crash;
3) after the crash, close Digikam using Force Quit (unless the program died with an error message);
4) look at the system monitor, if Digikam is listed there as a zombie, kill it;
5) restart Digikam;
6) you will see an error message.

Actual Results:  
Error message:

The schema updating process from version 4 to 5 failed, caused by an error that we did not expect. You can try to discard your old database and start with an empty one. (In this case, please move the database files "digikam3.db" and "digikam4.db" from the directory "/home/claudio/Pictures"). More probably you will want to report this error to (blah blah).

Click OK on the error window. Digikam starts, and instead of showing my album's data structure, there is nothing, not one folder or image. All gone. 

Expected Results:  
Not to see my database wiped out for the umpteenth time in the last few weeks. I do not know what I am doing wrong, if anything, but this is beginning to cost me money and "face", since I have recommended Digikam on my websites.
Comment 1 caulier.gilles 2010-10-03 10:21:10 UTC
I recommend to update to 1.4.0 and try again.

Gilles Caulier
Comment 2 Claudio Piombetti 2010-10-03 14:06:18 UTC
Updated to 1.4.0. 
No improvement, the same error notification pops up.
Comment 3 Marcel Wiesweg 2010-10-04 15:29:42 UTC
Then please give us the backtrace and necessary information surrounding your crash
Comment 4 caulier.gilles 2010-10-06 15:48:25 UTC
Claudio,

Do you see comment #3 ?

Gilles Caulier
Comment 5 Claudio Piombetti 2010-10-07 11:04:26 UTC
Gilles,
Digikam still cannot access the database, still the same error notification, but Digikam does not crash anymore. I have not applied any changes to the program; however, the OS has downloaded its usual tons of updates via Update Manager.

This is what I get when I launch Digikam from the shell:

claudio@claudio-aspire-ubuntu:~$ digikam
QSqlDatabasePrivate::removeDatabase: connection 'ConnectionTest' is still in use, all queries will cease to work.
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
QMetaObject::invokeMethod: No such method KUniqueApplication::loadCommandLineOptionsForNewInstance()
kbuildsycoca4 running...
kbuildsycoca4(11343) KBuildSycoca::checkTimestamps: checking file timestamps
kbuildsycoca4(11343) KBuildSycoca::checkTimestamps: timestamps check ok
kbuildsycoca4(11343) kdemain: Emitting notifyDatabaseChanged ()
QMetaObject::invokeMethod: No such method KUniqueApplication::loadCommandLineOptionsForNewInstance()
params.c:OpenConfFile() - Unable to open configuration file "/home/claudio/.smb/smb.conf":
	No such file or directory
params.c:OpenConfFile() - Unable to open configuration file "/home/claudio/.smb/smb.conf.append":
	No such file or directory
Time elapsed: 254 ms
Model: Time elapsed: 346 ms
TextureColorizer: Time elapsed: 71 ms
Time elapsed: 3 ms
Model: Time elapsed: 29 ms
QSqlDatabasePrivate::removeDatabase: connection 'digikamDatabase-31947232' is still in use, all queries will cease to work.
claudio@claudio-aspire-ubuntu:~$ klauncher(11339)/kio (KLauncher): SlavePool: No communication with slave. 

QSqlDatabasePrivate::removeDatabase: connection 'digikamDatabase-9247856' is still in use, all queries will cease to work.
QSocketNotifier: Invalid socket 11 and type 'Read', disabling...
QSqlDatabasePrivate::removeDatabase: connection 'digikamDatabase-9247856' is still in use, all queries will cease to work.
QSqlDatabasePrivate::removeDatabase: connection 'digikamDatabase-9247856' is still in use, all queries will cease to work.
QSocketNotifier: Invalid socket 11 and type 'Read', disabling...
klauncher(11339)/kio (KLauncher): SlavePool: No communication with slave. 

klauncher(11339)/kio (KLauncher): SlavePool: No communication with slave. 

klauncher(11339)/kio (KLauncher): SlavePool: No communication with slave. 

klauncher(11339)/kio (KLauncher): SlavePool: No communication with slave. 

klauncher(11339)/kio (KLauncher): SlavePool: No communication with slave. 

klauncher(11339)/kio (KLauncher): SlavePool: No communication with slave. 

klauncher(11339)/kio (KLauncher): SlavePool: No communication with slave. 

klauncher(11339)/kio (KLauncher): SlavePool: No communication with slave. 

klauncher(11339)/kio (KLauncher): SlavePool: No communication with slave. 

klauncher(11339)/kio (KLauncher): SlavePool: No communication with slave. 

klauncher(11339)/kio (KLauncher): SlavePool: No communication with slave. 

klauncher(11339)/kio (KLauncher): SlavePool: No communication with slave. 

klauncher(11339)/kio (KLauncher): SlavePool: No communication with slave. 

klauncher(11339)/kio (KLauncher): SlavePool: No communication with slave. 

klauncher(11339)/kio (KLauncher): SlavePool: No communication with slave. 

typingToSeeIfThisShellIsStillAlive
typingToSeeIfThisShellIsStillAlive: command not found
claudio@claudio-aspire-ubuntu:~$
Comment 6 caulier.gilles 2010-10-07 11:08:05 UTC
It's typically an error from digiKam kioslave which crash outside digiKam (kioslaves are external process used to query database)

this problem can be due to a broken external dependencies for example.

look if you can see any error message relevant in your ~./.xsession-errors

Gilles Caulier
Comment 7 Claudio Piombetti 2010-10-07 11:23:35 UTC
Created attachment 52304 [details]
.session-errors, 2010.10.07

At lines 86-87 there are entries related to Digikam:

Window manager warning: Invalid WM_TRANSIENT_FOR window 0x5200004 specified for 0x520001c (digiKam).
Window manager warning: Invalid WM_TRANSIENT_FOR window 0x5200004 specified for 0x52001ce (digiKam).
Comment 8 caulier.gilles 2010-10-07 11:32:51 UTC
No this warnings message are not important there...

run kdebugdialog and set all digikam debug spaces, especially kioslave.

try also to set on all "kio (*)" (not kio_*). look all report on the console when you run digiKam

Gilles Caulier
Comment 9 Claudio Piombetti 2010-10-07 21:28:58 UTC
Created attachment 52323 [details]
Digikam output
Comment 10 caulier.gilles 2010-10-08 09:18:57 UTC
It's clear :

digikam(7905)/digikam (core) Digikam::DatabaseCoreBackend::execDBAction: Error while executing DBAction [ "CreateDB" ] Statement [ "CREATE TABLE AlbumRoots
                            (id INTEGER PRIMARY KEY,
                            label TEXT,
                            status INTEGER NOT NULL,
                            type INTEGER NOT NULL,
                            identifier TEXT,
                            specificPath TEXT,
                            UNIQUE(identifier, specificPath))" ]

Marcel, Why ???

Gilles
Comment 11 Marcel Wiesweg 2010-10-08 09:42:46 UTC
startUpdates: Have a database structure version  "0"

There is no such thing as a database version 0. The first digikam version writing this value, 0.8, wrote "1". 0.10 to 1.5 use version "5", 2.0 "6".

Following this broken information we make an attempt to create tables, which fails correctly because they already exist:
"table AlbumRoots already exists" "Unable to execute statement"
Comment 12 caulier.gilles 2010-11-24 09:13:00 UTC
digiKam 1.6.0 is out:

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

Please update and check if this entry still valid.

Thanks in advance

Gilles Caulier
Comment 13 Claudio Piombetti 2010-12-18 18:24:31 UTC
I tried to cause the error and the consequent database loss without success. I tagged about two hundreds images (JPEGs, 5Mb each), Digikam proceeded very slowly with the tagging; after about 20 minutes, its progress status ("Writing metadata to files. Please wait...") was stuck at 66% or 67%. Killed Digikam with the system monitor. Restarted, no database loss.

Good. This seems solved. Thank you! Shall I update the call status to Resolved / Fixed?
Comment 14 caulier.gilles 2017-07-26 06:54:32 UTC
This problem is relevant of digiKam KIO Slaves and all of these have been dropped in favor of a multi-threaded interface to query the database.