Akonadi dead after I tried to set up archiving of e-mail folders in KMail

How I got to this point

I have a fairly substantial inbox that is divided into cca. two dozen (sub)folders.

Since throughout the years I have had the odd issue with e-mail bodies¹ disappearing etc. on my IMAP resource (as well as tasks¹ on my Nextcloud WebDAV), I decided it may be a good idea to set up archiving in KMail to automatically move all e-mail that is older than 5 years to a local MailDir, since that one will get caught by my regular daily backups.

For this, in KMail I:

  • went into folder settings of a few important folders on my primary IMAP resource
  • set the expiry for both read and unread mail to 1825 days
  • selected the folder to archive to (which I previously created through the same dialogue)
  • clicked the button to apply the archiving settings and then the main OK button

¹ Something that I still think is Akonadi’s fault, and not on the server side. But due to its random nature and lack of symptoms it is very hard to debug.

Problem

I was surprised that the CPU and memory consumption did not rise in any noticeable way, but did not think too much of it – probably SQLite, I thought. The same about things moving very slowly, if at all.

Then I started getting error pop-ups that said nothing – miniature pop-up window with an error icon, no text, and an OK button.

After a while I decided to restart Akonadi server through the Akonadi Console.

Some resources did not come back up.

So I decided to log out and log in again.

Now Akonadi won’t even start, which is quite a pain, TBH.

Akonadi self-test report:

Akonadi Server Self-Test Report===============================
Test 1:  SUCCESS
--------

Database driver found.
Details: The QtSQL driver 'QSQLITE' is required by your current Akonadi server configuration and was found on your system.

File content of '/home/hook/.config/akonadi/akonadiserverrc':
[Debug]
Tracer=null

[%General]
Driver=QSQLITE

[QSQLITE]
Name=/home/hook/.local/share/akonadi/akonadi.db


Test 2:  SUCCESS
--------

Akonadi is not running as root
Details: Akonadi is not running as a root/administrator user, which is the recommended setup for a secure system.

Test 3:  SKIP
--------

MySQL server executable not tested.
Details: The current configuration does not require an internal MySQL server.

Test 4:  SKIP
--------

MySQL server error log not tested.
Details: The current configuration does not require an internal MySQL server.

Test 5:  SKIP
--------

MySQL server configuration not tested.
Details: The current configuration does not require an internal MySQL server.

Test 6:  SUCCESS
--------

akonadictl found and usable
Details: The program '/usr/bin/akonadictl' to control the Akonadi server was found and could be executed successfully.
Result:
akonadictl 6.7.3 (26.04.3)


Test 7:  ERROR
--------

Akonadi control process not registered at D-Bus.
Details: The Akonadi control process is not registered at D-Bus which typically means it was not started or encountered a fatal error during startup.

Test 8:  SUCCESS
--------

Akonadi server process registered at D-Bus.
Details: The Akonadi server process is registered at D-Bus which typically indicates it is operational.

Test 9:  SKIP
--------

Protocol version check not possible.
Details: Without a connection to the server it is not possible to check if the protocol version meets the requirements.

Test 10:  ERROR
--------

No resource agents found.
Details: No resource agents have been found, Akonadi is not usable without at least one. This usually means that no resource agents are installed or that there is a setup problem. The following paths have been searched: '/usr/share/akonadi/agents'. The XDG_DATA_DIRS environment variable is set to '/home/hook/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share'; make sure this includes all paths where Akonadi agents are installed.

Directory listing of '/usr/share/akonadi/agents':
akonadiindexingagent.desktop
archivemailagent.desktop
birthdaysresource.desktop
contactsresource.desktop
davgroupwareresource.desktop
etesyncresource.desktop
ewsmtaresource.desktop
ewsresource.desktop
followupreminder.desktop
googleresource.desktop
icaldirresource.desktop
icalresource.desktop
imapresource.desktop
knutresource.desktop
kolabresource.desktop
maildirresource.desktop
maildispatcheragent.desktop
mailfilteragent.desktop
mailmergeagent.desktop
mboxresource.desktop
migrationagent.desktop
mixedmaildirresource.desktop
newmailnotifieragent.desktop
openxchangeresource.desktop
pop3resource.desktop
sendlateragent.desktop
unifiedmailboxagent.desktop
vcarddirresource.desktop
vcardresource.desktop

Environment variable XDG_DATA_DIRS is set to '/home/hook/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share'

Test 11:  SUCCESS
--------

No current Akonadi server error log found.
Details: The Akonadi server did not report any errors during its current startup.

Test 12:  SUCCESS
--------

No previous Akonadi server error log found.
Details: The Akonadi server did not report any errors during its previous startup.

Test 13:  SUCCESS
--------

No current Akonadi control error log found.
Details: The Akonadi control process did not report any errors during its current startup.

Test 14:  SUCCESS
--------

No previous Akonadi control error log found.
Details: The Akonadi control process did not report any errors during its previous startup.

Help needed

It goes without saying, this is quite a pickle I’m in now.

Help would be very appreciated.

Any ideas beyond just nuking the whole Akonadi config and re-creating all the resources?

On the topic of starting from a clean slate – what does one have to do these days to “factory reset” Akonadi?