Saturday, November 7, 2009

Akonadi D-Bus error and fix

After re-installing Kubuntu 8.10, the only distribution I've tried that works with my ATI Radeon 3870 HD card (using old catalyst drivers: 8.12), I've been looking into optimizing my OS since upgrading is oh so frustrating. However, this brings its own issues.

I sped up the boot time by about 5 seconds or so by disabling and blacklisting some unneeded modules, but I've also been attempting to transfer internal sqlite databases to a faster MySQL database.

Attempting to convert akonadi has led to some frustrations. Here's what happened.

Went to the system settings for kde -> then Akonadi.
Created the mysql database and user for it to use (referenced the amarok wiki, as it's basically the same procedure with different names.) and then restarted.
This will output annoying errors like:
akonadi "Can't connect to local MySQL server through socket ... mysql.socket"

and

Akonadi server process not registered at D-Bus

Needless to say, if you're switching or modifying akonadi and it starts blitzing out on you, a smart solution is to
a) delete all the configurations that it uses (/home/$USER/.config/akonadi/*) and
b) do an "apt-get install --reinstall akonadi-server akonadi-kde"

do a "dpkg-reconfigure akonadi-server akonadi-kde" for good measure.
I rebooted first, then attempted to load it. Finally it worked.

I should also mention that I did the following, mentioned from the akonadi section in the KDE.org wiki.

Apparmor

...

Note that you might be using Apparmor even if it does not show up in the process list.

Also note that some distributions ship an additional mysqld binary called mysqld-akonadi which has AppArmor set up correctly. If that's the case on your system and you see this problem nevertheless, there are two possible reasons:

* Akonadi still uses mysqld instead of mysqld-akonadi. You can change that in Systemsettings -> Advanced -> Akonadi -> Server configuration.
* AppArmor is not setup correctly for mysqld-akonadi either. Try running the aa-complain command noted above with mysqld-akonadi instead of mysqld.

---

You will also experience this problem if you are running an encrypted home directory using encryptfs combined with AppArmor as the Akonadi apparmor profile currently does not account for an ecrypted home (common with Ubuntu Jaunty users). Error messages with include:

* dmesg produces:

ecryptfs_do_create: Failure to create dentry in lower fs; rc = [-13]
ecryptfs_create: Failed to create file inlower filesystem

* Akonadi will list the following errors:

Akonadi server process not registered at D-Bus

The fix is to edit the following file "/etc/apparmor.d/usr.sbin.mysqld-akonadi". Below the line:

@{HOME}/.local/share/akonadi/** rwk,

Add a new line:

@{HOME}/.Private/** rwk,

Restart apparmor and restart akonadi.


And so, akonadi works so far. I haven't thoroughly tested it, so we'll see how things go.

No comments: