Bug 236535 - sometimes can't open and log timezone and privilege tables
Summary: sometimes can't open and log timezone and privilege tables
Status: RESOLVED FIXED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Volker Krause
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-06 11:05 UTC by Martin Steigerwald
Modified: 2010-08-02 15:59 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
/etc/akonadi/mysql-global.conf (1.99 KB, text/plain)
2010-05-06 11:09 UTC, Martin Steigerwald
Details
akonadi error protocol (10.34 KB, text/plain)
2010-05-06 11:12 UTC, Martin Steigerwald
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Steigerwald 2010-05-06 11:05:28 UTC
Version:           1.3.1-3 debian packages (using KDE 4.4.3)
OS:                Linux
Installed from:    Debian testing/unstable Packages

Often, possibly always when I start Kontact the first time after initiating a KDE session I get:

martin@shambhala:~> cat /home/martin/.local/share/akonadi/db_data/mysql.err
100506 10:44:38 [Note] Plugin 'FEDERATED' is disabled.
100506 10:44:39  InnoDB: Started; log sequence number 0 2895515
100506 10:44:40 [Warning] Can't open and lock time zone table: Table 'mysql.time_zone_leap_second' doesn't exist trying to live without them
100506 10:44:40 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
100506 10:44:40 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.1.45-3-log'  socket: '/home/martin/.local/share/akonadi/db_misc/mysql.socket'  port: 0  (Debian)

But when I close Kontact and start another time it usually works. This is since upgrading to KDE 4.4.3. I am not sure for earlier KDE 4.4 version, at least it wasn't that regular.

Expected results:

Akonadi just works without any user interaction whatsoever.


Since the problem does not happen always and there is a /etc/akonadi/mysql-global.conf configuration that Akonadi could use if there is no local one, I just don't believe the following to be a proper fix for the root cause of the problem:

------------------------------------------------------
Table 'mysql. servers' doesn't exist
If MySQL server log contains the following error: 
[ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
[ERROR] Cannot open mysql.db
[ERROR] Cannot open mysql.user
[ERROR] Cannot open mysql.event
then, most probably, you don't have your MySQL configuration file in place. Copy it from /usr/share/config/akonadi/mysql-global.conf into ~/.config/akonadi/mysql-local.conf. (For debian and openSuSE users the file ist located in /etc/akonadi/mysql-global.conf). Then open it and uncomment the line sql_mode=strict_trans_tables. If, after that, you get the following errors: 
[ERROR] Plugin 'InnoDB' init function returned error.
[ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE 
failed.
[ERROR] Unknown/unsupported table type: innodb
[ERROR] Aborting
then in the same file find the line that starts just like the one above (which you have uncommented), but has additional parameters, separated by commas (something like sql_mode=strict_trans_tables,strict_all_tables, ...etc). Comment the shorter sql_mode=... line and uncomment the longer one. 
On openSUSE 11.2 running the command 
mysql_install_db --datadir=$HOME/.local/share/akonadi/db_data/
will fix this problem."
------------------------------------------------------

http://userbase.kde.org/Akonadi_4.4/Troubleshooting#Table_.27mysql._servers.27_doesn.27t_exist

This just seems to be a work-around for me.

So please advise on a proper fix or explain to me why the solution from the wiki page is needed.

I will attach the global Akonadi MySQL configuration from the debian package. If it needs to be adapted, please tell so and I will file a debian bug.

I am using:

martin@shambhala:~> apt-show-versions | egrep "(akonadi|virtuoso|libqt4-gui/|kdelibs5/|kontact|kaddressbook|mysql)"
akonadi-server/sid uptodate 1.3.1-3
akonadiconsole/sid uptodate 4:4.4.3-1
kaddressbook/sid uptodate 4:4.4.3-1
kdelibs5/sid uptodate 4:4.4.3-1
kontact/sid uptodate 4:4.4.3-1
libakonadi-contact4/sid uptodate 4:4.4.3-1
libakonadi-kabc4/sid uptodate 4:4.4.3-1
libakonadi-kcal4/sid uptodate 4:4.4.3-1
libakonadi-kde4/sid uptodate 4:4.4.3-1
libakonadi-kmime4/sid uptodate 4:4.4.3-1
libakonadiprivate1/sid uptodate 1.3.1-3
libaprutil1-dbd-mysql/squeeze uptodate 1.3.9+dfsg-3
libdbd-mysql-perl/squeeze uptodate 4.014-1
libkontactinterface4/sid uptodate 4:4.4.3-1
libmysqlclient16/sid uptodate 5.1.45-3
libqt4-gui/squeeze uptodate 4:4.6.2-4
libqt4-sql-mysql/squeeze uptodate 4:4.6.2-4
mysql-client-5.1/sid uptodate 5.1.45-3
mysql-common/sid uptodate 5.1.45-3
mysql-server-5.1/sid uptodate 5.1.45-3
mysql-server-core-5.1/sid uptodate 5.1.45-3
php5-mysql/squeeze uptodate 5.3.2-1
virtuoso-minimal/sid uptodate 6.1.1+dfsg1-1
virtuoso-opensource-6.1-bin/sid uptodate 6.1.1+dfsg1-1
virtuoso-opensource-6.1-common/sid uptodate 6.1.1+dfsg1-1
Comment 1 Martin Steigerwald 2010-05-06 11:09:43 UTC
Created attachment 43299 [details]
/etc/akonadi/mysql-global.conf

from akonadi-server 1.3.1-3 debian package
Comment 2 Martin Steigerwald 2010-05-06 11:12:55 UTC
Created attachment 43301 [details]
akonadi error protocol

Another reason why I don't buy the copy the global configuration file workaround as a fix:

---------------------------------------------
Test 6:  SKIP
--------

MySQL server custom configuration not available.
Details: The custom configuration for the MySQL server was not found but is optional.
---------------------------------------------

So I expect the default configuration to work out of the box. The only reason to adapt it would be for me performance tuning if I had a very big data set.
Comment 3 Martin Steigerwald 2010-05-06 11:28:51 UTC
Bug #236538 and bug #236539 happen at the same first start of Akonadi.
Comment 4 Martin Steigerwald 2010-06-07 14:12:31 UTC
This does seem to be completely unrelated to bug #236538. I still get these logs after this bug has been fixed.
Comment 5 Volker Krause 2010-08-02 15:59:58 UTC
This has been fixed in Akonadi server >= 1.4.0.