Bug 501251 - Faces were removed
Summary: Faces were removed
Status: REPORTED
Alias: None
Product: digikam
Classification: Applications
Component: Database-Mysql (show other bugs)
Version: 8.6.0
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-09 08:25 UTC by Andy
Modified: 2025-04-27 02:00 UTC (History)
3 users (show)

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


Attachments
Output 20250315_093800 (202.38 KB, text/plain)
2025-03-15 08:55 UTC, Andy
Details
20250414_222301 - Ausgabe (161.64 KB, text/plain)
2025-04-14 20:28 UTC, Andy
Details
20250414_222301 - Bild1 (1.07 MB, image/png)
2025-04-14 20:29 UTC, Andy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andy 2025-03-09 08:25:39 UTC
Hello,
I have another strange case.

The MySQL server is running permanently on the Synology. Last night, another face recognition process was carried out on the PC. The PC was not in standby mode.

This morning, I see a lot of recognized faces. I marked and confirmed these 100. In the preview image area, I can see some of the names that have already been assigned below the faces. These have disappeared image by image. The changes have been transferred to the JPGs. The overview of the unconfirmed faces has not otherwise changed.

I now have 100 JPGs that no longer have any face areas.

There still seems to be access to the database. Apparently, the face data was simply not written to the JPG again.

I have now closed digikam and restarted it. The unconfirmed faces from last night are still displayed. If I confirm a face again as before, the areas and names are entered into the JPG. All faces and areas in the photo can be seen again.
The areas are still in the database. That's very good!

I had the same problem a few days ago.

Best regards
Andy
Comment 1 Maik Qualmann 2025-03-09 08:39:47 UTC
Are you sure that the PC has not gone into standby mode or the NAS? It is known that this will interrupt the connection and digiKam is currently not reactivating this connection.

Maik
Comment 2 Andy 2025-03-09 08:46:00 UTC
Yes, that's what I thought too. But I disabled power saving mode or sleep mode completely. Both devices ran through the night.
Could some software disconnect the connection after x hours of inactivity?
Comment 3 caulier.gilles 2025-03-09 08:47:42 UTC
The linux kernel have some mechanism to shutdown the network socket when activity take a while. This can be the problem.
Comment 4 caulier.gilles 2025-03-09 08:51:14 UTC
A paper explaining how to tune the socket keep alive settings on Linux kernel :

https://tldp.org/HOWTO/TCP-Keepalive-HOWTO/usingkeepalive.html
Comment 5 caulier.gilles 2025-03-09 08:54:18 UTC
Also the TCP socket keep alive behavior depend of the OS:

https://forum.qt.io/topic/91397/what-does-qabstractsocket-keepaliveoption-actually-do/5?_=1741510336444&lang=en-US
Comment 6 Andy 2025-03-09 08:57:51 UTC
The question is whether Synology does this too. It can be reached at any time using Quickconnect and Active Insight.
Hmm. To find out, I could run a debug all night.
The paper is too big for me. I don't work with Linux enough.
Comment 7 caulier.gilles 2025-03-09 09:10:53 UTC
Look well in the paper there cat some cat to run in /proc to know the actual keep alive settings from the NAS. Under Windows it's another story...
Comment 8 caulier.gilles 2025-03-09 09:13:17 UTC
The Windows keep alive settings is located in the registery database through this key :

\HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\TCPIP\Parameters

Gilles
Comment 9 Andy 2025-03-09 09:29:23 UTC
This reg entry is more for Windows servers so that the connection is terminated more quickly.
https://www.consic.de/de/einstellung-der-tcp-keepalive-zeit-fuer-windows-server

Could digikam ping the database every x minutes so that the connection remains active? Maybe also look for new entries in the albums after 1 hour of user inactivity?
Comment 10 Andy 2025-03-15 08:55:49 UTC
Created attachment 179417 [details]
Output 20250315_093800

Hello,
Face scanning has been running for all photos for 10 hours. 15% is now complete. The connection to the database is stable. Now I wanted to confirm the faces found. The face tags in the photos have been deleted again. The entries in the database remain.
I've created an output. Three file names are at the beginning for the search so you can find the point more quickly.
There are errors there:
...."Lost connection to MySQL server during query" "2013" 2

Regards
Andy
Comment 11 caulier.gilles 2025-04-11 18:13:57 UTC
Hi,

The 8.7.0 pre-release Windows installer from today have been rebuilt from
scratch with Qt 6.8.3, KDE 6.12, OpenCV 4.11 + CUDA support, Exiv2 0.28.5, ExifTool 13.27, ffmpeg 7, all image codecs updated to last version (jxl, avif, heif, aom, etc.).

Please try with this version to see if your problem still reproducible...

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

Thanks in advance
Best regards

Gilles Caulier
Comment 12 Andy 2025-04-14 20:28:27 UTC
Created attachment 180268 [details]
20250414_222301 - Ausgabe

Hello Gilles,

The PC performed automatic face detection overnight.
This morning, I confirmed a few faces. But instead of adding new faces to the photo, all known markers were removed.
I've created an output. See photo "20230813_100218 - A6000.jpg"
Regards
Andy
Comment 13 Andy 2025-04-14 20:29:01 UTC
Created attachment 180269 [details]
20250414_222301 - Bild1

And here

Andy
Comment 14 Michael Miller 2025-04-14 23:40:38 UTC
(In reply to Andy from comment #12)
> Created attachment 180268 [details]
> 20250414_222301 - Ausgabe
> 
> Hello Gilles,
> 
> The PC performed automatic face detection overnight.
> This morning, I confirmed a few faces. But instead of adding new faces to
> the photo, all known markers were removed.
> I've created an output. See photo "20230813_100218 - A6000.jpg"
> Regards
> Andy

Hi Andy, it looks like digiKam lost connection to the DB.  I see

> "SELECT imageid FROM ImageTagProperties LEFT JOIN Images ON Images.id=ImageTagProperties.imageid  WHERE tagid=? AND property=? AND >Images.status=1 LIMIT 1;" 
>Error messages: "QMYSQL: Der Befehl konnte nicht initialisiert werden" "Lost connection to MySQL server during query" "2013" 2 
>Bound values:  QList()
>digikam.dbengine: Failure executing query:

Over and over in the log file.  Maybe Gilles or Maik can give more information, but that doesn't look like normal operations.

Cheers,
Mike
Comment 15 Andy 2025-04-15 07:56:20 UTC
Hi,

Has the database connection completely crashed?
Because I can still switch to other albums or other people in digiKam and the thumbnails load. 

Regards, Andy
Comment 16 caulier.gilles 2025-04-15 08:03:58 UTC
Andy,

We need to know more about the infrastructure that you use. Network types, computers + OS, databases (local or remote), remote files (NAS or local), shared accounts, anti-virus, etc.

Best

Gilles Caulier
Comment 17 Andy 2025-04-15 08:40:04 UTC
AMD Phenom II 1100T, ASUS M4A88T-V EVO, Windows 10 Pro 
AMD Ryzen™ 7 7800X3D, Prozessor, MSI B650 Board, Windows 10 Pro 
Synology NAS DS918+

1 6-Port Switch, 1GbE LAN-Ports
1 FritzBox 7490

Database: remote
MariaDB-Server: Synology / Docker

No shared accounts.
ESET NOD32 Antivirus on both Windows PCs
Windows Firewall
Comment 18 Michael Miller 2025-04-27 02:00:06 UTC
(In reply to Andy from comment #17)
> AMD Phenom II 1100T, ASUS M4A88T-V EVO, Windows 10 Pro 
> AMD Ryzen™ 7 7800X3D, Prozessor, MSI B650 Board, Windows 10 Pro 
> Synology NAS DS918+
> 
> 1 6-Port Switch, 1GbE LAN-Ports
> 1 FritzBox 7490
> 
> Database: remote
> MariaDB-Server: Synology / Docker
> 
> No shared accounts.
> ESET NOD32 Antivirus on both Windows PCs
> Windows Firewall

Hi Andy,
Is this still an issue?  I've tried and tried, but I can't reproduct the issue.

Cheers,
Mike