[kdepim-users] akonadi-server upgrade desaster

Jörg Schaible joerg.schaible at gmx.de
Sat Dec 13 17:21:52 GMT 2014


Hi folks,

it seems there's no way for me to upgrade my akonadi-server 1.11.0 to 1.12.x 
or 1.13.x. I am using an external MySQL for years, but it fails to upgrade 
the tables nor will it recreate them without errors if I drop them all. All 
I can do is to downgrade to 1.11.0 again and restore the DB schema from a 
backup.

When I start akonadi manually with the DB restored for version 1.11.0, I 
get:

======================= %< ====================
~ $ akonadictl start
Starting Akonadi Server... 
   done. 
Connecting to deprecated signal 
QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
~ $ search paths:  ("/usr/local/bin", "/usr/bin", "/bin", "/opt/bin", 
"/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.3", "/usr/games/bin", 
"/home/joehni/bin", "/home/joehni/bin", "/usr/sbin", "/usr/local/sbin", 
"/usr/local/libexec", "/usr/libexec", "/opt/mysql/libexec", 
"/opt/local/lib/mysql5/bin", "/opt/mysql/sbin") 
Found mysql_install_db:  "" 
Found mysqlcheck:  "/usr/bin/mysqlcheck" 
QSqlDatabasePrivate::removeDatabase: connection 'initConnection' is still in 
use, all queries will cease to work.
Database "akonadi" opened using driver "QMYSQL" 
DbInitializer::run() 
checking table  "SchemaVersionTable" 
checking table  "ResourceTable" 
checking table  "CollectionTable" 
"ALTER TABLE CollectionTable ADD COLUMN enabled BOOL NOT NULL DEFAULT true" 
"ALTER TABLE CollectionTable ADD COLUMN syncPref TINYINT DEFAULT 2" 
"ALTER TABLE CollectionTable ADD COLUMN displayPref TINYINT DEFAULT 2" 
"ALTER TABLE CollectionTable ADD COLUMN indexPref TINYINT DEFAULT 2" 
"ALTER TABLE CollectionTable ADD COLUMN referenced BOOL NOT NULL DEFAULT 
false" 
"ALTER TABLE CollectionTable ADD COLUMN queryAttributes VARBINARY(255)" 
"ALTER TABLE CollectionTable ADD COLUMN queryCollections VARBINARY(255)" 
checking table  "MimeTypeTable" 
checking table  "PimItemTable" 
checking table  "FlagTable" 
checking table  "PartTypeTable" 
"CREATE TABLE PartTypeTable (id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, 
name VARBINARY(255) NOT NULL, ns VARBINARY(255) NOT NULL)  
COLLATE=utf8_general_ci DEFAULT CHARSET=utf8" 
"
Sql error: Table '`akonadi`.`PartTypeTable`' already exists QMYSQL: Unable 
to execute query
Query: CREATE TABLE PartTypeTable (id BIGINT NOT NULL AUTO_INCREMENT PRIMARY 
KEY, name VARBINARY(255) NOT NULL, ns VARBINARY(255) NOT NULL)  
COLLATE=utf8_general_ci DEFAULT CHARSET=utf8"
Unable to initialize database.
[== skipped stack trace ==]
ProcessControl: Application 'akonadiserver' returned with exit code 255 
(Unknown error)
search paths:  ("/usr/local/bin", "/usr/bin", "/bin", "/opt/bin", 
"/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.3", "/usr/games/bin", 
"/home/joehni/bin", "/home/joehni/bin", "/usr/sbin", "/usr/local/sbin", 
"/usr/local/libexec", "/usr/libexec", "/opt/mysql/libexec", 
"/opt/local/lib/mysql5/bin", "/opt/mysql/sbin") 
Found mysql_install_db:  "" 
Found mysqlcheck:  "/usr/bin/mysqlcheck" 
QSqlDatabasePrivate::removeDatabase: connection 'initConnection' is still in 
use, all queries will cease to work.
Database "akonadi" opened using driver "QMYSQL" 
DbInitializer::run() 
checking table  "SchemaVersionTable" 
checking table  "ResourceTable" 
checking table  "CollectionTable" 
checking table  "MimeTypeTable" 
checking table  "PimItemTable" 
checking table  "FlagTable" 
checking table  "PartTypeTable" 
"CREATE TABLE PartTypeTable (id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, 
name VARBINARY(255) NOT NULL, ns VARBINARY(255) NOT NULL)  
COLLATE=utf8_general_ci DEFAULT CHARSET=utf8" 
"
Sql error: Can't create table 'akonadi.PartTypeTable' (errno: -1) QMYSQL: 
Unable to execute query
Query: CREATE TABLE PartTypeTable (id BIGINT NOT NULL AUTO_INCREMENT PRIMARY 
KEY, name VARBINARY(255) NOT NULL, ns VARBINARY(255) NOT NULL)  
COLLATE=utf8_general_ci DEFAULT CHARSET=utf8"
Unable to initialize database.
[== skipped stack trace ==]
ProcessControl: Application 'akonadiserver' returned with exit code 255 
(Unknown error)
======================= %< ====================

It tries to create the (new) table PartTypeTable, fails with the obscure 
"table already exists" error and fails on any subsequent try with this errno 
-1.

One problem seems to be that all my akonadi tables are based on the MyISAM 
engine (executed before the failed upgrade attempt):

======================= %< ====================
mysql> SELECT TABLE_NAME,ENGINE FROM information_schema.TABLES WHERE 
TABLE_SCHEMA='akonadi';
+----------------------------+--------+
| TABLE_NAME                 | ENGINE |
+----------------------------+--------+
| CollectionAttributeTable   | MyISAM |
| CollectionMimeTypeRelation | MyISAM |
| CollectionPimItemRelation  | MyISAM |
| CollectionTable            | MyISAM |
| FlagTable                  | MyISAM |
| MimeTypeTable              | MyISAM |
| PartTable                  | MyISAM |
| PimItemFlagRelation        | MyISAM |
| PimItemTable               | MyISAM |
| ResourceTable              | MyISAM |
| SchemaVersionTable         | MyISAM |
+----------------------------+--------+
11 rows in set (0.00 sec)
======================= %< ====================

However, after the failed upgrade I have an PartTypeType.ibd file in the 
directory where MySQL keeps the files for the akonadi schema, while all 
others are triples of (.MYD/.MYI/.frm) for each table.

Unfortunately it is also not possible to alter the DB engine for the tables:

======================= %< ====================
mysql> ALTER TABLE akonadi.CollectionAttributeTable ENGINE = InnoDB;
ERROR 1050 (42S01): Table './akonadi/CollectionAttributeTable' already 
exists
======================= %< ====================

In the next step I dropped all those tables above in the hope akonadi will 
recreate them at start again, this time with the proper engine type, but no 
avail:

======================= %< ====================
~ $ akonadictl start
Starting Akonadi Server... 
   done. 
Connecting to deprecated signal 
QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
~ $ search paths:  ("/usr/local/bin", "/usr/bin", "/bin", "/opt/bin", 
"/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.3", "/usr/games/bin", 
"/home/joehni/bin", "/home/joehni/bin", "/usr/sbin", "/usr/local/sbin", 
"/usr/local/libexec", "/usr/libexec", "/opt/mysql/libexec", 
"/opt/local/lib/mysql5/bin", "/opt/mysql/sbin") 
Found mysql_install_db:  "" 
Found mysqlcheck:  "/usr/bin/mysqlcheck" 
QSqlDatabasePrivate::removeDatabase: connection 'initConnection' is still in 
use, all queries will cease to work.
Database "akonadi" opened using driver "QMYSQL" 
DbInitializer::run() 
checking table  "SchemaVersionTable" 
"CREATE TABLE SchemaVersionTable (version INTEGER NOT NULL DEFAULT 0)  
COLLATE=utf8_general_ci DEFAULT CHARSET=utf8" 
"
Sql error: Table '`akonadi`.`SchemaVersionTable`' already exists QMYSQL: 
Unable to execute query
Query: CREATE TABLE SchemaVersionTable (version INTEGER NOT NULL DEFAULT 0)  
COLLATE=utf8_general_ci DEFAULT CHARSET=utf8"
Unable to initialize database.
======================= %< ====================

So, what now? I am out of ideas ...

- Jörg


_______________________________________________
KDE PIM users mailing list
Subscription management: https://mail.kde.org/mailman/listinfo/kdepim-users


More information about the kdepim-users mailing list