Bug 289295 - MySQL errors when creating the akonadi database
Summary: MySQL errors when creating the akonadi database
Status: RESOLVED FIXED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: server (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-18 18:09 UTC by Andrea Scarpino
Modified: 2013-12-06 16:23 UTC (History)
11 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Full mysql.err on first launch (3.43 KB, application/octet-stream)
2011-12-18 18:09 UTC, Andrea Scarpino
Details
mysql.err 'wrong structure of perfomance_schema' under Kubuntu 12.04 LTS (2.54 KB, text/plain)
2012-12-16 13:49 UTC, Ewald Müller
Details
Akonadi-Test: no Errors anymore (106.30 KB, image/png)
2013-01-17 04:45 UTC, Ewald Müller
Details
Some strange System-Popups after the repair (62.82 KB, image/png)
2013-01-17 04:47 UTC, Ewald Müller
Details
First start of Contact after repair: Heavy Errors (37.46 KB, image/png)
2013-01-17 04:52 UTC, Ewald Müller
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrea Scarpino 2011-12-18 18:09:27 UTC
Created attachment 66872 [details]
Full mysql.err on first launch

Version:           unspecified (using Devel) 
OS:                Linux

On the first login akonadi create its database, but when using MySQL 5.5.x the mysql.err has many [ERROR] voices like this one:

[ERROR] Native table 'performance_schema'.'file_instances' has the wrong structure

I can add some resource and everything seems to work fine. Just to know if there's something wrong with MySQL 5.5.x.

Reproducible: Always

Steps to Reproduce:
Create a new KDE user in a system with MySQL 5.5.x installed and login.
Look at ~/.local/share/akonadi/db_data/mysql.err

Actual Results:  
there're several MySQL errors on it.

Expected Results:  
No mysql errors on it.

Akonadi 1.6.2
MySQL 5.5.x
Comment 1 Christophe Marin 2011-12-18 21:02:54 UTC
looks like http://bugs.mysql.com/bug.php?id=54467 which is supposed to be fixed

(http://lists.mysql.com/commits/113756)
Comment 2 Andrea Scarpino 2011-12-29 15:51:10 UTC
Seems it isn't because I'm using 5.5.19 here.
Comment 3 Michael Bach 2011-12-31 13:39:07 UTC
I can confirm this.

Version: 1.6.2
OS:      Arch Linux
MySQL:   5.5.19

I was noticing this only yesterday and I think it is due to a MySQL upgrade along the way.

I am getting a Warning and another error before the `Native table 'performance_schema'' error:

[Warning] Can't open and lock time zone table: Table 'mysql.time_zone_leap_second' doesn't exist trying to live without them
[ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
[ERROR] Native table 'performance_schema'.'events_waits_current' has the wrong structure
[ERROR] Native table 'performance_schema'.'events_waits_history' has the wrong structure

I was thinking of fixing the db manually using the tips on the boards, but refrained.
Comment 4 Valentin Rusu 2012-11-28 13:29:05 UTC
I confirm this for me too.
Configuration : ArchLinux
mysql  Ver 14.14 Distrib 5.5.28, for Linux (x86_64) using readline 5.1
KDE compiled from sources with kdesrc_build, up to date.

My setup was more than an year ago. Initially everything was OK with Akonadi and never checked it again. Now that I plan to return to KMail I'm doing a routine check of akonadi and found the mysql error when clicking the "test" butonn on the akonadi server KCM.

I suppose the database structure has changed on the road and some scripts should be updated.
Comment 5 Christophe Marin 2012-11-28 13:35:44 UTC
So, this only happens on arch ?
Comment 6 Valentin Rusu 2012-11-28 14:07:25 UTC
I just dit the "big reset" as described here :
http://userbase.kde.org/Akonadi_4.4/Troubleshooting#Understanding_the_Structure

After doing "akonadictl start" the database was recreated. Then I returned to the KCM and clicked the "test" button to get the same database structure errors.

I can now confirm this bug.
Comment 7 Christophe Marin 2012-11-28 14:09:27 UTC
Well, there's still no Akonadi bug reported. if this doesn't cause any side effect, why do you bother ?
Comment 8 Valentin Rusu 2012-11-28 14:26:34 UTC
I'm compiling KDE from the sources and it only happens that I'm doing that using ArchLinux. I changed the qualification of the bug.

Having a test tool and seeing it reporting an error with database structure is not very good for the user experience - please check this:
http://forum.ubuntu-fr.org/viewtopic.php?pid=10139061

If there are no side-effects, then the test script is out of date and should be fixed?
Comment 9 Christophe Marin 2012-11-28 14:42:01 UTC
No, mysql.err can contain real errors. this check is useful.

Are mysql_install_db & mysqlcheck installed and executable by any user on your machine ?
Comment 10 Valentin Rusu 2012-11-28 17:22:51 UTC
Yes for both of them.
Comment 11 Ewald Müller 2012-12-16 13:49:16 UTC
Created attachment 75867 [details]
mysql.err 'wrong structure of perfomance_schema' under Kubuntu 12.04 LTS
Comment 12 Ewald Müller 2012-12-16 13:54:44 UTC
(In reply to comment #11)

muelux@muelux-LT70B-T61:~$ id
uid=1000(muelux) gid=1000(muelux) Gruppen=1000(muelux),4(adm),20(dialout),24(cdrom),27(sudo),33(www-data),46(plugdev),103(syslog),104(fuse),113(lpadmin),118(admin),120(sambashare),123(vboxusers),125(mysql)
muelux@muelux-LT70B-T61:~$ akonadictl status
Akonadi Control: running
Akonadi Server: running
Akonadi Server Search Support: available (backend: Virtuoso)
muelux@muelux-LT70B-T61:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 12.04.1 LTS
Release:        12.04
Codename:       precise
muelux@muelux-LT70B-T61:~$ mysql --version
mysql  Ver 14.14 Distrib 5.5.28, for debian-linux-gnu (i686) using readline 6.2
muelux@muelux-LT70B-T61:~$
Comment 13 Ömer Fadıl USTA 2013-01-15 05:35:54 UTC
I had same bug and fixed like this. 
Could someone (who have same problem) test the same steps and feed back the result ?
1- akonadictl stop
2- install libmysql++-dev and apparmor-utils packages
3- sudo aa-complain mysqld
4- sudo aa-complain mysql_install_db
5- sudo aa-complain mysqlcheck
6- sudo /etc/init.d/apparmor reload
7- rm -rf ~/.local/share/akonadi/db_data/*
8- akonadictl start
9- check mysql.err and there isn't any error anymore
Comment 14 Ewald Müller 2013-01-17 04:40:29 UTC
Hello and Thanks for that reply, (i've read about setting apparmor in complain-mode a long time ago, but forgot it till now)
 
I just did the whole sequence of your advice (but i strongly recommend to Backup akonadi before that (Akonadi-GUI Command 'Datensicherung durchführen')
I documented all the steps, but at last, after step 8 (starting akonadi again) there where hundreds of messages in the terminal, some of them meant errors of that kind:

"akonadi_contacts_resource_0" 
akonadi_maildispatcher_agent(11784)/libakonadi Akonadi::SpecialCollectionsRequestJob::slotResult: Failed SpecialCollectionsRequestJob::slotResult "Unbekannter Fehler. (Fehler beim Einholen der Ressourcen-Collection.)" 
akonadi_maildispatcher_agent(11784) OutboxQueue::Private::localFoldersRequestResult: Failed to get outbox folder. Retrying in:  15000 

=> i stopped the Terminal (<Strg>C), started Akonadi per GUI: I couldn't even start Kontact again!

I did a recovery of the saved Akonadi-Data (GUI: 'Datensicherung zurückholen') and could start Kontact again with all my saved Mails...

The Akonadi-Module now doesn't contain errors anymore, but i still have some System-Popups, that an IMAP-Resource is *not* 'not functioning'? see attachements
Comment 15 Ewald Müller 2013-01-17 04:45:01 UTC
Created attachment 76521 [details]
Akonadi-Test: no Errors anymore

After the steps of comment #13 the errors disappeared: thanks a lot !
Comment 16 Ewald Müller 2013-01-17 04:47:42 UTC
Created attachment 76522 [details]
Some strange System-Popups after the repair
Comment 17 Ewald Müller 2013-01-17 04:52:47 UTC
Created attachment 76523 [details]
First start of Contact after repair: Heavy Errors

After that i did a restore of the Akonadi-Backup and i could start Kontact again
Comment 18 Ömer Fadıl USTA 2013-01-18 00:06:51 UTC
As a result ( if you didn't have anything in your akonadi server )  by following that comment #13 solve your problems ?

(In reply to comment #17)
> Created attachment 76523 [details]
> First start of Contact after repair: Heavy Errors
> 
> After that i did a restore of the Akonadi-Backup and i could start Kontact
> again
Comment 19 Ewald Müller 2013-01-18 07:35:02 UTC
(In reply to comment #18)
> As a result ( if you didn't have anything in your akonadi server )  by
> following that comment #13 solve your problems ?
Yes, i can confirm that, now i don't have any new erros in the mysql.err 

Thanks a lot for your help!
Comment 20 Daniel Vrátil 2013-12-06 16:23:01 UTC
Closing as fixed, since this sounds like a problem with MySQL and updating their performance_schema after upgrade, not an Akonadi bug.