Bug 334205

Summary: Error code: 2013 with MariaDB 10.0.10
Product: [Frameworks and Libraries] Akonadi Reporter: Andrea Scarpino <scarpino>
Component: serverAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED UPSTREAM    
Severity: grave CC: arthur, dvratil, geekonek, ht990332, luis.davila.pc, peter, phani00
Priority: NOR    
Version: 1.12.1   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: akonadi start output
Akonadi selftest report
mariaDB error log after trying to start akonadi

Description Andrea Scarpino 2014-05-02 08:15:27 UTC
On Arch Linux system mariadb has been updated to 10.x.

Since that moment I can't use KMail anymore, I get:
"The Email program encountered a fatal error and will terminate now.
The error was:
Failed to fetch the resource collection."

As this is a major update, mysql_upgrade is needed but I *guess* Akonadi doesn't that automatically.

Reproducible: Always

Steps to Reproduce:
1. Upgrade MariaDB to 10.x
2. Restart Akonadi/system
Actual Results:  
Can't start KMail

Expected Results:  
Everything works!

* mariadb 10.0.10
* kmail 4.13.0
Comment 1 Andrea Scarpino 2014-05-02 08:19:23 UTC
Created attachment 86397 [details]
akonadi start output
Comment 2 Daniel Vrátil 2014-05-02 08:40:17 UTC
DB error:  "Lost connection to MySQL server during query" means that the MySQL server has crashed while running your query.

This is caused either by a bug in MySQL or, more probably, by data corruption. You can either try to rescue the database using some tools, or just recreate the database from scratch and reconfigure Akonadi.
Comment 3 Andrea Scarpino 2014-05-02 09:19:25 UTC
Created attachment 86398 [details]
Akonadi selftest report
Comment 4 Andrea Scarpino 2014-05-02 09:19:57 UTC
I wiped everything related to Akonadi, and it can't setup a new installation.
Comment 5 Hussam Al-Tayeb 2014-05-02 11:24:24 UTC
Confirmed here. 
I upgraded to mariadb 10.0.10, logged off my kde session and cleared the akonadi database (rm -rf ~/.local/share/akonadi).
When i logged onto KDE, akonadi started but then mysqld crashed. 
Downgrading back to mariadb 5.5.37 fixed the crash.
Comment 6 phanisvara das 2014-05-02 11:52:39 UTC
same here, can't get akonadi to run with mariaDB 10.x

here's the error report i got. i don't pretend to really understand what's going on, but it looks as if mariaDB had a problem with innoDB -- even though that only happens when trying to run akonadi. apart from that, mariaDB 10.x was working fine.

the DB itself doesn't appear to be corrupt. downgrading to mariaDB 5.37.x solved the problem. w/o clearing the DB, akonadi works fine.
Comment 7 phanisvara das 2014-05-02 11:53:48 UTC
Created attachment 86405 [details]
mariaDB error log after trying to start akonadi
Comment 8 desaparecido 2014-05-02 13:14:41 UTC
Hi, same problem here, I can confirm it too. Like others, downgrading mariadb and cleaning akonadi database of my user all works again.  Needed to clean /var/lib/mysql/ib_logfile* files to clean start mysql after downgrade
Comment 9 phanisvara das 2014-05-02 13:30:02 UTC
yes, i had to delete those logfiles too, but the DB itself survived up- and downgrade intact. akonadi works happily with the 5.37.x server, not with 10.x.

on the archlinux bug tracker (link above) somebody suggested re-compiling qt4 and akonadi against mariaDB 10.x instead of 5.x. another user tried recompiling akonadi only, which didn't help.
Comment 10 Peter Wu 2014-05-02 14:48:58 UTC
Another report (from me):
https://bugs.archlinux.org/task/40191

I recreated the database (dropped the akonadi database, removed the "db_data" dir) and tried to import a dump from mysqldump. It still crashes, looks like it is a mariadb 10.0.10 issue?
Comment 11 Andrea Scarpino 2014-05-02 16:58:39 UTC
Seems that rebuilding mariadb with gcc 4.8 fixes this.
Comment 12 Hussam Al-Tayeb 2014-05-02 19:28:33 UTC
(In reply to comment #11)
> Seems that rebuilding mariadb with gcc 4.8 fixes this.

Since compiling Qt4 with gcc 4.9 results in a broken libQtScript.so, this is a probably a gcc bug?
Comment 13 Andrea Scarpino 2014-05-02 19:30:45 UTC
(In reply to comment #12)
> Since compiling Qt4 with gcc 4.9 results in a broken libQtScript.so, this is
> a probably a gcc bug?

Yes, but please don't go OT any further. See https://bugreports.qt-project.org/browse/QTBUG-38733