2

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?

2

mariadb should now be used. mysql 8 is not comapatible.

sudo apt install mariadb-server-core-10.3 mariadb-client-core-10.3
| improve this answer | |
  • 1
    Thanks @BrianH This solved the problem! – Eduard Oct 28 '19 at 7:47
5

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.

   1   │ 2019-11-17T22:14:02.183446Z 0 [Warning] [MY-010097] [Server] Insecure configuration for --secure-file-priv: C
       │ urrent value does not restrict location of generated files. Consider setting it to a valid, non-empty path.
   2   │ 2019-11-17T22:14:02.183483Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.17-0ubuntu2) startin
       │ g as process 30942
   3   │ 2019-11-17T22:14:02.186416Z 0 [Warning] [MY-013242] [Server] --character-set-server: 'utf8' is currently an a
       │ lias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider usi
       │ ng UTF8MB4 in order to be unambiguous.
   4   │ 2019-11-17T22:14:02.186429Z 0 [Warning] [MY-013244] [Server] --collation-server: 'utf8_general_ci' is a colla
       │ tion of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation ins
       │ tead.
   5   │ 2019-11-17T22:14:02.194794Z 1 [ERROR] [MY-011011] [Server] Failed to find valid data directory.
   6   │ 2019-11-17T22:14:02.194929Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
   7   │ 2019-11-17T22:14:02.195077Z 0 [ERROR] [MY-010119] [Server] Aborting
   8   │ 2019-11-17T22:14:02.195315Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.1
       │ 7-0ubuntu2)  (Ubuntu).

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 out collation_server= according to this doc, default is good https://dev.mysql.com/doc/refman/8.0/en/charset-server.html

I 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.html

then, 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

$ cd ~/.local/share/akonadi
$ mv db_data db_databkp
$ mkdir db_data
$ /usr/sbin/mysqld-akonadi --defaults-file=/home/mathieu/.local/share/akonadi/mysql.conf --datadir=/home/mathieu/.local/share/akonadi/db_data/ --socket=/run/user/1000/akonadi/default/mysql.socket --pid-file=/run/user/1000/akonadi/default/mysql.pid --initialize --console

the --initialize option starts the db_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

[ERROR] [MY-011087] [Server] Different lower_case_table_names settings for server ('1') and data dictionary ('0').

I am switching this option lower_case_table_names= in mysql.conf from 1 to 0

you 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 and cating the mysql.error log file

getting 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:

  • utf8 to utf8mb4 is a good change, leaving both commented out is the new default
  • comment out the 4 deprecated options
  • move away your old db_data directory, create an empty dir instead
  • restart akonadiserver

Hope this helps

Update: if you are getting this error

org.kde.pim.akonadiserver: Running DB initializer
org.kde.pim.akonadiserver: "\nSql error: Duplicate column name 'version' QMYSQL: Unable to execute query\nQuery: ALTER TABLE SchemaVersionTable ADD COLUMN version INTEGER NOT NULL DEFAULT 0"

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 akonadiserver

its 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.

| improve this answer | |
1

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:

unknown variable 'log-warnings=2'

So, I commented those out in /home/NNN/.local/share/akonadi/mysql.conf:

# print warnings and connection errors (default:1)
#log_warnings=2
 .
 .
# Memory allocated for caching query results (default:0 (disabled))
#query_cache_size=0 
. .
# Do not cache results (default:1)
#query_cache_type=0

To be honest, I didn't care, what variables were changed and what the consequences would be...

| improve this answer | |
0

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.

| improve this answer | |
  • It seems that Akonadi ~/.local/share/akonadi/db_data/ is not compatible with the upgrade of MySQL 8.0 included in Ubuntu 19.10. This makes Akonaki and therefore, kmail, korganizer, etc. broken with the new Ubuntu version. Is anyone else experiencing this? – Eduard Oct 19 '19 at 16:55
  • @Eduard i don't think its an Akonadi issue. I have updated to my answer to reflect my understanding more clearly. – Victory Oct 19 '19 at 17:03
  • Thanks Victory. Now I backed up the akonadi folder and re-built it, but I still get an error related to the mysql 8.0 upgrade that comes with 19.10 Ubuntu. Mainly when "cat .local/share/akonadi/db_data/mysql.err" I get: [ERROR] [MY-011011] [Server] Failed to find valid data directory; [ERROR] [MY-010020] [Server] Data Dictionary initialization failed; [ERROR] [MY-010119] [Server] Aborting; [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.17-0ubuntu2) (Ubuntu). – Eduard Oct 20 '19 at 7:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.