Bug 503251 - Faces recognition stopped working
Summary: Faces recognition stopped working
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Faces-Recognition (other bugs)
Version First Reported In: 8.7.0
Platform: macOS (DMG) macOS
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-04-23 20:45 UTC by EnricoT
Modified: 2025-07-24 17:27 UTC (History)
4 users (show)

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


Attachments
attachment-881859-0.html (2.59 KB, text/html)
2025-04-24 07:21 UTC, EnricoT
Details
attachment-1107060-0.html (7.08 KB, text/html)
2025-04-24 17:34 UTC, EnricoT
Details
Report from Copperlanding (120.04 KB, text/plain)
2025-07-24 09:48 UTC, copperlanding
Details

Note You need to log in before you can comment on or make changes to this bug.
Description EnricoT 2025-04-23 20:45:49 UTC
after having performed full "database cleaning", No faces recognition is performed. 
Tried to Rebuild all training data with no effect
Comment 1 Michael Miller 2025-04-24 01:33:16 UTC
(In reply to EnricoT from comment #0)
> after having performed full "database cleaning", No faces recognition is
> performed. 
> Tried to Rebuild all training data with no effect

Hi Enrico,
Can you please provide two backtraces.  One when you rebuild all training, and another when you run recognition?

Here's how to generate a backtrace: https://www.digikam.org/contribute/

Cheers,
Mike
Comment 2 EnricoT 2025-04-24 07:21:43 UTC
Created attachment 180598 [details]
attachment-881859-0.html

Hello Mike
this is backtrace when I rebuild training:

[24436] QLayout: Attempting to add QLayout "" to QWidget "", which already
has a layout
[1492] CallDevToolsProtocolMethod failed:
[1492]
[1492] {"error":{"code":-32001,"message":"Session with given id not
found."},"id":45}
[1492]

this is when I try to run  faces recognition (People view,
workflow Recognize faces only, button Scan collection for faces):

[1492] CallDevToolsProtocolMethod failed:
[1492]
[1492] {"error":{"code":-32001,"message":"Session with given id not
found."},"id":55}
[1492]
[1492] CallDevToolsProtocolMethod failed:
[1492]
[1492] {"error":{"code":-32001,"message":"Session with given id not
found."},"id":60}
[1492]
[24436] digikam.general: parent is null
[24436] digikam.general: parent is null

I do not get from the program any error, but no detection is performed.
Many thanks for your help
Enrico

Il giorno gio 24 apr 2025 alle ore 03:33 Michael Miller <
bugzilla_noreply@kde.org> ha scritto:

> https://bugs.kde.org/show_bug.cgi?id=503251
>
> --- Comment #1 from Michael Miller <michael_miller@msn.com> ---
> (In reply to EnricoT from comment #0)
> > after having performed full "database cleaning", No faces recognition is
> > performed.
> > Tried to Rebuild all training data with no effect
>
> Hi Enrico,
> Can you please provide two backtraces.  One when you rebuild all training,
> and
> another when you run recognition?
>
> Here's how to generate a backtrace: https://www.digikam.org/contribute/
>
> Cheers,
> Mike
>
> --
> You are receiving this mail because:
> You reported the bug.
Comment 3 Michael Miller 2025-04-24 10:40:29 UTC
(In reply to EnricoT from comment #2)
> Created attachment 180598 [details]
> attachment-881859-0.html
> 
> Hello Mike
> this is backtrace when I rebuild training:
> 
> [24436] QLayout: Attempting to add QLayout "" to QWidget "", which already
> has a layout
> [1492] CallDevToolsProtocolMethod failed:
> [1492]
> [1492] {"error":{"code":-32001,"message":"Session with given id not
> found."},"id":45}
> [1492]
> 
> this is when I try to run  faces recognition (People view,
> workflow Recognize faces only, button Scan collection for faces):
> 
> [1492] CallDevToolsProtocolMethod failed:
> [1492]
> [1492] {"error":{"code":-32001,"message":"Session with given id not
> found."},"id":55}
> [1492]
> [1492] CallDevToolsProtocolMethod failed:
> [1492]
> [1492] {"error":{"code":-32001,"message":"Session with given id not
> found."},"id":60}
> [1492]
> [24436] digikam.general: parent is null
> [24436] digikam.general: parent is null
> 
> I do not get from the program any error, but no detection is performed.
> Many thanks for your help
> Enrico
> 
> Il giorno gio 24 apr 2025 alle ore 03:33 Michael Miller <
> bugzilla_noreply@kde.org> ha scritto:
> 
> > https://bugs.kde.org/show_bug.cgi?id=503251
> >
> > --- Comment #1 from Michael Miller <michael_miller@msn.com> ---
> > (In reply to EnricoT from comment #0)
> > > after having performed full "database cleaning", No faces recognition is
> > > performed.
> > > Tried to Rebuild all training data with no effect
> >
> > Hi Enrico,
> > Can you please provide two backtraces.  One when you rebuild all training,
> > and
> > another when you run recognition?
> >
> > Here's how to generate a backtrace: https://www.digikam.org/contribute/
> >
> > Cheers,
> > Mike
> >
> > --
> > You are receiving this mail because:
> > You reported the bug.

Hi Enrico,
It looks like the user environment variable wasn't added to Windows to turn on the debug output.  Please make sure QT_LOGGING_RULES with the value digikam*=true  is added to your environment variables before you start digikam.  

From the backtrace documentation:

> Windows Host
> .
> .
> .
>     name: "QT_LOGGING_RULES"
>     value: "digikam*=true"
> Run DebugView and later digiKam. The digiKam debug traces must appears in central view of DebugView.

Cheers,
Mike
Comment 4 EnricoT 2025-04-24 17:34:58 UTC
Created attachment 180619 [details]
attachment-1107060-0.html

Hello.
I do not know if I've captured you well: I've tried to run as administrator
the debugview program. This is what I get:

when I try to run faces recognition:

[22512] QLayout: Attempting to add QLayout "" to QWidget "", which already
has a layout
[22512] kf.config.core: KConfigIni: In file
C:/Users/e.tarani/AppData/Roaming/digikam/digikamstaterc, line 13: Invalid
escape sequence: «\L»
[22512] kf.config.core: KConfigIni: In file
C:/Users/e.tarani/AppData/Roaming/digikam/digikamstaterc, line 39: Invalid
escape sequence: «\S»
[22512] kf.config.core: KConfigIni: In file
C:/Users/e.tarani/AppData/Roaming/digikam/digikamstaterc, line 40: Invalid
escape sequence: «\Y»
[22512] kf.config.core: KConfigIni: In file
C:/Users/e.tarani/AppData/Roaming/digikam/digikamstaterc, line 74: Invalid
escape sequence: «\L»


this is when I try to run  faces recognition (People view, workflow
Recognize faces only, button Scan collection for faces):

[22512] QLayout: Attempting to add QLayout "" to QWidget "", which already
has a layout
[22512] kf.config.core: KConfigIni: In file
C:/Users/e.tarani/AppData/Roaming/digikam/digikamstaterc, line 13: Invalid
escape sequence: «\S»
[22512] kf.config.core: KConfigIni: In file
C:/Users/e.tarani/AppData/Roaming/digikam/digikamstaterc, line 39: Invalid
escape sequence: «\.»
[22512] kf.config.core: KConfigIni: In file
C:/Users/e.tarani/AppData/Roaming/digikam/digikamstaterc, line 39: Invalid
escape sequence: «\I»
[22512] kf.config.core: KConfigIni: In file
C:/Users/e.tarani/AppData/Roaming/digikam/digikamstaterc, line 40: Invalid
escape sequence: «\1»
[22512] kf.config.core: KConfigIni: In file
C:/Users/e.tarani/AppData/Roaming/digikam/digikamstaterc, line 41: Invalid
escape sequence: «\L»
[22512] kf.config.core: KConfigIni: In file
C:/Users/e.tarani/AppData/Roaming/digikam/digikamstaterc, line 75: Invalid
escape sequence: «\S»
[22512] kf.config.core: KConfigIni: In file
C:/Users/e.tarani/AppData/Roaming/digikam/digikamstaterc, line 13: Invalid
escape sequence: «\P»
[22512] kf.config.core: KConfigIni: In file
C:/Users/e.tarani/AppData/Roaming/digikam/digikamstaterc, line 39: Invalid
escape sequence: «\A»
[22512] kf.config.core: KConfigIni: In file
C:/Users/e.tarani/AppData/Roaming/digikam/digikamstaterc, line 74: Invalid
escape sequence: «\P»
[15672] CallDevToolsProtocolMethod failed:
[15672]
[15672] {"error":{"code":-32001,"message":"Session with given id not
found."},"id":1773}
[15672]


Many thanks for your help
Enrico


Il giorno gio 24 apr 2025 alle ore 12:40 Michael Miller <
bugzilla_noreply@kde.org> ha scritto:

> https://bugs.kde.org/show_bug.cgi?id=503251
>
> --- Comment #3 from Michael Miller <michael_miller@msn.com> ---
> (In reply to EnricoT from comment #2)
> > Created attachment 180598 [details]
> > attachment-881859-0.html
> >
> > Hello Mike
> > this is backtrace when I rebuild training:
> >
> > [24436] QLayout: Attempting to add QLayout "" to QWidget "", which
> already
> > has a layout
> > [1492] CallDevToolsProtocolMethod failed:
> > [1492]
> > [1492] {"error":{"code":-32001,"message":"Session with given id not
> > found."},"id":45}
> > [1492]
> >
> > this is when I try to run  faces recognition (People view,
> > workflow Recognize faces only, button Scan collection for faces):
> >
> > [1492] CallDevToolsProtocolMethod failed:
> > [1492]
> > [1492] {"error":{"code":-32001,"message":"Session with given id not
> > found."},"id":55}
> > [1492]
> > [1492] CallDevToolsProtocolMethod failed:
> > [1492]
> > [1492] {"error":{"code":-32001,"message":"Session with given id not
> > found."},"id":60}
> > [1492]
> > [24436] digikam.general: parent is null
> > [24436] digikam.general: parent is null
> >
> > I do not get from the program any error, but no detection is performed.
> > Many thanks for your help
> > Enrico
> >
> > Il giorno gio 24 apr 2025 alle ore 03:33 Michael Miller <
> > bugzilla_noreply@kde.org> ha scritto:
> >
> > > https://bugs.kde.org/show_bug.cgi?id=503251
> > >
> > > --- Comment #1 from Michael Miller <michael_miller@msn.com> ---
> > > (In reply to EnricoT from comment #0)
> > > > after having performed full "database cleaning", No faces
> recognition is
> > > > performed.
> > > > Tried to Rebuild all training data with no effect
> > >
> > > Hi Enrico,
> > > Can you please provide two backtraces.  One when you rebuild all
> training,
> > > and
> > > another when you run recognition?
> > >
> > > Here's how to generate a backtrace:
> https://www.digikam.org/contribute/
> > >
> > > Cheers,
> > > Mike
> > >
> > > --
> > > You are receiving this mail because:
> > > You reported the bug.
>
> Hi Enrico,
> It looks like the user environment variable wasn't added to Windows to
> turn on
> the debug output.  Please make sure QT_LOGGING_RULES with the value
> digikam*=true  is added to your environment variables before you start
> digikam.
>
> From the backtrace documentation:
>
> > Windows Host
> > .
> > .
> > .
> >     name: "QT_LOGGING_RULES"
> >     value: "digikam*=true"
> > Run DebugView and later digiKam. The digiKam debug traces must appears
> in central view of DebugView.
>
> Cheers,
> Mike
>
> --
> You are receiving this mail because:
> You reported the bug.
Comment 5 Michael Miller 2025-04-25 10:03:01 UTC
Hi Enrico,
I looks like the QT_LOGGING_RULES environment variable still isn't set correctly.  The backtrace should be hundreds or even thousands of lines long.

I suggest doing a quick Google search for how to set an environment variable in Windows, and then following the directions.  Also, make sure "Settings->Miscellaneous->System->Enable internal debug log" is checked.  digiKam needs to be restarted after both of these changes.

Cheers,
Mike
Comment 6 copperlanding 2025-07-24 04:18:04 UTC
Same here: faces are detected but not a single one is recognized with the correct name from my database of 34.000 pics. I started all database maintenance possibilities already. What can I do to avoid to start the recognition from zero which would take weeks?
Comment 7 caulier.gilles 2025-07-24 04:33:09 UTC
The bug must be fixed in 8.8.0 pre-release available here :

Apple Silicon: https://files.kde.org/digikam/ 
Apple Intel : https://files.kde.org/digikam/legacy/

Best

Gilles Caulier
Comment 8 copperlanding 2025-07-24 04:41:25 UTC
Sorry, Not exactly the Same Issue: The process of Face recognition goes fast but with no results. System: MacOs sequoia 15.5.
Comment 9 copperlanding 2025-07-24 05:37:30 UTC
(In reply to caulier.gilles from comment #7)
> The bug must be fixed in 8.8.0 pre-release available here :
> 
> Apple Silicon: https://files.kde.org/digikam/ 
> Apple Intel : https://files.kde.org/digikam/legacy/
> 
> Best
> 
> Gilles Caulier

Thanks for the super fast answer Gilles. I installed digikam 8.8.0. The result for my issue is even worse with this early version: Now the faces are neither detected nor recognized. Anyway thanks for trying.
Comment 10 caulier.gilles 2025-07-24 05:45:35 UTC
Run digiKam from the Terminal following the instructions here :

https://www.digikam.org/contribute/#macos-host

... and report the traces here. I suspect a problem with the face database.

Gilles Caulier
Comment 11 copperlanding 2025-07-24 09:48:26 UTC
Created attachment 183485 [details]
Report from Copperlanding

Here is my report. Hope that helps
Comment 12 copperlanding 2025-07-24 09:51:39 UTC
Hi Gilles, I have posted the report as an attachment since it is longer than 65K++ characters. Hope that helps! Thanks a million for looking into the issue.
Best regards Frank
Comment 13 caulier.gilles 2025-07-24 12:53:17 UTC
From your report :

digikam.dbengine: WAL mode is disabled for "recognition.db"

==> it's highly recomend to use WAL for safe usage of the sqlite database 

https://docs.digikam.org/en/setup_application/database_settings.html#the-sqlite-database

digikam.facedb: FaceDB SelectFaceSetting val ret = 0
digikam.facedb: FaceDB SelectFaceSetting val ret = 0
digikam.facedb: Face database: have a structure version  "4"
digikam.dbengine: Failure executing query:
 "" 
Error messages: "Der Befehl konnte nicht ausgefŸhrt werden" "no such column: \"`context`\"" "1" 2 
Bound values:  ()
digikam.dbengine: Error while executing DBAction [ "RenameFaceDBFaceMatrices_contextcolumn_V5" ] Statement [ "ALTER TABLE FaceMatrices\n                                        RENAME COLUMN `context` TO removeHash;\n                " ]
digikam.facedb: fail to rename FaceMatrices column
digikam.database: Failed integrity check for SQLite face database: "*** in database main ***\nTree 6 page 4407: btreeInitPage() returns error code 11\nTree 6 page 4406: btreeInitPage() returns error code 11\nTree 6 page 4405: btreeInitPage() returns error code 11\nTree 6 page 4404: btreeInitPage() returns error code 11"
digikam.facesengine: IdentityProvider::initialize() failed!

It's clear. Your database is not safe... If you have an older backup, restore it.

Gilles Caulier
Comment 14 Maik Qualmann 2025-07-24 14:43:32 UTC
The face database upgrade failed. Please delete the face database; it's corrupted. The face database will be recreated automatically. You then only need to rebuild the face training in the maintenance tool.

delete only this file: /Users/frankvonkeutz/Ablage (Mac)/Datenbanken/digiKam DB aktuell/recognition.db"

Maik
Comment 15 copperlanding 2025-07-24 15:36:17 UTC
(In reply to Maik Qualmann from comment #14)
> The face database upgrade failed. Please delete the face database; it's
> corrupted. The face database will be recreated automatically. You then only
> need to rebuild the face training in the maintenance tool.
> 
> delete only this file: /Users/frankvonkeutz/Ablage (Mac)/Datenbanken/digiKam
> DB aktuell/recognition.db"
> 
> Maik

Maik, Gilles, problem solved for me:
1) Set database to WAL mode
2) (Importing previouse database backups failed! Digicam crashed)
3) Deleting the recognition database and building I up again worked than finally.
All set, Thank you so much for your ongoing and fast support!
Best regards
Frank
Comment 16 copperlanding 2025-07-24 15:50:26 UTC
Final challenge: Confirmation and updating the database for 20 pictures runs since 5 minutes...I try the maintenance program again
Comment 17 copperlanding 2025-07-24 16:24:46 UTC
works now finally. Thanks again guys. Happy for your support!