Bug 501905 - Since upgrade to 8.6.0 Digikam crashes on startup after integrity check fails for "digikamfaces.Identities"
Summary: Since upgrade to 8.6.0 Digikam crashes on startup after integrity check fails...
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Database-Faces (show other bugs)
Version: 8.6.0
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-23 12:35 UTC by kramski
Modified: 2025-03-23 17:46 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kramski 2025-03-23 12:35:46 UTC
SUMMARY

After upgrading Digikam to 8.6.0, it crashes on startup.

One of the last error messages is

    Failed integrity check for table  "digikamfaces.Identities"


STEPS TO REPRODUCE
1. Open a console
2. export QT_LOGGING_RULES="digikam*=true" 
3. digicam

OBSERVED RESULT

Digikam crashes with

$ export QT_LOGGING_RULES="digikam*=true" 
$ digikam 
digikam.widgets: Use installed icons
digikam.general: Switch to application font:  QFont(Noto Sans,10,-1,5,400,0,0,0,0,0,0,0,0,0,0,1)
digikam.general: AlbumWatch is disabled
digikam.general: Database Parameters:
   Type:                        "QMYSQL" 
   DB Core Name:                "digikamcore" 
   DB Thumbs Name:              "digikamthumbs" 
   DB Face Name:                "digikamfaces" 
   DB Similarity Name:          "digikamsimilarity" 
   Connect Options:             "" 
   Host Name:                   "xxxx.xxxx.local" 
   Host Port:                   3306
   WAL Mode:                    false
   Internal Server:             false
   Internal Server Path:        "" 
   Internal Server Init Cmd:    "" 
   Internal Server Admin Cmd:   "" 
   Internal Server Program Cmd: "" 
   Internal Server Upgrade Cmd: "" 
   Username:                    "digikam" 
   Password:                    "XXXXXXXX" 

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  16
digikam.coredb: Core database: makeUpdates  16  to  16
digikam.database: Creating new Location  "/"  uuid  "networkshareid:?mountpath=/mnt/nas/sandl/bilder/Fotos/Maxi-Dummy&fileuuid=a8a765a1-a12f-488f-90d7-289fc95b9d8b" 
digikam.database: Creating new Location  "/"  uuid  "networkshareid:?mountpath=/mnt/nas/sandl/bilder/Fotos/Maxi-Test&fileuuid=3505084d-e75e-408c-9231-3f76034fbaa3" 
digikam.database: Creating new Location  "/"  uuid  "networkshareid:?mountpath=/mnt/nas/sandl/bilder/Fotos/Maxi-Master&fileuuid=a1abe0f1-464d-43da-ac2f-932bcc3c5159" 
digikam.database: Creating new Location  "/"  uuid  "networkshareid:?mountpath=/mnt/nas/sandl/bilder/Fotos/Maxi-KHK&fileuuid=3bf9f42f-6ae1-4e9b-b040-3f6bc5e077dc" 
digikam.database: Creating new Location  "/home/xxxx/Pictures/DK-Test-Local"  uuid  "volumeid:?uuid=61dbb6ea-95c8-425f-93fc-47ae6b5047e1" 
qt.core.qobject.connect: QObject::connect: No such signal Solid::Backends::Fstab::FstabStorageAccess::checkRequested(QString)
qt.core.qobject.connect: QObject::connect: No such signal Solid::Backends::Fstab::FstabStorageAccess::checkDone(Solid::ErrorType, QVariant, QString)
qt.core.qobject.connect: QObject::connect: No such signal Solid::Backends::Fstab::FstabStorageAccess::checkRequested(QString)
qt.core.qobject.connect: QObject::connect: No such signal Solid::Backends::Fstab::FstabStorageAccess::checkDone(Solid::ErrorType, QVariant, QString)
digikam.database: Location for "" is available: false => case sensitivity: 2
digikam.database: Location for "" is available: false => case sensitivity: 2
digikam.database: Location for "" is available: false => case sensitivity: 2
digikam.database: Location for "" is available: false => case sensitivity: 2
digikam.database: Location for "" is available: false => case sensitivity: 0
digikam.general: Allowing a cache size of 1024 MB
digikam.thumbsdb: ThumbDB SelectThumbnailSetting val ret =  0
digikam.thumbsdb: ThumbDB SelectThumbnailSetting val ret =  0
digikam.thumbsdb: Thumbs database: have a structure version  "3" 
digikam.general: Thumbnails database ready for use
digikam.similaritydb: SimilarityDb SelectSimilaritySetting val ret =  0
digikam.similaritydb: SimilarityDb SelectSimilaritySetting val ret =  0
digikam.similaritydb: Similarity database: have a structure version  "1" 
digikam.similaritydb: Similarity database ready for use
digikam.dimg: QList("/usr/share/color/icc", "/home/kramski/.local/share/icc")
digikam.dimg: Found X.org XICC monitor profile  "20S1S21Y00" 
digikam.facedb: FaceDB SelectFaceSetting val ret = 0
digikam.facedb: FaceDB SelectFaceSetting val ret = 0
digikam.facedb: Face database: have a structure version  "6" 
digikam.database: Failed integrity check for table  "digikamfaces.Identities" . Reason: "Auto_increment will be checked on each open until CHECK TABLE FOR UPGRADE is executed" 
terminate called after throwing an instance of 'QException'
  what():  std::exception
zsh: IOT instruction (core dumped)  digikam


EXPECTED RESULT

Digikam should start and open normally.

SOFTWARE/OS VERSIONS
Linux: Arch Linux Kernel 6.13.7-arch1-1
KDE Plasma Version: 6.3.3
KDE Frameworks Version: 6.12.0
Qt Version: 6.8.2

ADDITIONAL INFORMATION

Using a shared MySQL database on local LAN.

Same issue on another machine. A downgrade to 8.5.0 helps as a temporary workaround.

 $ pacman -Q | grep -i digikam            
digikam 8.6.0-2
Comment 1 Maik Qualmann 2025-03-23 12:50:13 UTC
I think you need to run "mariadb-upgrade" on your database(s). This must be done whenever a new server version is installed.

Maik
Comment 2 Maik Qualmann 2025-03-23 16:10:06 UTC
Git commit 58f39be02e28875044cf1b02b67044c65a73fc28 by Maik Qualmann.
Committed on 23/03/2025 at 16:09.
Pushed by mqualmann into branch 'master'.

no exception if the face DB integrity check fails.
Provide the user with a message box explaining the reason.
FIXED-IN: 8.7.0

M  +1    -1    NEWS
M  +7    -2    core/libs/facesengine/facedb/facedb.cpp
M  +9    -0    core/libs/facesengine/facedb/facedb_p.h
M  +1    -1    core/libs/facesengine/recognition/identityprovider.cpp

https://invent.kde.org/graphics/digikam/-/commit/58f39be02e28875044cf1b02b67044c65a73fc28
Comment 3 Maik Qualmann 2025-03-23 16:27:32 UTC
Git commit 1b359d356d4168a377789f2f7b70b7540a50a71f by Maik Qualmann.
Committed on 23/03/2025 at 16:26.
Pushed by mqualmann into branch 'master'.

also with SQLite a message box if the face DB integrity check fails
Related: bug 501838
FIXED-IN: 8.7.0

M  +1    -1    NEWS
M  +13   -4    core/libs/facesengine/facedb/facedb.cpp

https://invent.kde.org/graphics/digikam/-/commit/1b359d356d4168a377789f2f7b70b7540a50a71f
Comment 4 kramski 2025-03-23 17:14:08 UTC
(In reply to Maik Qualmann from comment #1)
> I think you need to run "mariadb-upgrade" on your database(s). This must be
> done whenever a new server version is installed.
> 
> Maik

Thanks. However, running "mariadb-upgrade" or "check table ... for upgrade" does not seem to have a permanent effect on this (mariadb 11.7.2, seemed to be known for 10.11.8, see https://jira.mariadb.org/browse/MDEV-34210):

+-------------------------+-------+----------+------------------------------------------------------+
| Table                   | Op    | Msg_type | Msg_text                                             |
+-------------------------+-------+----------+------------------------------------------------------+
| digikamfaces.Identities | check | note     | Auto_increment checked and .frm file version updated |
| digikamfaces.Identities | check | status   | OK                                                   |
+-------------------------+-------+----------+------------------------------------------------------+
2 rows in set (0.000 sec)

MariaDB [digikamfaces]> check table Identities;
+-------------------------+-------+----------+---------------------------------------------------------------------------------------+
| Table                   | Op    | Msg_type | Msg_text                                                                              |
+-------------------------+-------+----------+---------------------------------------------------------------------------------------+
| digikamfaces.Identities | check | note     | Auto_increment will be checked on each open until CHECK TABLE FOR UPGRADE is executed |
| digikamfaces.Identities | check | status   | OK                                                                                    |
+-------------------------+-------+----------+---------------------------------------------------------------------------------------+
2 rows in set (0.001 sec)

Granted, this is not a Digikam bug.

But your no-exception fix should perhaps not only consider digikamfaces.identities, but also digikamcore.DownloadHistory, digikamcore.ImageCopyright, digikamcore.Searches, digikamfaces.OpenCVLBPHRecognizer, digikamfaces.OpenCVLBPHistograms and digikamthumbs.Thumbnails which behave similarly. 

Just in case this is relevant.

Heinz
Comment 5 Maik Qualmann 2025-03-23 17:46:59 UTC
Git commit 2f9f30ba15a6e1fec25b126d7659a8af97439281 by Maik Qualmann.
Committed on 23/03/2025 at 17:45.
Pushed by mqualmann into branch 'master'.

do not bind face database errors to "note" but only to "status"

M  +18   -10   core/libs/facesengine/facedb/facedb.cpp

https://invent.kde.org/graphics/digikam/-/commit/2f9f30ba15a6e1fec25b126d7659a8af97439281