Bug 444479 - digikam doesn't start, instead "cannot process schema initialization"
Summary: digikam doesn't start, instead "cannot process schema initialization"
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Database-Schema (show other bugs)
Version: 7.3.0
Platform: Arch Linux Linux
: NOR grave
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-27 09:41 UTC by Martin Senftleben
Modified: 2022-01-01 16:39 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Senftleben 2021-10-27 09:41:01 UTC
When starting digikam, it stops and opens a window saying (in German) that upgrading the database schema hadn't been successful and that I should start it from the konsole and send the error message which is shown there. 
When I start it from the CLI, I get the following message (nothing more, only this one line):

"digikam.coredb: Core database: cannot process schema initialization"



STEPS TO REPRODUCE
1. start digikam 
2. 
3. 

OBSERVED RESULT

See summary above

EXPECTED RESULT

digikam working


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

ADDITIONAL INFORMATION

Manjaro shows me the version number 7.3.0-5 for digikam.

I am totally lost here. Digikam doesn't give any useful information except the above, and I have no clue where to look for the database (I'm sorry, but digikam worked for me most of the time during the last 20 or so years, and I don't remember what settings there are, so questions like "what database" I simply can't answer unless I am told where to look for this info).
Comment 1 caulier.gilles 2021-10-27 09:43:33 UTC
Which kind of database type did you use : sqlite, mysql local, mysql remote serveur ?

If you use Mysql, which version exactly ?

Gilles Caulier
Comment 2 Maik Qualmann 2021-10-27 10:25:16 UTC
Before you start digiKam in the terminal, please activate the debug output with the command:

export QT_LOGGING_RULES="digikam*=true"

Post all messages.

Maik
Comment 3 Martin Senftleben 2021-10-27 15:40:18 UTC
Thank you, Mike, that was a helpful hint. Here is the output:

"digikam.widgets: Use installed icons
digikam.general: Switch to widget style:  "breeze"
digikam.general: AlbumWatch is disabled
digikam.general: Database Parameters:
   Type:                      "QMYSQL"
   DB Core Name:              "digikam"
   DB Thumbs Name:            "digikam"
   DB Face Name:              "digikam"
   DB Similarity Name:        ""
   Connect Options:           ""
   Host Name:                 "localhost"
   Host port:                 1111
   Internal Server:           false
   Internal Server Path:      ""
   Internal Server Admin Cmd: "mysqladmin"
   Internal Server Serv Cmd:  ""
   Internal Server Init Cmd:  ""
   Username:                  "drmartin"
   Password:                  "XXXXXXX"

digikam.dbengine: Loading SQL code from config file "/usr/share/digikam/database/dbconfig.xml"
digikam.dbengine: Checking XML version ID => expected:  3  found:  3
digikam.coredb: Core database: running schema update
digikam.coredb: Core database: have a structure version  12
digikam.coredb: Core database: makeUpdates  12  to  13
digikam.dbengine: Failure executing query:
 "" 
Error messages: "QMYSQL: Die Abfrage konnte nicht ausgeführt werden" "Column count of mysql.proc is wrong. Expected 21, found 20. Created with MariaDB 50537, now running 100604. Please use mariadb-upgrade to fix this error" "1558" 2 
Bound values:  ()
digikam.dbengine: Error while executing DBAction [ "UpdateSchemaFromV12ToV13" ] Statement [ "\n                    DROP PROCEDURE IF EXISTS create_index_if_not_exists;\n                " ]
digikam.coredb: Core database: schema update to V 13 failed!
digikam.coredb: Core database: cannot process schema initialization"

I hope this answers Gilles questions as well. It seems it's using MariaDB? As mentioned above, I do not know what digikam is doing in the background, I was always content with what it does, until this bug occured.
Comment 4 Martin Senftleben 2021-10-27 15:41:51 UTC
If it's Mariadb, it has the version 10.6.4-1
Comment 5 Maik Qualmann 2021-10-27 16:50:46 UTC
Ok, there is a problem here. MariaDB version 10.6.x is a major update, which also causes problems with the Qt-MySQL driver. The problems have already been solved, Archlinux was the pioneer because they are always very current. I do not think that your distribution has integrated the Qt patches that are absolutely necessary. digiKam would crash regularly without this patch. In principle, you would have to perform a "mariadb-upgrade" for your database, normally many distributions do a cron job after installing a new MariaDB major version. But don't do this and go back to MariaDB-10.5.x.

Maik
Comment 6 Maik Qualmann 2021-10-27 16:53:39 UTC
The MariaDB-10.6.x problem affects not only digiKam, but also other programs that use the Qt-MySQL driver. You can read the story at the doublicate bug report.

Maik
Comment 7 Maik Qualmann 2021-10-27 16:58:11 UTC
Read also this: Bug 440132

Maik

*** This bug has been marked as a duplicate of bug 440030 ***
Comment 8 Martin Senftleben 2021-10-28 09:48:08 UTC
OK, you lost me. I followed those duplicate bug links to some level (each one ended somewhere with "this is a duplicate bug of..."), and I am only little wiser than before. I did the obvious and tried to downgrade mariadb, but there are dependencies which don't allow me to downgrade. If I remove the entire package with its dependencies, I can only install the actual package, which I can't downgrade, because those dependencies are required by so many packages, that I would render my PC almost useless, if I uninstall all those packages (which I would have to do to get rid of those dependencies). So I rather do not use digikam any more - at least until this problem is solved. :-(
Comment 9 Maik Qualmann 2021-10-28 10:36:31 UTC
With the current MariaDB you will not be spared to carry out a "mariadb-upgrade" in the future either. Go to a terminal, become "root" and enter "mariadb-upgrade". Then digiKam should update the database schema without any problems. Whether digiKam will then crash sporadically depends on whether your distribution has already integrated the corresponding Qt patches. You should then report the problem to your distribution with the corresponding bug report from digiKam.

Maik
Comment 10 Martin Senftleben 2022-01-01 16:20:35 UTC
Sorry for not replying earlier. I did try "sudo mariadb-upgrade" and get only the following message:

"Version check failed. Got the following error when calling the 'mysql' command line client
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
FATAL ERROR: Upgrade failed"

And of course: I entered the password for sudo (correctly). I tried it a hundred times. But I guess the message means that there is a password required by mariadb, but the config says no password, and maybe even root is not the user with which the upgrade should be run? I'm confused...
Comment 11 Martin Senftleben 2022-01-01 16:35:17 UTC
Sorry again, after writing the previous message I thought I send the entire error message through a search engine, and lo, there were some insights provided by people who suffered the same problem. I had totally forgotten that I named another user for the database. After setting that (command "mariadb-upgrade -u username -p"), the upgrade ran through and now I can start digikam again.
Comment 12 caulier.gilles 2022-01-01 16:39:53 UTC
Thanks for the feedback and happy new year

Gilles Caulier