添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

Stack Exchange Network

Stack Exchange network consists of 183 Q&A communities including Stack Overflow , the largest, most trusted online community for developers to learn, share their knowledge, and build their careers. Visit Stack Exchange

Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.

Sign up to join this community

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

Konact / KMail does not want to start anymore, because Akonadi fails. I am not able to start akonadi

~$ akonadictl --verbose start
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:  "/usr/bin/mysql_install_db"
org.kde.pim.akonadiserver: Found mysqlcheck:  "/usr/bin/mysqlcheck"
org.kde.pim.akonadiserver: Using mysqld: "/usr/sbin/mysqld-akonadi"
org.kde.pim.akonadicontrol: Service ":1.89" owner changed from "" to ":1.89"
org.kde.pim.akonadicontrol: Service ":1.90" owner changed from "" to ":1.90"
org.kde.pim.akonadiserver: mysqld reports version 10.3.34 (MariaDB)
org.kde.pim.akonadiserver: Executing: "/usr/sbin/mysqld-akonadi" "--defaults-file=/home/raeg/.local/share/akonadi/mysql.conf --datadir=/home/raeg/.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-akonadi"
org.kde.pim.akonadiserver: arguments: ("--defaults-file=/home/raeg/.local/share/akonadi/mysql.conf", "--datadir=/home/raeg/.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: "2022-05-10 15:12:03 0 [Note] /usr/sbin/mysqld-akonadi (mysqld 10.3.34-MariaDB-0ubuntu0.20.04.1) starting as process 7312 ...\n"
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: Failed to remove runtime connection config file
org.kde.pim.akonadiserver: Shutting down AkonadiServer...
org.kde.pim.akonadicontrol: Service ":1.90" owner changed from ":1.90" to ""
org.kde.pim.akonadicontrol: Application '/usr/bin/akonadiserver' exited normally...

Trying to update MariaDB

I read, that I should update MariaDB, but I do not know how.

~$ sudo systemctl restart mariadb
Failed to restart mariadb.service: Unit mariadb.service not found.
~$ sudo mysql_upgrade
Reading datadir from the MariaDB server failed. Got the following error when executing the 'mysql' command line client
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
FATAL ERROR: Upgrade failed
~$ sudo mariadb-upgrade
sudo: mariadb-upgrade: Command not found
~$ mariadb --version
mariadb  Ver 15.1 Distrib 10.3.34-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

Then I ran

curl -LsS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash -s -- --mariadb-server-version=10.8
sudo apt update && sudo apt upgrade -y
~$ mariadb --version
mariadb  Ver 15.1 Distrib 10.3.34-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

But as one can see, that did not change much.

I read, https://bbs.archlinux.org/viewtopic.php?id=184192, that the update to MariaDB version 10 might be the problem. It suggests to downgrade and then do some stuff and then upgrade again. However, that article is from 2014, so I am not sure that it still applies.

AppArmor

According to Upgrade to Ubuntu 20.04.2 LTS breaks Akonadi and thus KMail it might be an issue with apparmor, so I ran

sudo systemctl disable apparmor

and rebooted, but that did not help.

What can I do?

I tried the answer of Make42, but it did not work at first. Then I edited /root/.local/share/akonadi/mysql.conf and added the line

user=root

in the [mysqld] section. Then akonadictl start worked.

I am not sure why, but this helped:

  • I renamed ~/.local/share/akonadi/mysql.conf to ~/.local/share/akonadi/mysql.conf_backup.
  • Then I restarted akonadi with akonadictl start.
  • The file mysql.conf was recreated (identical to the original file mysql.conf_backup) and now everything works again.