On Wednesday 17 Dec 2014 19:13:03 Jörg Schaible wrote:
> 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


I'm sure I've seen a bug reported in KDE about it when I suffered some similar 
error, but can't find the link just now.

You may want to dump the database so that you have a back up and convert it 
from MyISAM to InnoDB before you try to update akonadi.

-- 
Regards,
Mick

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to