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
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
mikb
Tux's lil' helper
Tux's lil' helper


Joined: 14 Dec 2005
Posts: 120
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, apparently talking about Gentoo)
Back to top
View user's profile Send private message
Mr. Chauv
n00b
n00b


Joined: 14 Sep 2003
Posts: 37

PostPosted: Mon Sep 16, 2019 7:18 pm    Post subject: Reply with quote

You, Sir, deserve three Internet!

Thank you so much for posting this result here - it helped me alot!

For any other noob still stumbling over this problem:
If "connect akonadi" is not working for you, then:
Code:

# ps axu | grep mysql

Look for a line similar to
Code:

/usr/sbin/mysqld --defaults-file=/home/you/.local/share/akonadi/mysql.conf --datadir=/home/you/.local/share/akonadi/db_data/ --socket=/tmp/runtime-you/akonadi/default/mysql.socket --pid-file=/tmp/runtime-you/akonadi/default/mysql.pid

Then killl it, and start it manually:
Code:

/usr/sbin/mysqld --defaults-file=/home/you/.local/share/akonadi/mysql.conf --datadir=/home/you/.local/share/akonadi/db_data/ --socket=/tmp/asd.socket

You can then connect via
Code:

mysql -S /tmp/asd.socket

and run the 'alter table' query.

CTRL-D out of mysql and "kill <PID>" your manual mysqld instance. Afterwards "akonadictl start" should do what it's supposed to.
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