0

Ubuntu 22.04 with KDE Plasma desktop environment.

I installed KOrganizer and have been using it without error for an entire month.

Today, when I tried to open it, it gave me an error

The Akonadi personal information management service is not operational.

[Details]

Selecting "Details" does nothing.

This Unix.SE post has a similar problem caused by a missing ~/.local/share/akonadi/db_data/ directory. I've confirmed that I do have this directory, so this is not my problem. However, the troubleshooting method explained there is quite useful. If I try to start Akonadi manually, I get this error output:

$ akonadictl start
org.kde.pim.akonadictl: Starting Akonadi Server...
org.kde.pim.akonadictl:    done.
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
org.kde.pim.akonadiserver: Starting up the Akonadi Server...
org.kde.pim.akonadiserver: database server stopped unexpectedly
org.kde.pim.akonadiserver: Database process exited unexpectedly during initial connection!
org.kde.pim.akonadiserver: executable: "/usr/sbin/mysqld"
org.kde.pim.akonadiserver: arguments: ("--defaults-file=/home/me/.local/share/akonadi/mysql.conf", "--datadir=/home/me/.local/share/akonadi/db_data/", "--socket=/run/user/1000/akonadi/mysql.socket", "--pid-file=/run/user/1000/akonadi/mysql.pid")
org.kde.pim.akonadiserver: stdout: ""
org.kde.pim.akonadiserver: stderr: "mysqld: [ERROR] Failed to open required defaults file: /home/me/.local/share/akonadi/mysql.conf\nmysqld: [ERROR] Fatal error in defaults handling. Program aborted!\n"
org.kde.pim.akonadiserver: exit code: 1
org.kde.pim.akonadiserver: process error: "Unknown error"
org.kde.pim.akonadiserver: Shutting down AkonadiServer...
org.kde.pim.akonadicontrol: Application '/usr/bin/akonadiserver' exited normally...

The key output here seems to be

org.kde.pim.akonadiserver: stderr: "mysqld: [ERROR] Failed to open required defaults file: /home/me/.local/share/akonadi/mysql.conf\nmysqld: [ERROR] Fatal error in defaults handling. Program aborted!\n"

This refers to the defaults file ~/.local/share/akonadi/mysql.conf, which I have, and which I have never edited. In fact, the ls touchstamp shows that it has not been changed since the day it was installed. It worked previously, and there's simply no reason why it should fail to work now.

What do I do to get my calendar back? I kind of need it.

Background

I have no idea if the following is relevant, an expert might be able to say better.

I installed MySQL 8.0 via the package mysql-server over a week ago. One result of this is that the akonadi package akonadi-backend-mysql was removed because it's mutually exclusive with mysql-server-8.0. I don't have any way of knowing, but I'm left to assume that when you install MySQL proper, Akonadi switches from its built-in MySQL backend to the new one.

In any event, please note that my KOrganizer continued to work just fine until today, so I don't believe that the package replacement akonadi-backend-mysql -> mysql-server alone can account for the error. The only OS-level thing that changed between installing mysql-server a week ago and KOrganizer breaking today is that I installed kde-spectacle and I ran apt upgrade, but neither of these touched any packages related to "mysql" or "akonadi" (I keep notes).

One possibility that I don't have the capacity or knowledge to research further is that the original Akonadi config in ~/.local/share/akonadi/mysql.conf is for a different version of MySQL that didn't update in the switch to MySQL 8.0, so there's some backwards-incompatibility there that prevents Akonadi from loading that config. Hoping an expert can chime in on this.

It's clear that I can continue researching the problem, but I've exhausted all the time I have available at the moment. I'm posting now in case someone has any clear, relevant information to offer until I can get back to it.

Edit

Based on this answer to the posted question, I checked /var/log/syslog and found this error involving an AppArmor "DENIED" status, similar to that poster:

Sep  8 19:14:36 System kernel: [18324.122061] audit: type=1400 audit(1662678876.760:93): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/home/me/.local/share/akonadi/mysql.conf" pid=9361 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000

Following their solution, I added the lines

  /{,var/}run/user/[0-9]*/akonadi/** rw,
  /home/*/.local/share/akonadi/** rwk,

(indented by two spaces and inside the curly braces, just like the rest of the file's contents) to /etc/apparmor.d/usr.sbin.mysqld. I then restarted AppArmor successfully. I then tried to restart Akonadi again, with this result:

$ akonadictl --verbose start
org.kde.pim.akonadictl: Starting Akonadi Server...
org.kde.pim.akonadictl:    done.
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
org.kde.pim.akonadiserver: Starting up the Akonadi Server...
org.kde.pim.akonadiserver: Found mysql_install_db:  ""
org.kde.pim.akonadiserver: Found mysqlcheck:  "/usr/bin/mysqlcheck"
org.kde.pim.akonadiserver: Using mysqld: "/usr/sbin/mysqld"
org.kde.pim.akonadiserver: mysqld reports version 8.0.30 (Oracle MySQL)
org.kde.pim.akonadiserver: Executing: "/usr/sbin/mysqld" "--defaults-file=/home/me/.local/share/akonadi/mysql.conf --datadir=/home/me/.local/share/akonadi/db_data/ --socket=/run/user/1000/akonadi/mysql.socket --pid-file=/run/user/1000/akonadi/mysql.pid"
org.kde.pim.akonadiserver: database server stopped unexpectedly
org.kde.pim.akonadiserver: Database process exited unexpectedly during initial connection!
org.kde.pim.akonadiserver: executable: "/usr/sbin/mysqld"
org.kde.pim.akonadiserver: arguments: ("--defaults-file=/home/me/.local/share/akonadi/mysql.conf", "--datadir=/home/me/.local/share/akonadi/db_data/", "--socket=/run/user/1000/akonadi/mysql.socket", "--pid-file=/run/user/1000/akonadi/mysql.pid")
org.kde.pim.akonadiserver: stdout: ""
org.kde.pim.akonadiserver: stderr: ""
org.kde.pim.akonadiserver: exit code: 1
org.kde.pim.akonadiserver: process error: "Unknown error"
org.kde.pim.akonadiserver: terminating connection threads
org.kde.pim.akonadiserver: terminating service threads
org.kde.pim.akonadiserver: stopping db process
org.kde.pim.akonadiserver: Shutting down AkonadiServer...
org.kde.pim.akonadicontrol: Application '/usr/bin/akonadiserver' exited normally...

It still fails, and this time there's not even an actual error code.

The only line this adds to /var/log/syslog is

Sep  8 19:42:44 System /usr/libexec/gdm-x-session[2234]: qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 16746, resource id: 117440517, major code: 18 (ChangeProperty), minor code: 0

I have no clue what any of that means.

So it seems like there was an AppArmor problem with Akonadi, but after resolving that there's still additional mystery errors that I still need help resolving.

Darien Marks
  • 163
  • 1
  • 2
  • 11

0 Answers0