You are not logged in.

#1 2022-06-11 01:19:41

lfitzgerald
Member
Registered: 2021-07-16
Posts: 175

[SOLVED] Kmail breaks due to akonadi error about MySql

Apparently some recent (past 6 months?) updates have broken Kmail. The symptoms look like this:

* Kmail takes a very long time to start
* When it starts, you get an error about Akonadi failing to work
* If you do "akonadictl status" it will probably be stopped
* "akonadictl start" prints an error about MySQL and "unknown error"

It's very annoying to troubleshoot and Google didn't help me much. I did find many other people scratching their heads like https://askubuntu.com/q/1407756. I have no idea what kind tomfoolery KDE developers are getting up to - but in my case I had some important work emails to deal with and didn't have the luxury of investigating. Their forum and bug tracker sucks too. Unfortunately as far as mail clients go the selection is not great.

Anyways, I think I found a strange workaround: Akonadi can use different storage backends like MySQL, Postgres, SQLite. It's explained in https://wiki.archlinux.org/title/KDE#Akonadi . Switching this to Postgres or Sqlite unbreaks Kmail. It had to redownload all the emails (IMAP), but I didn't lose anything. The funny thing is that if you switch it back to MySQL after, that works too. So the steps to fix are:

* Run "akonadictl start" to confirm you get the "unknown error" about MySql (Ctrl+C will exit the akonadi service)
* Run "akonadictl status" to confirm it's stopped
* Edit "~/.config/akonadi/akonadiserverrc"
* Under "[%General]" change "Driver=QMYSQL" to "Driver=QPSQL" (no idea what's the deal with this weird conf syntax)
* Do "akonadictl start" and if everything worked it will now print some nicer output
* Without exiting akonadi, open Kmail - hopefully it should work now
* Close Kmail, Ctrl+C out of Akonadi (do "akonadictl stop" if necessary), change "Driver" back to "QMYSQL"
* Try "akonadictl start" and now mysql should also work
* Try Kmail again and that should work also

It's a very annoying problem to troubleshoot, and I still have no idea what exactly is the cause, but the above seems to fix it.

Offline

#2 2022-06-11 10:04:31

Termy
Member
Registered: 2019-11-06
Posts: 43

Re: [SOLVED] Kmail breaks due to akonadi error about MySql

THANK YOU!
This is a much more convenient workaround than downgrading mariadb, backup and so on smile
Had to redo my favorites and the trash/sent/drafts folders for every account though as they were jumbled around quite randomly….

I think i'll leave it on postgres and hope that doesn't break as often as mariadb does ^^

Last edited by Termy (2022-06-11 10:05:07)

Offline

#3 2022-06-11 12:23:22

Lanz
Member
From: Ontario, Canada
Registered: 2015-01-24
Posts: 11

Re: [SOLVED] Kmail breaks due to akonadi error about MySql

This bug can also be fixed with a single command rather than the above sequence of steps:

touch ~/.local/share/akonadi/db_data/ib_logfile0

Offline

#4 2022-06-11 12:26:52

Termy
Member
Registered: 2019-11-06
Posts: 43

Re: [SOLVED] Kmail breaks due to akonadi error about MySql

Lanz wrote:

This bug can also be fixed with a single command rather than the above sequence of steps:

touch ~/.local/share/akonadi/db_data/ib_logfile0

That only worked till the next reboot for me unfortunately...

Offline

#5 2022-06-11 17:50:24

Nightwulf
Member
Registered: 2016-05-08
Posts: 13

Re: [SOLVED] Kmail breaks due to akonadi error about MySql

Termy wrote:
Lanz wrote:

This bug can also be fixed with a single command rather than the above sequence of steps:

touch ~/.local/share/akonadi/db_data/ib_logfile0

That only worked till the next reboot for me unfortunately...

For me it worked also after a reboot. Thanks @Lanz!

Offline

Board footer

Powered by FluxBB