Bug 387958

Summary: Core database: cannot process schema initialization (uprade from 5.7)
Product: [Applications] digikam Reporter: Lukas Winkler <kde>
Component: Database-MysqlAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles, kde, metzpinguin
Priority: NOR    
Version: 5.8.0   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In: 5.8.0
Sentry Crash Report:

Description Lukas Winkler 2017-12-16 13:34:29 UTC
(Maybe similar to Bug 379987)

Hi,

When I tried to use the latest testing AppImage to check if Bug 374302 is fixed, Digikam fails to start with the error message "Core database: cannot process schema initialization" on the console and a window pointing out that Digikam "Failed to update the database schema from version 8 to version 9".

Unfortunatly I don't know how to start digikam with a more verbose log. "debug" only seems to start gdb, which doesn't help here.

An nearly empty database from my old testing opgraded without issues.
Comment 1 Maik Qualmann 2017-12-16 13:41:19 UTC
Can you please post the complete output of the console? MySQL or MariaDB? External or internal server?

Maik
Comment 2 Lukas Winkler 2017-12-16 13:43:28 UTC
Ah, sorry. I forgot to post it:

➜  ~/tmp /opt/digikam-5.8.0-20171212T132305-x86-64.appimage    
-- digiKam AppImage Bundle
-- Use 'help' as CLI argument to know all available options
digikam.coredb: Core database: cannot process schema initialization
QThreadStorage: Thread 0x7f3f1d699580 exited after QThreadStorage 11 destroyed


I am using an external MariaDB Server (the one of Debian Testing):
mysql  Ver 15.1 Distrib 10.1.29-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
Comment 3 Maik Qualmann 2017-12-16 15:48:19 UTC
I can not reproduce the problem, the schema update does not seem to have started yet. Can you post the contents of the "Settings table of the database?

mysql -u USERNAME -p

USE DIGIKAM-CORE-DB-NAME

SELECT * FROM Settings;

Maik
Comment 4 Lukas Winkler 2017-12-16 15:50:47 UTC
MariaDB [digikam]> SELECT * FROM Settings;
+--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| keyword                        | value                                                                                                                                                                                                                                       |
+--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| preAlpha010Update1             | true                                                                                                                                                                                                                                        |
| preAlpha010Update2             | true                                                                                                                                                                                                                                        |
| preAlpha010Update3             | true                                                                                                                                                                                                                                        |
| beta010Update1                 | true                                                                                                                                                                                                                                        |
| beta010Update2                 | true                                                                                                                                                                                                                                        |
| uniqueHashVersion              | 2                                                                                                                                                                                                                                           |
| databaseImageFormats           | jpg;jpeg;jpe;jp2;j2k;jpx;jpc;pgx;tif;tiff;png;gif;xpm;ppm;pnm;pgf;bmp;xcf;pcx;webp;bay;bmq;cr2;crw;cs1;dc2;dcr;dng;erf;fff;hdr;k25;kdc;mdc;mos;mrw;nef;orf;pef;pxn;raf;raw;rdc;sr2;srf;x3f;arw;3fr;cine;ia;kc2;mef;nrw;qtk;rw2;sti;rwl;srw; |
| databaseVideoFormats           | mpeg;mpg;mpo;mpe;mts;vob;avi;divx;wmv;wmf;asf;mp4;3gp;mov;3g2;m4v;m2v;mkv;webm;mng                                                                                                                                                          |
| databaseAudioFormats           | ogg;mp3;wma;wav                                                                                                                                                                                                                             |
| FilterSettingsVersion          | 6                                                                                                                                                                                                                                           |
| DcrawFilterSettingsVersion     | 4                                                                                                                                                                                                                                           |
| DBVersion                      | 8                                                                                                                                                                                                                                           |
| DBVersionRequired              | 8                                                                                                                                                                                                                                           |
| databaseUUID                   | {4f52e9e3-b639-4e37-8b03-f55848423215}                                                                                                                                                                                                      |
| Locale                         | UTF-8                                                                                                                                                                                                                                       |
| DeleteRemovedCompleteScanCount | 4                                                                                                                                                                                                                                           |
| Scanned                        | 2017-12-16T14:39:03                                                                                                                                                                                                                         |
| databaseUserImageFormats       | NULL                                                                                                                                                                                                                                        |
| databaseUserVideoFormats       | NULL                                                                                                                                                                                                                                        |
| databaseUserAudioFormats       | NULL                                                                                                                                                                                                                                        |
| RemovedItemsTime               | 2017-12-16T14:14:28                                                                                                                                                                                                                         |
| DeleteRemovedTime              | 2017-09-17T10:20:22                                                                                                                                                                                                                         |
| databaseIgnoreDirectoryFormats | @eaDir                                                                                                                                                                                                                                      |
+--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
23 rows in set (0.00 sec)
Comment 5 Maik Qualmann 2017-12-16 16:12:00 UTC
At the moment I have no idea why it could be because you also write that another DB works. I would manually set the two entries DBVersion and DBVersionRequired to 9.

UPDATE Settings SET value=9 WHERE keyword='DBVersion';
UPDATE Settings SET value=9 WHERE keyword='DBVersionRequired';

Digikam should starts now. Create a new blank DB and use the migration tool to copy the DB.

Maik
Comment 6 Lukas Winkler 2017-12-16 16:59:14 UTC
Hi,

I have now updated DBVersion and DBVersionRequired, migrated it to a new database and changed the settings to this database.

It's quite slow now as it needs to regenerate all Thumbnails (0.5GB), but otherwise it's working fine thanks.