Joined: 14 Dec 2005
Location: Sydney Australia
|Posted: Thu Dec 20, 2018 12:19 am Post subject: KDE: Akonadi Won't Start After Upgrade
|A recent world update upgraded Akonadi to 18.12.0. After restart, Akonadi refused to start because it couldn't build the indexes for the database. MySQL was stopping with this error:
|Sql error: Invalid default value for 'atime' QMYSQL: Unable to execute query |
After doing some googling, it seemed the standard response was "reinitialise your akonadi database from scratch".
For various historical reasons, I didn't want to do that. But I found this bug in KDE bugzilla: https://bugs.kde.org/show_bug.cgi?id=362580.
The problem lies with the atime column in the PimItemTable being defined to have a default of zero.
|show create table PimItemTable; |
[ .. SNIP .. ]
|`atime` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', |
This is no longer acceptable to my current mysql instance (5.7.24). I believe this is a change in behavior with MySQL 5.7.
Surprisingly, this can be fixed without rebuilding the database from scratch.
|# mysql -u root -p
mysql> connect akonadi;
mysql> alter table PimItemTable change atime atime timestamp not null default current_timestamp();
Query OK, 0 rows affected (3.78 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> show create table PimItemTable;
[ .. SNIP .. ]
| `atime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
The mysql indexes now build, and akonadi starts correctly!
With sufficient thrust, pigs fly just fine (RFC 1925, not actually talking about Gentoo)