akonadi server doesn't start at login

Bug #448705 reported by Mark Greenwood
164
This bug affects 25 people
Affects Status Importance Assigned to Milestone
KDE PIM
Fix Released
Medium
akonadi (Ubuntu)
Fix Released
Critical
Harald Sitter
mysql-dfsg-5.1 (Ubuntu)
Fix Released
Critical
Harald Sitter

Bug Description

lsb_release -rd
Description: Ubuntu karmic (development branch)
Release: 9.10

All updates have been applied as of today

apt-cache policy akonadi-server
akonadi-server:
  Installed: 1.2.1-0ubuntu2
  Candidate: 1.2.1-0ubuntu2
  Version table:
 *** 1.2.1-0ubuntu2 0
        500 http://gb.archive.ubuntu.com karmic/main Packages
        100 /var/lib/dpkg/status

The Akonadi server does not start at login. I get errors saying the mysql server log contains errors:

091011 14:29:30 [Note] Plugin 'FEDERATED' is disabled.
091011 14:29:30 InnoDB: Started; log sequence number 0 143201
091011 14:29:30 [Warning] Can't open and lock time zone table: Table 'mysql.time_zone_leap_second' doesn't exist trying to live without them
091011 14:29:30 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
091011 14:29:30 [ERROR] Cannot open mysql.db
091011 14:29:30 [ERROR] Cannot open mysql.user
091011 14:29:30 [ERROR] Cannot open mysql.event
091011 14:29:30 [ERROR] Event Scheduler: An error occurred when initializing system tables.
091011 14:29:30 [Note] /usr/sbin/mysqld-akonadi: ready for connections.
Version: '5.1.37-1ubuntu5-log' socket: '/home/bob/.local/share/akonadi/db_misc/mysql.socket' port: 0 (Ubuntu)

Also the self-test says that the akonadi control process is not registered at D-Bus. The Akonadi panel in System Settings reports that the server is not running.

I have been through all the suggestions on userbase.kde.org/Akonadi but none have made any difference. I am not using an encrypted home directory.

If I start the server manually after login using 'akonadictl start', this appears to work - although I do still get the mysql errors - but the D-Bus errors no longer appear and the panel in System Settings shows the server as running. I have tried deleting the resources and recreating them, which seems to work once the server is running, but this makes no difference to the problem at startup.

Tags: kubuntu
Revision history for this message
Mark Greenwood (fatgerman) wrote :

Here is the akonadi self-test log that I get at startup

Revision history for this message
Mark Greenwood (fatgerman) wrote :

OK I sort-of fixed this. Once I got the server to start manually, I deleted all the resources and then ran kres-migrator from the command line. This imported my address book settings (twice - once as 'std.vcf' and once as 'Default Address Book').

After a restart, the Akonadi server was now running but both the resources said 'no file selected', and my address book was apparently empty. So I manually reconfigured the Default Address Book resource by browsing to ~/.kde/share/apps/kabc/std.vcf'. I also deleted the other resource since I don't see why I need two. Now the server starts on boot and my address book is stored in Akonadi.

Perhaps some update had broken this?

I've also been able to make the same fix work on a box running Jaunty with KDE4.3

Revision history for this message
Matthieu de Montmollin (mouloud) wrote :

I upgraded to karmik on the 3.11.2009 and after login of each user, there was this akonadi/mysql error/warning.

Revision history for this message
Tim Holy (holy-wustl) wrote :

I had an apparently-similar problem (error report attached). My problem seems to have been solved by manually installing the package mysql-server. (It had not been installed automatically.)

Revision history for this message
Moritz Baumann (mo42) wrote :

Thanks Mark, I had the same problem and after doing what you did it now works for me. Manually replacing the default resource for contacts and calendar with an akonadi resource in "KDE Resources" should also do the trick.

Installing mysql-server didn't change anything, by the way.

Changed in akonadi (Ubuntu):
status: New → Confirmed
Revision history for this message
Blackpaw (blackpaw) wrote :

I've got exactly the same errors and have tried everything at userbase.kde.org/Akonadi as well as marks suggestions, nothing works.

Karmic 9.10 + KDE SC 4.4

kde4-config --version
Qt: 4.6.1
KDE Development Platform: 4.4.00 (KDE 4.4.0)
kde4-config: 1.0

Revision history for this message
Harald Sitter (apachelogger) wrote :
Changed in akonadi (Ubuntu):
assignee: nobody → Harald Sitter (apachelogger)
importance: Undecided → High
Changed in kdepim:
status: Unknown → Confirmed
Revision history for this message
Reinhold Kainhofer (reinhold) wrote :

One of the problems seems to be apparmor, which disallows initializing the databases required for akonadi in the user dir!
A workaround is to turn off apparmor as root:
/etc/init.d/apparmor stop

then run (as user):

mysql_install_db --datadir=$HOME/.local/share/akonadi/db_data/

Also, you have to adjust /etc/apparmor.d/usr.sbin.mysqld-akonadi to include the following lines:

  /etc/mysql/my.cnf r,
  /etc/mysql/conf.d/ r,
  /etc/mysql/conf.d/** r,
  /sys/devices/system/cpu/ r,

and then restart apparmor as root:

/etc/init.d/apparmor start

Now, the mysql database for akonadi seems to be started properly... Now, I only have to figure out how to make nepomuk registered at the D-Bus...

Revision history for this message
Harald Sitter (apachelogger) wrote :

That issue does not even become prominent because akonadi does not try to initialize the databases, also packaging wise msql_install_db is not currently installed.

Also I find it rather silly to have that stuff outside the server to begin with.

Jonathan Riddell (jr)
tags: added: kubuntu
Changed in akonadi (Ubuntu):
milestone: none → ubuntu-10.04
Revision history for this message
Dennis Schridde (devurandom) wrote :

bug #534463 is likely a duplicate of this. I didn't assume this issue would still be present, i.e. even after the KDE 4.4.1 release.

Changed in akonadi (Ubuntu):
status: Confirmed → Triaged
Changed in kdepim:
status: Confirmed → Fix Released
Revision history for this message
Dennis Schridde (devurandom) wrote :

Will you backport the fix to kde bug #185395 to kubuntu-ppa/backports?

Revision history for this message
Dennis Schridde (devurandom) wrote :

In reply to comment #8:
There is no mysql_install_db on my system (Kubuntu 10.04_beta1)
Trying to execute the command says the binary would be in:
 * mysql-server-5.1
 * mysql-cluster-server-5.1
 * mysql-server-5.0
But none is installed.

Revision history for this message
Ilja Pavkovic (ipavkovic) wrote :

dennis:
- install mysql-server-5.1
- execute the commands
- deinstall mysql-server-5.1

Revision history for this message
Dennis Schridde (devurandom) wrote :

I hope you don't mean that as a solution to this bug, but as a very temporary workaround. ;)

Revision history for this message
Ilja Pavkovic (ipavkovic) wrote :

I personally had to do this once. The commands only create/update the mysql database that akonadi uses.

Akonadi tried to create this before but the database creation failed due to the apparmor configuration.

Revision history for this message
Dennis Schridde (devurandom) wrote :

1) sudo aptitude install mysql-server-5.1
2) Add the following to /etc/apparmor.d/usr.sbin.mysqld and /etc/apparmor.d/usr.sbin.mysqld-akonadi
  @{HOME}/.local/share/akonadi/ rw,
  @{HOME}/.local/share/akonadi/** rwk,
3) sudo service apparmor restart
4) akonadictl stop
5) rm -r .local/share/akonadi/ .config/akonadi/ .kde/share/config/akonadi_*
6) mysql_install_db --datadir=$HOME/.local/share/akonadi/db_data/
7) akonadictl start

The error following messages are now *gone* from mysql.err:
100327 12:30:43 [Warning] Can't open and lock time zone table: Table 'mysql.time_zone_leap_second' doesn't exist trying to live without them
100327 12:30:43 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist

But there seems to be another issue, maybe related to the sloppy db creation process, when trying to synchronise the akonadi_imap_resource:
[/usr/bin/akonadi_imap_resource] akonadi_imap_resource_0(9320) ImapResource::onIdleCollectionFetchDone: CollectionFetch for mail box "INBOX" failed. error= 103 , errorString= "Unknown error. (Hierarchical RID does not specify a unique collection)"

Revision history for this message
Dennis Schridde (devurandom) wrote :

In reply to comment #16:
> But there seems to be another issue, maybe related to the sloppy db creation process, when trying to synchronise the akonadi_imap_resource:
Which is likely an instance of kde-bug #224552.

Revision history for this message
Dennis Schridde (devurandom) wrote :

Hm, seems launchpad doesnt link to KDE bugs like this, trying again:
kde-bugs #224552 / https://bugs.kde.org/show_bug.cgi?id=224552

Revision history for this message
Blackpaw (blackpaw) wrote :

Thanks Dennis, I tried your process and it worked for me, on Kubuntu 10.04 Beta 1

Not using the imap resource so don't have that problem.

Revision history for this message
Harald Sitter (apachelogger) wrote :

Also requires changes to the mysql package (some files need to be moved from the main server package to the server-core package)

Changed in akonadi (Ubuntu):
importance: High → Critical
status: Triaged → In Progress
Changed in mysql-dfsg-5.1 (Ubuntu):
assignee: nobody → Harald Sitter (apachelogger)
importance: Undecided → Critical
milestone: none → ubuntu-10.04
status: New → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mysql-dfsg-5.1 - 5.1.41-3ubuntu11

---------------
mysql-dfsg-5.1 (5.1.41-3ubuntu11) lucid; urgency=low

  * Move mysql_install_db and required .sql files from the server package
    to the server-core package. Akonadi now executes aforementioned script
    to ensure the mysql system tables are available and mysqld does not cry
    about them (LP: #448705).
    resolveip was *not* moved. The install_db script gets executed using --force
  * server-core replaces << this version of server
 -- Harald Sitter <email address hidden> Thu, 01 Apr 2010 13:53:28 +0200

Changed in mysql-dfsg-5.1 (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package akonadi - 1.3.1-0ubuntu2

---------------
akonadi (1.3.1-0ubuntu2) lucid; urgency=low

  * Add kubuntu_01_fix_init.diff in a mere attemt to fix akonadi startup. This
    depends on a fixed verison of mysql (5.1.41-3ubuntu10) (LP: #448705)
    + Unlike upstream this uses the --force cmdl argument to also work without
      resolveip, an executable that is currently shipped in the main server
      package.
 -- Harald Sitter <email address hidden> Wed, 31 Mar 2010 22:08:13 +0200

Changed in akonadi (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Giulio Spinozzi (giuliospinozzi) wrote :

Now, at the Kmail startup, the self test of Akonadi report an other error concerning XDG_DATA_DIRS.....Kmail crash after

Revision history for this message
Harald Sitter (apachelogger) wrote :

Please report a new bug about this.

Revision history for this message
Giulio Spinozzi (giuliospinozzi) wrote :
Changed in kdepim:
importance: Unknown → Medium
Revision history for this message
Tommy_CZ (t-kijas) wrote :

I can confirm it in latest oneiric

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.