Bug 467505 - When launching the latest version of digiKam, the old internal MySql database cannot be started.
Summary: When launching the latest version of digiKam, the old internal MySql database...
Status: REPORTED
Alias: None
Product: digikam
Classification: Applications
Component: Database-Mysql (other bugs)
Version First Reported In: 8.7.0
Platform: macOS (DMG) macOS
: NOR critical
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-17 20:16 UTC by ustuerzlinger
Modified: 2025-07-29 13:02 UTC (History)
5 users (show)

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


Attachments
Screenshot of error message (150.77 KB, image/png)
2023-03-17 20:16 UTC, ustuerzlinger
Details
digikam 7.10 error message after upgrade (114.24 KB, image/png)
2023-03-17 20:43 UTC, Hackintosh HD
Details
mysql error log (2.69 MB, text/plain)
2023-03-21 13:38 UTC, ustuerzlinger
Details
digikam error log macos related to mariadb initialization (370.15 KB, image/png)
2025-07-28 13:00 UTC, Felipe
Details
searching macOSBundlePrefix() on git indicate the potential issue (412.90 KB, image/png)
2025-07-28 13:01 UTC, Felipe
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ustuerzlinger 2023-03-17 20:16:11 UTC
Created attachment 157370 [details]
Screenshot of error message

SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1. Install digikam 7.10 over 7.9
2. launch the application
3. Receive error message "An error occurred during the internal server start"

OBSERVED RESULT
Unable to start application

EXPECTED RESULT
Start application with old database

SOFTWARE/OS VERSIONS 
macOS: Ventura 13.2.1


ADDITIONAL INFORMATION
MacBook Pro M1 Max
Comment 1 caulier.gilles 2023-03-17 20:34:29 UTC
Hi,

i already responded in the user mailing list about this problem few days ago. Look this thread:

https://mail.kde.org/pipermail/digikam-users/2023-March/034674.html

See also this bugzilla entry for the story: https://bugs.kde.org/show_bug.cgi?id=462736

Best

Gilles Caulier
Comment 2 Hackintosh HD 2023-03-17 20:43:14 UTC
Created attachment 157372 [details]
digikam 7.10 error message after upgrade
Comment 3 Hackintosh HD 2023-03-17 20:44:34 UTC
Same here on a MacBook Pro mid-2012 (MacBookPro9,1) with Ventura 13.2.1 after an upgrade of digikam 7.9/internal mysql to digikam 7.10, cf. attached screenshot.
Comment 4 Hackintosh HD 2023-03-17 20:49:43 UTC
Sorry for my screenshot and comment after Gilles explanation of the problem - as you may notice from our comments' timestamps, we commented pretty much simultaneously, so I didn't have any knowledge about the problem's cause at the time of writing.
Comment 5 Maik Qualmann 2023-03-21 12:37:53 UTC
Can you please post the MySQL error log from the database directory ".../.mysql.digikam/db_data/mysql.err"?

Maik
Comment 6 ustuerzlinger 2023-03-21 13:38:31 UTC
Created attachment 157494 [details]
mysql error log

As requested the error log
Comment 7 caulier.gilles 2024-09-18 09:17:31 UTC
@ustuerzlinger

As you use a M1 macbook pro like me, i recommend to try the Silicon PKG installer build for 8.5.0 pre-release. It's use MariaDB 10.1 provided by Macports :

https://ports.macports.org/port/mariadb-10.11/

Files can be download here :

https://files.kde.org/digikam/

Please try and reports...

Gilles Caulier
Comment 8 caulier.gilles 2024-09-18 09:19:31 UTC
A screenshot from my MacBook pro M1 running digiKam 8.5.0 arm64 with the internal mysql database (here mariadb):

https://i.imgur.com/A3CTp2Y.png

Gilles Caulier
Comment 9 Michael Miller 2024-09-18 10:37:15 UTC
Sorry, but the latest 8.5.0-arm package still doesn't work for me.  My environment is a Mac arm64 VM.  I removed previous SQLlite DBs and MariaDM files and dirs.  I removed ~/Library/Preferences/digikamrc.  This screenshot is the inital run of digiKam.

https://bugs.kde.org/attachment.cgi?id=173822

If you try to run mariadbd from the command line using the parameters shown in the error message, you'll see what I mean in https://bugs.kde.org/show_bug.cgi?id=491042 about MariaDB files missing.
Comment 10 caulier.gilles 2024-09-20 02:34:51 UTC
Michael,

I found a severe (and stupid) bug in the PKG installer that i just fixed : the previous install was not removed from the /Applications.

Re-installing the application will mix different versions with all possible side effects that you can imagine.

I will rebuild arm64 pkg asap.

Gilles
Comment 11 caulier.gilles 2025-03-15 15:32:23 UTC
Hi,

digiKam 8.6.0 is just released:

https://www.digikam.org/news/2025-03-15-8.6.0_release_announcement/

Problem still exists with this version?

Thanks in advance

Gilles Caulier
Comment 12 Felipe 2025-07-28 13:00:47 UTC
Created attachment 183597 [details]
digikam error log macos related to mariadb initialization
Comment 13 Felipe 2025-07-28 13:01:56 UTC
Created attachment 183598 [details]
searching macOSBundlePrefix() on git indicate the potential issue
Comment 14 Felipe 2025-07-28 13:09:24 UTC
The error persists in version 8.7.0.

I found the issue. During the initialization phase the mariadb command has an argument with a "//" that is incorrect. The correct argument should be: "--basedir=/Applications/digiKam.org/digikam.app/Contents/lib/mariadb/" and the current code generates two // between Contents and lib.

I am not developer but searched through the code, and the issue might be on databaseserver.cpp, look how the argument is generated on lines 522 and 568:  mysqldServCmdArgs << QDir::toNativeSeparators(QString::fromLatin1("--basedir=%1/lib/mariadb/"). Looking other codelines, the output of macOSBundlePrefix always finish with "/", and combining both you get the wrong "..Contents//lib/... path.

I added an attachment to see the error string, and a screenshot of the search I used to find the potential typo in the code
Comment 15 caulier.gilles 2025-07-28 14:47:35 UTC
Git commit 0fb86864cbb9390c8b3182d9150e5be3dcc77aa5 by Gilles Caulier.
Committed on 28/07/2025 at 14:46.
Pushed by cgilles into branch 'master'.

try to fix MacOS ath for Mysql server.

M  +4    -2    core/libs/database/server/databaseserver.cpp
M  +2    -0    core/libs/database/server/databaseserver.h

https://invent.kde.org/graphics/digikam/-/commit/0fb86864cbb9390c8b3182d9150e5be3dcc77aa5
Comment 16 caulier.gilles 2025-07-28 14:57:36 UTC
I will rebuild this evening the PKG installer for MacOS version 8.8.0. It will be available at this place late today (Paris time):

https://files.kde.org/digikam/

Best regards

Gilles Caulier
Comment 17 Felipe 2025-07-28 16:06:27 UTC
(In reply to caulier.gilles from comment #15)
> Git commit 0fb86864cbb9390c8b3182d9150e5be3dcc77aa5 by Gilles Caulier.
> Committed on 28/07/2025 at 14:46.
> Pushed by cgilles into branch 'master'.
> 
> try to fix MacOS ath for Mysql server.
> 
> M  +4    -2    core/libs/database/server/databaseserver.cpp
> M  +2    -0    core/libs/database/server/databaseserver.h
> 
> https://invent.kde.org/graphics/digikam/-/commit/
> 0fb86864cbb9390c8b3182d9150e5be3dcc77aa5

Thanks. almost :). The / that create problems is the "/" after the %1 and before lib. The code line should be :

mysqlInitCmdArgs << QDir::toNativeSeparators(QString::fromLatin1("--basedir=%1lib/mariadb/")
                                                     .arg(macOSBundlePrefix()));
Comment 18 caulier.gilles 2025-07-28 16:16:48 UTC
Git commit 6daaa7f4254541ac9d2be77b34d14078d108a244 by Gilles Caulier.
Committed on 28/07/2025 at 16:16.
Pushed by cgilles into branch 'master'.

second try to fix path under MacOS

M  +2    -2    core/libs/database/server/databaseserver.cpp

https://invent.kde.org/graphics/digikam/-/commit/6daaa7f4254541ac9d2be77b34d14078d108a244
Comment 19 caulier.gilles 2025-07-28 16:52:51 UTC
The new PKG 8.8.0 is now online here : https://files.kde.org/digikam/
Comment 20 Felipe 2025-07-29 13:02:07 UTC
(In reply to caulier.gilles from comment #19)
> The new PKG 8.8.0 is now online here : https://files.kde.org/digikam/

Thank you Gilles. That part is fixed. I tested and unfortunately there is another error. I spent some time digging, and the problem is at the mariadb_install_db script that comes from the mysql code when you build the app. I tried to use that script manually with multiple "--basedir" combinations, and I was not successful. probably a bug on qt.

I found this workaround, for other users:
* Install mariadb 10.11 by yourself. If you have homebrew, run at the terminal : brew install mariadb@10.11
* Install digikam, select mysql as database.
* Change the directories of the mysql binaries. Make sure the ones selected are /opt/homebrew/opt/mariadb@10.11/bin/...
* will run error. select cancel and Close digikam
* go to terminal and run : /opt/homebrew/opt/mariadb@10.11/bin/mariadb-install-db --defaults-file=/Applications/digiKam.org/digikam.app/Contents/Resources/digikam/database/mysql-global.conf --basedir=/opt/homebrew/opt/mariadb@10.11/ --datadir=/users/your-user/desired-db-directory.mysql.digikam/db_data
replace above your-user for your user directory and -desired-dv-directory for the directory where you want the database.
* open digikam again. You got digikam running with mysql database.