I upgraded Ubuntu 19.04 to 19.10 and Akonadi (5.11.3) does not start after rebooting. When I try to start the akonadi server in the command line this is what I get:
~$ akonadictl start
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-akonadi" 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/1001/akonadi/default/mysql.socket", "--pid-file=/run/user/1001/akonadi/default/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" mysqladmin: connect to server at 'localhost' failed error: 'Can't connect to local MySQL server through socket '/run/user/1001/akonadi/default/mysql.socket' (2)' Check that mysqld is running and that the socket: '/run/user/1001/akonadi/default/mysql.socket' exists!
org.kde.pim.akonadiserver: Failed to remove runtime connection config file org.kde.pim.akonadiserver: Shutting down AkonadiServer...
I check the mysql.err file with the following input.
~$ cat ~/.local/share/akonadi/db_data/mysql.err
2019-10-19T11:27:02.910707Z 0 [Warning] [MY-010097] [Server] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.
2019-10-19T11:27:02.910736Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.17-0ubuntu2) starting as process 8385
2019-10-19T11:27:02.912513Z 0 [Warning] [MY-013242] [Server] --character-set-server: 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
2019-10-19T11:27:02.912523Z 0 [Warning] [MY-013244] [Server] --collation-server: 'utf8_general_ci' is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead. 2019-10-19T11:27:02.917836Z 1 [System] [MY-011012] [Server] Starting upgrade of data directory.
2019-10-19T11:27:03.171213Z 1 [ERROR] [MY-010781] [Server] Found ./mysql/index_stats.frm file in mysql schema. DD will create .ibd file with same name. Please rename table and start upgrade process again.
2019-10-19T11:27:03.171223Z 1 [ERROR] [MY-010336] [Server] Found .frm file with same name as one of the Dictionary Tables.
2019-10-19T11:27:03.171330Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2019-10-19T11:27:03.171338Z 0 [ERROR] [MY-013236] [Server] The designated data directory /home/me/.local/share/akonadi/db_data/ is unusable. You can remove all files that the server added to it.
2019-10-19T11:27:03.697829Z 0 [ERROR] [MY-010065] [Server] Failed to shutdown components infrastructure.
2019-10-19T11:27:03.171475Z 0 [ERROR] [MY-010119] [Server] Aborting
2019-10-19T11:27:03.697752Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.17-0ubuntu2) (Ubuntu).
Why Akonadi does not start after upgrade from Ubuntu 19.04 to 19.10? Is this connected to the upgrade to mysql 8.0? How can this be solved?
Getting the same trouble, akonadi not running because of MySQL after the upgrade. For me installing MariaDB is not an option, because of my work. I was using MariaDB before and I had to switch to MySQL.
These are the error and warnings I am getting.
First will get rid of noisy warnings
vim /home/mathieu/.local/share/akonadi/mysql.conf
replace
character_set_server=utf8
to become utf8mb4 comment outcollation_server=
according to this doc, default is good https://dev.mysql.com/doc/refman/8.0/en/charset-server.htmlI don't think we can do anything about
secure_file_priv=
I believe akonadi needs it empty to be able to load files from arbitrary locations. doc: https://dev.mysql.com/doc/refman/8.0/en/string-functions.htmlthen, the actual error
Failed to find valid data directory
since akonadi is mostly temporary data, I think the easiest is to kill the db_data directory and start over. we'll rename the folder instead of deleting it
the
--initialize
option starts thedb_data
dir fresh. if you compare both dir, you will see a bunch of files that are different from the previous one.now getting this error
I am switching this option
lower_case_table_names=
in mysql.conf from 1 to 0you also need to comment out this deprecated option
log_warnings=2
I am no longer calling mysqld-akonadi directly, with the long set of arguments, but simply running
akonadiserver
andcat
ing the mysql.error log filegetting this error now
[Server] unknown variable 'query_cache_size=0'
will comment this one on
also need to comment out
query_cache_type=0
and akonadi is able to run with MySQL 8
In Summary:
Hope this helps
Update: if you are getting this error
it means the column was already added, but the database migration was not flagged as done. I would recommend killing off the
db_data
folder again, running the initialize manually. and starting akonadiserverits finally running for me. and korganizer that was constantly crashing in 19.04 now runs ;)
Update (2020): Be very careful of this bug when resetting your Akonadi DB https://bugs.kde.org/show_bug.cgi?id=414400
Since 19.10, I had too many issues. Neither MariaDB or MySQL 8 worked fine. Kept having to reset Akonadi. Finally ran MySQL 5.6 and 5.7 via Docker
sudo docker run --name mysql57 --rm -p 3306:3306 -v /var/lib/mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=docker -d mysql:5.7
but kept having issues. I gave up on Akonadi/kdepim, uninstalled all related packages and switch to Thunderbird. Plasma runs smoothly.
mariadb should now be used. mysql 8 is not comapatible.
I also had Akonadi problems since updating from Kubuntu 19.04 to 19.10. The mysql log file
~/.local/share/akonadi/db_data/mysql.err
contained errors like:So, I commented those out in
/home/NNN/.local/share/akonadi/mysql.conf
:To be honest, I didn't care, what variables were changed and what the consequences would be...
The error is saying that there is a user table in MySQL with the name
index_stats
which seems strange. Unless you or one of the programs you use created that table.In other words you can't have tables with that name anymore because MySQL 8.0 uses a table with that name.
You can try renaming the file to something like
index_stats_bak.frm
but its hard to say what will happen to whatever program uses that.This post has a list of table names that are now used by the system,
index_stats
among them.Looking at the source for Akonadi that creates tables it seems very unlikely there would be a conflict with MySQL 8. My guess is that there was a partial upgrade of MySQL that has left the part of the new tables but not all. index_stats was probably created in that partial update.