Bug 409686

Summary: Digikam hits database deadlock on start with gelocation query
Product: [Applications] digikam Reporter: Alain Knaff <kde>
Component: Database-ScanAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: major CC: caulier.gilles, metzpinguin
Priority: NOR    
Version: 5.9.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 6.2.0
Sentry Crash Report:

Description Alain Knaff 2019-07-10 13:52:59 UTC
SUMMARY
When digikam is started, it freezes for 10 seconds, and then says that it could not execute a database query about geolocation

STEPS TO REPRODUCE
1. Start digikam

OBSERVED RESULT

The following is printed to STDERR, all the while the UI is unresponsive for 10 seconds:

digikam.geoiface: ----
digikam.general: Cancel Main Thread
digikam.general: Cancel Main Thread
digikam.geoiface: "setting backend marble"
QFSFileEngine::open: No file name specified
digikam.geoiface: "ROADMAP"
digikam.geoiface: "setting backend marble"
digikam.facesengine: Face database ready for use
digikam.general: Face PipeLine: add database writer
digikam.general: Face PipeLine: add faces trainer
digikam.facesengine: Face database ready for use
digikam.general: Face PipeLine: add database writer
digikam.general: Face PipeLine: add faces trainer
digikam.geoiface: "setting backend marble"
QFSFileEngine::open: No file name specified
digikam.geoiface: "ROADMAP"
digikam.geoiface: "ROADMAP"
digikam.general: scan mode: ScanDeferredFiles
digikam.general: total scan value :  373261
digikam.dbengine: Database is locked. Waited 0
digikam.dbengine: Database is locked. Waited 250
digikam.dbengine: Database is locked. Waited 500
digikam.dbengine: Database is locked. Waited 750
digikam.dbengine: Database is locked. Waited 1000
digikam.dbengine: Database is locked. Waited 1250
digikam.dbengine: Database is locked. Waited 1500
digikam.dbengine: Database is locked. Waited 1750
digikam.dbengine: Database is locked. Waited 2000
digikam.dbengine: Database is locked. Waited 2250
digikam.dbengine: Database is locked. Waited 2500
digikam.dbengine: Database is locked. Waited 2750
digikam.dbengine: Database is locked. Waited 3000
digikam.dbengine: Database is locked. Waited 3250
digikam.dbengine: Database is locked. Waited 3500
digikam.dbengine: Database is locked. Waited 3750
digikam.dbengine: Database is locked. Waited 4000
digikam.dbengine: Database is locked. Waited 4250
digikam.dbengine: Database is locked. Waited 4500
digikam.dbengine: Database is locked. Waited 4750
digikam.dbengine: Database is locked. Waited 5000
digikam.dbengine: Database is locked. Waited 5250
digikam.dbengine: Database is locked. Waited 5500
digikam.dbengine: Database is locked. Waited 5750
digikam.dbengine: Database is locked. Waited 6000
digikam.dbengine: Database is locked. Waited 6250
digikam.dbengine: Database is locked. Waited 6500
digikam.dbengine: Database is locked. Waited 6750
digikam.dbengine: Database is locked. Waited 7000
digikam.dbengine: Database is locked. Waited 7250
digikam.dbengine: Database is locked. Waited 7500
digikam.dbengine: Database is locked. Waited 7750
digikam.dbengine: Database is locked. Waited 8000
digikam.dbengine: Database is locked. Waited 8250
digikam.dbengine: Database is locked. Waited 8500
digikam.dbengine: Database is locked. Waited 8750
digikam.dbengine: Database is locked. Waited 9000
digikam.dbengine: Database is locked. Waited 9250
digikam.dbengine: Database is locked. Waited 9500
digikam.dbengine: Database is locked. Waited 9750
digikam.dbengine: Database is locked. Waited 10000
digikam.dbengine: Detected locked database file. There is an active transaction. Waited but giving up now.
digikam.dbengine: Failure executing query:
 "SELECT latitude, latitudeNumber, longitude, longitudeNumber, altitude, orientation, tilt, roll, accuracy, description FROM ImagePositions WHERE imageid=:a;" 
Error messages: "Unable to fetch row" "database table is locked: ImagePositions" 6 1 
Bound values:  (QVariant(qlonglong, 275510))


EXPECTED RESULT
Digikam should not freeze. A database query should not take that long, especially for a feature which is only of interest to a minority of users.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
I do not have any need for geolocation. How can I switch it off easily?
Comment 1 caulier.gilles 2019-07-10 14:05:39 UTC
5.9.0 is an older version. This problem have been already seen in the past. Please test with last stable release 6.1.0 using Linux AppImage bundle that we provide in project download area.

Gilles Caulier
Comment 2 Maik Qualmann 2019-07-10 17:48:20 UTC
This issue is definitely resolved in later versions of digiKam. While the initial file scan was running, the database with the same information was polled and blocked extremely often in the loop. I close the bug.

Another note: The "new" Debian 10 does not use a current version of digiKam. See also your other error, which was reported a year ago and has long since been corrected.

Maik