3

I am using Kubuntu 16.10 and am unable to get Kontact to start because Akonadi will not start. Below is the output from akonadictl start.

It appears there is something seriously wrong with Akonadi. Does anyone have any ideas? Am I just sol? Can a downlevel version of Akonadi and Kontact be install?

trekker@trekker-HP-Notebook:/usr/bin$ akonadictl start
Starting Akonadi Server...
   done.
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
trekker@trekker-HP-Notebook:/usr/bin$ akonadiprivate_log: search paths:  ("/home/trekker/bin", "/home/trekker/.local/bin", "/usr/local/sbin", "/usr/local/bin", "/usr/sbin", "/usr/bin", "/sbin", "/bin", "/usr/games", "/usr/local/games", "/snap/bin", "/usr/sbin", "/usr/local/sbin", "/usr/local/libexec", "/usr/libexec", "/opt/mysql/libexec", "/opt/local/lib/mysql5/bin", "/opt/mysql/sbin")
Found mysql_install_db:  "/usr/bin/mysql_install_db"
Found mysqlcheck:  "/usr/bin/mysqlcheck"
Using mysqld: "/usr/sbin/mysqld-akonadi"
mysqld reports version 5.7.16 (Oracle MySQL)
Executing:  "/usr/sbin/mysqld-akonadi" "--defaults-file=/etc/xdg/akonadi/mysql-global.conf --initialize --datadir=/home/trekker/.local/share/akonadi/db_data/"
mysqld: [ERROR] Could not open required defaults file: /etc/xdg/akonadi/mysql-global.conf
mysqld: [ERROR] Fatal error in defaults handling. Program aborted!
Executing: "/usr/sbin/mysqld-akonadi" "--defaults-file=/home/trekker/.local/share/akonadi/mysql.conf --datadir=/home/trekker/.local/share/akonadi/db_data/ --socket=/tmp/akonadi-trekker.LbKUAD/mysql.socket"
Database process exited unexpectedly during initial connection!
executable: "/usr/sbin/mysqld-akonadi"
arguments: ("--defaults-file=/home/trekker/.local/share/akonadi/mysql.conf", "--datadir=/home/trekker/.local/share/akonadi/db_data/", "--socket=/tmp/akonadi-trekker.LbKUAD/mysql.socket")
stdout: ""
stderr: "mysqld: Error on realpath() on '/var/lib/mysql-files' (Error 2 - No such file or directory)\n2016-11-18T19:16:26.102182Z 0 [Warning] The syntax '--log_warnings/-W' is deprecated and will be removed in a future release. Please use '--log_error_verbosity' instead.\n2016-11-18T19:16:26.102229Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).\n2016-11-18T19:16:26.102276Z 0 [ERROR] Failed to access directory for --secure-file-priv. Please make sure that directory exists and is accessible by MySQL Server. Supplied value : /var/lib/mysql-files\n2016-11-18T19:16:26.102279Z 0 [ERROR] Aborting\n\n2016-11-18T19:16:26.102290Z 0 [Note] Binlog end\n"
exit code: 1
process error: "Unknown error"
terminating service threads
terminating connection threads
stopping db process
Failed to remove Unix socket
Failed to remove runtime connection config file
Application 'akonadiserver' exited normally...

trekker@trekker-HP-Notebook:/usr/bin$ 

It seems I have found a fix. Based on a thread I found in Kubuntu Forums, I did the following:

sudo mkdir /var/lib/mysql-files

monon
  • 31
  • 1
  • 3
  • you should add your solution as an answer. People are likely to miss your solution (which worked for me, btw; thanks) – jhauris Dec 16 '16 at 19:48

5 Answers5

2

for me this didn't help (lubuntu 17.04) but I found this bug

so this solved my issue :

sudo apt-get install apparmor-utils
sudo aa-complain usr.sbin.mysqld-akonadi
altagir
  • 239
  • 2
  • 5
  • It should be the best answer. Tanks, it helped! – RedEyed May 30 '18 at 13:19
  • Downvoted because this is a solution that disables Apparmor for Akonadi and thus a potential security hole. see my answer below for the correct solution. – JPT Mar 09 '19 at 15:09
  • Quote from man-page: aa-complain is used to set the enforcement mode for one or more profiles to complain mode. In this mode security policy is not enforced but rather access violations are logged to the system log. – JPT Mar 09 '19 at 15:23
2

Solved it removing the local configuration directory rm ~/.local/share/akonadi and restarting it with akonadictl start

Philippe Gachoud
  • 5,800
  • 3
  • 41
  • 50
1

If you changed the location of your HOME folder, including symlinking, the problem is caused by Apparmor.

Edit /etc/apparmor.d/tunable/home and add your new home, for example:

@{HOMEDIRS}=/home/

to

@{HOMEDIRS}=/home/ /somewhere/home/

then

sudo /etc/init.d/apparmor restart 

anonymous2
  • 4,268
  • 7
  • 33
  • 61
tomtom
  • 11
  • 1
  • In spite I enhanced the answer myself, it does not work for me - but `aa-complain` does. Strange. Any idea? – JPT Mar 09 '19 at 15:33
  • Somehow this worked for me: add `alias /home/ -> /media/DATEN/home/,` to `/etc/apparmor.d/tunable/alias` No idea why. – JPT Mar 09 '19 at 15:49
1

This is from KDE Bugtracking System – Bug 411093.

sudo service apparmor teardown
sudo service apparmor start
akonadictl start

This started it correctly for me for the first time, however it had to be repeated after reboot.

1

I solved the issue with these steps:

Created the folder:

sudo mkdir /var/lib/mysql-files

Started the service:

akonadictl start

Purged and reinstalled Kontact:

sudo apt purge kontact && sudo apt install Kontact

Start Kmail

Hope this helps.

Regards.

UTF-8
  • 5,580
  • 10
  • 30
  • 66
ChristCB
  • 11
  • 2