Bug 411480 - Problems with database migration on remote host
Summary: Problems with database migration on remote host
Status: RESOLVED WORKSFORME
Alias: None
Product: digikam
Classification: Applications
Component: Database-Mysql (show other bugs)
Version: 5.9.0
Platform: Debian stable Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-31 21:35 UTC by Kjetil Kjernsmo
Modified: 2019-10-11 16:38 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 6.4.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kjetil Kjernsmo 2019-08-31 21:35:25 UTC
SUMMARY


STEPS TO REPRODUCE
1. Have a version 8 database on a different host than the desktop where Digikam reside
2. Launch digikam 5.9.0
3. Observe console output

OBSERVED RESULT
Digikam opens a dialog saying database migration failed, and that I should file a bug report with the output from the console. Here it is:

digikam.general: AlbumWatch use QFileSystemWatcher
digikam.general: Database Parameters:
   Type:                     "QMYSQL"
   DB Core Name:             "digikam"
   DB Thumbs Name:           "thumbnails_digikam"
   DB Face Name:             "face_digikam"
   Connect Options:          ""
   Host Name:                "robin"
   Host port:                3306
   Internal Server:          false
   Internal Server Path:     ""
   Internal Server Serv Cmd: ""
   Internal Server Init Cmd: ""
   Username:                 "kjetil"
   Password:                 "XXXXXXX"

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  8
digikam.coredb: Core database: makeUpdates  8  to  9
digikam.dbengine: Failure executing query:
 "" 
Error messages: "QMYSQL: Unable to execute query" "Column count of mysql.proc is wrong. Expected 21, found 20. The table is probably corrupted" 1805 2 
Bound values:  ()
digikam.dbengine: Error while executing DBAction [ "UpdateSchemaFromV7ToV9" ] Statement [ "\n                    DROP PROCEDURE IF EXISTS drop_foreign_key;\n                " ]
digikam.coredb: Core database: schema update to V 9 failed!
digikam.coredb: Core database: cannot process schema initialization
KMemoryInfo: Platform identified :  "LINUX"
KMemoryInfo: TotalRam:  8291205120
digikam.general: Allowing a cache size of 200 MB
QThreadStorage: Thread 0x7fec65146bc0 exited after QThreadStorage 10 destroyed



EXPECTED RESULT
That Digikam would start and migrate the database.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Maik Qualmann 2019-08-31 23:13:01 UTC
Error messages: "QMYSQL: Unable to execute query" "Column count of mysql.proc is wrong. Expected 21, found 20. The table is probably corrupted" 1805 2 

The error message is unique, your database table is corrupt. We will not be able to fix it. Create a new database. You can later try copying the database with the migration tool. Use a more recent digiKam version, currently is 6.2.0.

Maik
Comment 2 Maik Qualmann 2019-08-31 23:20:41 UTC
try, repair / upgrade your MySQL database with this command:
mysql_upgrade -u root -p

Maik
Comment 3 Kjetil Kjernsmo 2019-09-16 20:08:05 UTC
Indeed, this was a pure database migration issue. I had to start from scratch, remove most of the backup that was related to the mysql database. It eventually worked, but was painful. You may close this if you wish.
Comment 4 Maik Qualmann 2019-10-11 16:38:06 UTC
Ok, thanks, I'll close the bug. My suggestion from comment 2 should have helped. It may happen again after a new MySQL server release that an upgrade must be performed. If necessary reopen the bug.