Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
KDE: Akonadi Won't Start After Upgrade
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
mikb
n00b
n00b


Joined: 14 Dec 2005
Posts: 72
Location: Sydney Australia

PostPosted: Thu Dec 20, 2018 12:19 am    Post subject: KDE: Akonadi Won't Start After Upgrade Reply with quote

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:
Code:
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.

Code:
show create table PimItemTable;

[ .. SNIP .. ]
Code:
`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.

Code:
# 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 .. ]
Code:
  `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)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum