Created attachment 176408 [details] debug log SUMMARY Ive run updated app image to latest stable 8.5 STEPS TO REPRODUCE 1. Just start 2. its in console 3. log included with myqsl schema without data OBSERVED RESULT Seems nothing is broken and app is working, but probably some mysql tables are not renamed EXPECTED RESULT SOFTWARE/OS VERSIONS Windows: macOS: (available in the Info Center app, or by running `kinfo` in a terminal window) Linux/KDE Plasma: KDE Plasma Version: KDE Frameworks Version: Qt Version: ADDITIONAL INFORMATION
Created attachment 176409 [details] mysql schema
You probably used test version when we had a bug in the update function for the face database. The best way is to set the version number in the FaceSettings table to a small version, use 2. Then everything will be rebuilt. Maik
Tried mysql> select * from FaceSettings; +-----------------------+-------+ | keyword | value | +-----------------------+-------+ | DBFaceVersion | 4 | | DBFaceVersionRequired | 4 | +-----------------------+-------+ 2 rows in set (0.00 sec) mysql> update FaceSettings value=2; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '=2' at line 1 mysql> update FaceSettings set value=2; Query OK, 2 rows affected (0.00 sec) Rows matched: 2 Changed: 2 Warnings: 0 mysql> select * from FaceSettings; +-----------------------+-------+ | keyword | value | +-----------------------+-------+ | DBFaceVersion | 2 | | DBFaceVersionRequired | 2 | +-----------------------+-------+ but this give me another error :) and nothing is reindexed 2024-12-07 11:25:24.150794 Digikam::FaceDb::setting: FaceDB SelectFaceSetting val ret = 0 2024-12-07 11:25:24.152026 Digikam::FaceDb::setting: FaceDB SelectFaceSetting val ret = 0 2024-12-07 11:25:24.152078 Digikam::FaceDbSchemaUpdater::startUpdates: Face database: have a structure version "2" 2024-12-07 11:25:24.245016 Digikam::BdEngineBackendPrivate::debugOutputFailedQuery: Failure executing query: 2024-12-07 11:25:24.245231 "" 2024-12-07 11:25:24.245266 Error messages: "QMYSQL: Unable to execute query" "BLOB/TEXT column 'removeHash' used in key specification without a key length" "1170" 2 2024-12-07 11:25:24.245302 Bound values: QList() 2024-12-07 11:25:24.254798 Digikam::BdEngineBackend::execDBAction: Error while executing DBAction [ "IndexFaceDBFaceMatrices_removeHash_V5" ] Statement [ "CREATE INDEX idx_FaceMatricesHash \n ON FaceMatrices(removeHash);\n " ] 2024-12-07 11:25:24.255402 Digikam::FaceDbSchemaUpdater::updateV2ToV5: fail to create FaceMatrices index 2024-12-07 11:25:24.257156 Digikam::FacialRecognitionWrapper::Private::Private: Face database ready for use Is it posible to send me db query to execute if previous was wrong ?
Ok, the best way is to delete all the tables in the face database. digiKam will recreate them. Then rebuild the training database in the maintenance tool. Delete the following tables: Identities IdentityAttributes FaceSettings FaceMatrices KDTree You may need to temporarily run SET FOREIGN_KEY_CHECKS=0; to delete the tables, then re-enable them with SET FOREIGN_KEY_CHECKS=1; Maik
Still is something wrong. Ive drop tables from digikam database ( all tables are in digikam databases, not split ) config from digikamrc below SET FOREIGN_KEY_CHECKS=0; drop table Identities; drop table IdentityAttributes; drop table FaceSettings; drop table FaceMatrices; drop table KDTree; SET FOREIGN_KEY_CHECKS=1; digikamrc databases vvvv Database Name=digikam Database Name Face=digikam Database Name Similarity=digikam Database Name Thumbnails=digikam Error 2024-12-07 22:45:04.925396 Digikam::FaceDb::setting: FaceDB SelectFaceSetting val ret = 0 2024-12-07 22:45:04.926853 Digikam::FaceDb::setting: FaceDB SelectFaceSetting val ret = 0 2024-12-07 22:45:04.926899 Digikam::FaceDbSchemaUpdater::startUpdates: Face database: have a structure version "" 2024-12-07 22:45:04.926922 Digikam::FaceDbSchemaUpdater::startUpdates: DBFaceVersion not available! Giving up schema upgrading. 2024-12-07 22:45:04.926963 Digikam::FaceDbAccess::checkReadyForUse: Face database: cannot process schema initialization 2024-12-07 22:45:04.926985 Digikam::FacialRecognitionWrapper::Private::Private: Failed to initialize face database full log in attachement debug_log_20241207_224452.txt mysql not contain any record in tbl FaceSettings >> probably not properly recreated after mysql drop tables mysql> select * from FaceSettings; Empty set (0.00 sec)
Created attachment 176424 [details] debug_log_20241207_224452.txt
I tested it here with my SQL database, deleted all face database tables. These are created without any problems. The trigger is the "Identities" table, if this does not exist, everything is recreated. An "Identities" table is still found in your database. This is why an update is attempted incorrectly. Maik
Ive deleted all tables with drop, the databases are created okay, but not with data. --- root@db:~# while read -r line;do mysql -D digikam -e "select count(*) from $line";done < FACES_tables.list count(*) 0 count(*) 0 count(*) 0 count(*) 0 count(*) 0 Then i added setting into FaceSettings with this, INSERT INTO `FaceSettings` (`keyword`, `value`) VALUES ('DBFaceVersion', '2'); INSERT INTO `FaceSettings` (`keyword`, `value`) VALUES ('DBFaceVersionRequired', '4'); it change the error message to the previous one
No, do not create a FaceSettings table manually. If digiKam does not find a "Identities" table, digiKam will create all tables again. Maik
I drop only one table now, identities. No data(rows with settings) backfilled in empty table FaceSettings. But Identities table is created. Only one thing i see in procedures is create_index_if_not_exists Maybe problem can be im not using maria but percona 8.x
Git commit fa198d314991f8823980f757b03ad63142cd0ebd by Maik Qualmann. Committed on 15/12/2024 at 18:02. Pushed by mqualmann into branch 'master'. create face table index only with check for MySQL M +3 -13 core/data/database/dbconfig.xml.cmake.in M +5 -8 core/libs/facesengine/facedb/facedbschemaupdater.cpp https://invent.kde.org/graphics/digikam/-/commit/fa198d314991f8823980f757b03ad63142cd0ebd
Does an error message appear because of "create_index_if_not_exists"? That would be fatal, as this internal function is specifically for Oracle MySQL, as it does not support this function. We have been using the function for a long time and often when updating digiKam. I didn't know percona until now, it seems to be based on MySQL. Maik
Seems that problem or some restrictions in percona. Tried from scratch with percona and get same error with empty database. Then i purged percona and installed latest maria. Error gone