Akonadi PIM service not operational

Ever since the latest update, Kontact loads with the error: “The Akonadi personal information management service is not operational.” When I check for the service in Yast’s Service Manager, no Akonadi service is listed. When I try to restart the service from the terminal, I get:

:~$ sudo akonadictl start
[sudo] password for root:
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to ‘/tmp/runtime-root’
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to ‘/tmp/runtime-root’
D-Bus session bus is not available!
KCrash: Application ‘akonadictl’ crashing…
KCrash: Attempting to start /usr/libexec/drkonqi
qt.qpa.plugin: Could not load the Qt platform plugin “xcb” in “” even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application ma
y fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-x
composite-egl, wayland-xcomposite-glx, xcb.

Unable to start Dr. Konqi
Re-raising signal for core dump handling.
Aborted

I checked the Yast Software manager, and all the appropriate Akonadi modules seem to be installed. Any ideas?

Don’t sudo. Run it as user:

karl@erlangen:~> akonadictl status 
Akonadi Control: running 
Akonadi Server: running 
Akonadi Server Search Support: available (Remote Search) 
Available Agent Types: akonadi_akonotes_resource, akonadi_archivemail_agent, akonadi_birthdays_resource, akonadi_contacts_resource, akonadi_davgroupware_resource, akonadi_ews_resource, akonadi_ewsmta_resource, akonadi_followupreminder_age
nt, akonadi_google_resource, akonadi_ical_resource, akonadi_icaldir_resource, akonadi_imap_resource, akonadi_indexing_agent, akonadi_knut_resource, akonadi_kolab_resource, akonadi_maildir_resource, akonadi_maildispatcher_agent, akonadi_ma
ilfilter_agent, akonadi_mailmerge_agent, akonadi_mbox_resource, akonadi_migration_agent, akonadi_mixedmaildir_resource, akonadi_newmailnotifier_agent, akonadi_notes_agent, akonadi_notes_resource, akonadi_openxchange_resource, akonadi_pop3
_resource, akonadi_sendlater_agent, akonadi_tomboynotes_resource, akonadi_unifiedmailbox_agent, akonadi_vcard_resource, akonadi_vcarddir_resource 
karl@erlangen:~> 

They improved this fine chapter: https://docs.kde.org/stable5/en/kmail/kmail2/troubleshooting.html

Please be careful! Running as root could be dangerous to your system!

Akonadi is an integral part of the KDE/Plasman desktop. And the desktop is run by and end-user.

OK, ran as user. Different error, but still doesn’t work.

:~$ akonadictl start
org.kde.pim.akonadictl: Starting Akonadi Server...
org.kde.pim.akonadictl:    done.
bob@localhost:~$ Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QStri
ng)
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/bob/.local/share/akonadi/mysql.conf", "--datadir=/home
/bob/.local/share/akonadi/db_data/", "--socket=/run/user/1000/akonadi/mysql.socket", "--pid-file=/run/user/1000/akon
adi/mysql.pid")
org.kde.pim.akonadiserver: stdout: ""
org.kde.pim.akonadiserver: stderr: "2022-09-06  8:27:17 0 [Note] /usr/sbin/mysqld (server 10.8.3-MariaDB) starting a
s process 27315 ...
"
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...

You may post:

karl@erlangen:~> journalctl -b -g mysql 
**Hint: You are currently not seeing messages from other users and the system.**
**      Users in the 'systemd-journal' group can see all messages. Pass -q to**
**      turn off this notice.**
Sep 05 07:28:54 erlangen akonadiserver[1661]: **org.kde.pim.akonadiserver: "Deadlock found when trying to get lock; try restarting transaction Q****MYSQL****3: Unable to execute statement"**
Sep 05 07:30:48 erlangen akonadiserver[1661]: **org.kde.pim.akonadiserver: "Deadlock found when trying to get lock; try restarting transaction Q****MYSQL****3: Unable to execute statement"**
Sep 05 07:30:48 erlangen akonadiserver[1661]: **org.kde.pim.akonadiserver: "Deadlock found when trying to get lock; try restarting transaction Q****MYSQL****3: Unable to execute statement"**
Sep 05 22:06:57 erlangen akonadiserver[16438]: **org.kde.pim.akonadiserver: "Deadlock found when trying to get lock; try restarting transaction Q****MYSQL****3: Unable to execute statement"**
Sep 06 09:11:21 erlangen akonadiserver[16438]: **org.kde.pim.akonadiserver: "Deadlock found when trying to get lock; try restarting transaction Q****MYSQL****3: Unable to execute statement"**
Sep 06 09:36:26 erlangen akonadiserver[16438]: **org.kde.pim.akonadiserver: "Deadlock found when trying to get lock; try restarting transaction Q****MYSQL****3: Unable to execute statement"**
Sep 06 09:39:40 erlangen akonadiserver[16438]: **org.kde.pim.akonadiserver: "Deadlock found when trying to get lock; try restarting transaction Q****MYSQL****3: Unable to execute statement"**
Sep 06 13:21:32 erlangen akonadiserver[16438]: **org.kde.pim.akonadiserver: "Deadlock found when trying to get lock; try restarting transaction Q****MYSQL****3: Unable to execute statement"**
Sep 06 13:34:43 erlangen akonadiserver[16438]: **org.kde.pim.akonadiserver: "Deadlock found when trying to get lock; try restarting transaction Q****MYSQL****3: Unable to execute statement"**
Sep 06 13:36:17 erlangen akonadiserver[16438]: **org.kde.pim.akonadiserver: "Deadlock found when trying to get lock; try restarting transaction Q****MYSQL****3: Unable to execute statement"**
karl@erlangen:~> 
:~$ journalctl -b -g mysql  
**Hint: You are currently not seeing messages from other users and the system.**
**      Users in the 'systemd-journal' group can see all messages. Pass -q to**
**      turn off this notice.**
**No journal files were opened due to insufficient permissions.**

:~$ sudo journalctl -b -g mysql  
[sudo] password for root:  
Sep 05 22:09:04 localhost.localdomain akonadiserver[4151]: **org.kde.pim.akonadiserver: executable: "/usr/sbin/****mysql****d"**
Sep 05 22:09:04 localhost.localdomain akonadiserver[4151]: **org.kde.pim.akonadiserver: arguments: ("--defaults-file=/home/bob/.local/share/akonadi/****mysql****.conf", "--datadir=/home/bob/.local/share/akonadi/db_data/", "--socket=/run/user/1000/akonadi/mysql.socket", "--pid-f**>
Sep 05 22:09:04 localhost.localdomain akonadiserver[4151]: **org.kde.pim.akonadiserver: stderr: "2022-09-05 22:08:59 0 [Note] /usr/sbin/****mysql****d (server 10.8.3-MariaDB) starting as process 4174 ...
"**
Sep 05 22:09:47 localhost.localdomain akonadiserver[4323]: **org.kde.pim.akonadiserver: executable: "/usr/sbin/****mysql****d"**
Sep 05 22:09:47 localhost.localdomain akonadiserver[4323]: **org.kde.pim.akonadiserver: arguments: ("--defaults-file=/home/bob/.local/share/akonadi/****mysql****.conf", "--datadir=/home/bob/.local/share/akonadi/db_data/", "--socket=/run/user/1000/akonadi/mysql.socket", "--pid-f**>
Sep 05 22:09:47 localhost.localdomain akonadiserver[4323]: **org.kde.pim.akonadiserver: stderr: "2022-09-05 22:09:42 0 [Note] /usr/sbin/****mysql****d (server 10.8.3-MariaDB) starting as process 4329 ...
"**
Sep 05 22:17:56 localhost.localdomain akonadiserver[10837]: **org.kde.pim.akonadiserver: executable: "/usr/sbin/****mysql****d"**
Sep 05 22:17:56 localhost.localdomain akonadiserver[10837]: **org.kde.pim.akonadiserver: arguments: ("--defaults-file=/home/bob/.local/share/akonadi/****mysql****.conf", "--datadir=/home/bob/.local/share/akonadi/db_data/", "--socket=/run/user/1000/akonadi/mysql.socket", "--pid-**>
Sep 05 22:17:56 localhost.localdomain akonadiserver[10837]: **org.kde.pim.akonadiserver: stderr: "2022-09-05 22:17:51 0 [Note] /usr/sbin/****mysql****d (server 10.8.3-MariaDB) starting as process 10843 ...
"**
Sep 05 22:18:29 localhost.localdomain akonadiserver[11525]: **org.kde.pim.akonadiserver: executable: "/usr/sbin/****mysql****d"**
Sep 05 22:18:29 localhost.localdomain akonadiserver[11525]: **org.kde.pim.akonadiserver: arguments: ("--defaults-file=/home/bob/.local/share/akonadi/****mysql****.conf", "--datadir=/home/bob/.local/share/akonadi/db_data/", "--socket=/run/user/1000/akonadi/mysql.socket", "--pid-**>
Sep 05 22:18:29 localhost.localdomain akonadiserver[11525]: **org.kde.pim.akonadiserver: stderr: "2022-09-05 22:18:24 0 [Note] /usr/sbin/****mysql****d (server 10.8.3-MariaDB) starting as process 11532 ...
"**
Sep 06 08:28:55 localhost.localdomain akonadiserver[27537]: **org.kde.pim.akonadiserver: executable: "/usr/sbin/****mysql****d"**
Sep 06 08:28:55 localhost.localdomain akonadiserver[27537]: **org.kde.pim.akonadiserver: arguments: ("--defaults-file=/home/bob/.local/share/akonadi/****mysql****.conf", "--datadir=/home/bob/.local/share/akonadi/db_data/", "--socket=/run/user/1000/akonadi/mysql.socket", "--pid-**>
Sep 06 08:28:55 localhost.localdomain akonadiserver[27537]: **org.kde.pim.akonadiserver: stderr: "2022-09-06  8:28:50 0 [Note] /usr/sbin/****mysql****d (server 10.8.3-MariaDB) starting as process 27556 ...
"**

Your ‘sudo akonadictl start’ created a mess. Never do that again. From a root shell run ‘chown -R bob:users ~bob’. Then as user bob run ‘akonadictl start’.

Thanks! Did that, and got the following:

:~$ akonadictl start
org.kde.pim.akonadictl: Starting Akonadi Server...
org.kde.pim.akonadictl:    done.
bob@localhost:~$ Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QStri
ng)
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/bob/.local/share/akonadi/mysql.conf", "--datadir=/home
/bob/.local/share/akonadi/db_data/", "--socket=/run/user/1000/akonadi/mysql.socket", "--pid-file=/run/user/1000/akon
adi/mysql.pid")
org.kde.pim.akonadiserver: stdout: ""
org.kde.pim.akonadiserver: stderr: "2022-09-06 13:36:37 0 [Note] /usr/sbin/mysqld (server 10.8.3-MariaDB) starting a
s process 6035 ...
"
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...

Same error as before when starting Kontact.

They improved this fine chapter: https://docs.kde.org/stable5/en/kmail/kmail2/troubleshooting.html

I checked that page. Nothing that they suggest will run because neither the akonadi nor mysqld servers will load.

Presumably you may delete /home/bob/.local/share/akonadi/mysql.conf and/home/bob/.local/share/akonadi/db_data/ and retry. Have backups and run akonadictl stop before trying.

I renamed mysql.conf first, the that didn’t fix anything. I then renamed /home/bob/.local/share/akonadi, restarted akonadi, then ran Kontact. I had to re-input my calendar server, but everything else reloaded from the remote servers. All seems to be working now. I had to do this about a year ago, and remembered it after my previous message here. Odd that this occurs about annually.

Thanks to all for your help!

Thanks for the feedback! The have a worst case repair, which applies to most errors: https://docs.kde.org/stable5/en/kmail/kmail2/dealing-with-dirt.html

I had a similar Akonadi crash in Tumbleweed. What I did is a downgrade of MariaDB via snapper rollback.

Akonadi started then a crash recovery of the database. It is now operational again.

Best regards,
Bequimão