SUMMARY STEPS TO REPRODUCE 1. Upgrade KDE neon 5.16 with KDE Applications 19.08 2. Attempt to start Akonadi OBSERVED RESULT Akonadi will not start. ``` $ 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/USER/.local/share/akonadi/mysql.conf", "--datadir=/home/daniel/.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: "mysqld-akonadi: [ERROR] Could not open required defaults file: /home/USER/.local/share/akonadi/mysql.conf\nmysqld-akonadi: [ERROR] Fatal error in defaults handling. Program aborted!\n" 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/1000/akonadi/mysql.socket' (2)' Check that mysqld is running and that the socket: '/run/user/1000/akonadi/mysql.socket' exists! org.kde.pim.akonadiserver: Failed to remove runtime connection config file org.kde.pim.akonadiserver: Shutting down AkonadiServer... org.kde.pim.akonadicontrol: Application '/usr/bin/akonadiserver' exited normally... ``` What I already attempted to do: Uninstall/reinstall Akonadi; move /home/USER/.local/share/akonadi out of the way; change AppArmor settings (see forum thread linked below). EXPECTED RESULT Akonadi should just start (as it did for years prior to upgrading to KDE Applications 19.08). SOFTWARE/OS VERSIONS Linux/KDE Plasma: KDE neon 5.16 User Edition (available in About System) KDE Plasma Version: 5.16.4 KDE Frameworks Version: 5.61.0 Qt Version: 5.12.3 ADDITIONAL INFORMATION See related forum thread: https://forum.kde.org/viewtopic.php?f=215&t=162053
NB: I replaced my original user name with 'USER' in this report (albeit not in all places...).
Same error (and same system info), and would just like to add an observation or two, in case they're helpful. First, when following these directions: https://docs.kde.org/stable5/en/pim/kmail2/clean-start-after-a-failed-migration.html the process fails with the same error report, and only creates some of the files it should. /etc/apparmor.d/usr.sbin.mysqld-akonadi features a line added in a previous bugfix to allow for creation of mysql lockfile (i think?): owner /run/user/*/akonadi/default/* wr, but my output shows an argument using a different directory: "--socket=/run/user/1000/akonadi/mysql.socket" and akonadiserverrc uses the same directory: [QMYSQL] Host= Name=akonadi Options="UNIX_SOCKET=/run/user/1000/akonadi/mysql.socket" ServerPath=/usr/sbin/mysqld-akonadi StartServer=true ...after the clean start process, /run/user/1000/akonadi/ is empty. Thanks!
I think the second error message about connection via socket to local server results from a fallback after start of a local instance of mysql failed. The main problem is access to /home/${USER}/.local/share/akonadi/mysql.conf.
I `tail -f`ed /var/syslog and issued akonadictl start: Aug 20 21:34:26 localhost kernel: [63166.278573] audit: type=1400 audit(1566329666.867:197): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=22974 comm="mysqld-akonadi" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0 Aug 20 21:34:26 localhost kernel: [63166.295499] audit: type=1400 audit(1566329666.883:198): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=22975 comm="mysqld-akonadi" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0 Aug 20 21:34:26 localhost kernel: [63166.297604] audit: type=1400 audit(1566329666.883:199): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/home/$(USER)/.local/share/akonadi/mysql.conf" pid=22975 comm="mysqld-akonadi" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000 As mentioned above, I did try to relax AppArmor rules as per forum suggestions. Possibly the solution is very simple, but I'm not familiar with the AppArmor DSL. Any help would be appreciated.
The problem was solved by tearing down AppArmor, then restarting it. ``` sudo service apparmor teardown sudo service apparmor start ``` (NB: `systemctl` cannot handle the `teardown` task, and `stop` won't do it)
So, this worked for me, but after rebooting my machine, akonadi did not start, and a manual start with akonadictl resulted in the same old failure and error messages, and I had to tear down and restart apparmor again. I assume I'll have to do this every time I start my desktop or laptop. So, this is an ugly work-around, not really a solution. Any idea how to get apparmor to permit access to the required files permanently?
The worksforme status is for bugs which can't be reproduced.
Same problem here. I am running kde neon user edition, plasma version 5.17.1
*** Bug 411417 has been marked as a duplicate of this bug. ***
This thread https://forum.kde.org/viewtopic.php?f=215&t=162239&hilit=akonadi+won%27t+start points out that it appears a dev accidentally has pasted a newline into a file path, and that maybe this could be causing the problem: org.kde.pim.akonadiserver: stderr: "mysqld-akonadi: [ERROR] Could not open required defaults file: /home/andrea/.local/share/akonadi/mysql.conf\nmysqld-akonadi: [ERROR] Fatal error in defaults handling. Program aborted!\n"
I faced the same bug when I upgraded my KDE neon yesterday. Is there a workaround please ? Can't access KMail now...
(In reply to Subin from comment #11) > I faced the same bug when I upgraded my KDE neon yesterday. Is there a > workaround please ? > > Can't access KMail now... There's an apparmor workaround detailed here, although if I recall I got a lot of apparmor errors about missing files that I needed to create before it would work that I don't entirely remember and didn't document, and my Kmail isn't quite doing everything right... but, it mostly works fine. https://forum.kde.org/viewtopic.php?f=215&t=162053
(In reply to Dan from comment #12) After last upgrade of KDE Neon, also that workaround does not work anymore on my system. Not only this bug is still there after several months, it has become worse too > (In reply to Subin from comment #11) > > I faced the same bug when I upgraded my KDE neon yesterday. Is there a > > workaround please ? > > > > Can't access KMail now... > > There's an apparmor workaround detailed here, although if I recall I got a > lot of apparmor errors about missing files that I needed to create before it > would work that I don't entirely remember and didn't document, and my Kmail > isn't quite doing everything right... but, it mostly works fine. > > https://forum.kde.org/viewtopic.php?f=215&t=162053
After removing Snapd from my system (that honestly I find quite useless and full of problems) everything works fine with Apparmor. Now Akonadi starts without any problem
this is KDE Neon bug. They don't have merged the changes done by Debian, like removing akonadi-mysql completly in d/rules.
(In reply to Erasmo Caponio from comment #14) > After removing Snapd from my system (that honestly I find quite useless and > full of problems) everything works fine with Apparmor. Now Akonadi starts > without any problem Is snapd really related to this ? This is a KDE Neon issue. Any confirmed workarounds to fix it ? I can't access KMail :(
I can confirm that this is a KDE Neon bug. Some days ago I had major problems with my nVidia card and KDE Neon, so I switched to Kubuntu 18.04.3 and Akonadi works without any problem. Anyway, even if KDE Neon developers resolve this issue, there is another bigger problem with Kontact suite, which has been blocked by Google. Here is the bug: https://bugs.kde.org/show_bug.cgi?id=404990
I don't know if it is a neon bug or not anyway any comparison with other distribution should be done with the same software installed because, as I wrote above, on my system, purging snapd fixrd the issue. Regarding the problem with Google accounts, it is enough to allow less secure app to get again access with Akonadi (In reply to aldolat from comment #17) > I can confirm that this is a KDE Neon bug. Some days ago I had major > problems with my nVidia card and KDE Neon, so I switched to Kubuntu 18.04.3 > and Akonadi works without any problem. > > Anyway, even if KDE Neon developers resolve this issue, there is another > bigger problem with Kontact suite, which has been blocked by Google. Here is > the bug: https://bugs.kde.org/show_bug.cgi?id=404990
(In reply to Erasmo Caponio from comment #18) > Regarding the problem with Google accounts, it is enough to allow less > secure app to get again access with Akonadi I have the 2FA activated, so Google doesn't allow less secure apps to gain access to my account. I could use a specific app for Kontact/Kmail but, when a Gmail server is used, Kmail disables password in favour of Oauth. And Oauth is currently not usable as I wrote before, because Kontact is not authorized to access. For this reason I can't access my Gmail account using Kontact.
This bug still exists in the Plasma 5.18 update and KDE Neon update.
I was able to start Akonadi by disabling Apparmor for mysql : sudo aa-disable mysqld This was mentioned here : https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=921987
As for me, I was able to start Akonadi with: rm -r ~/.config/akonadi rm -r ~/.local/share/akonadi sudo apt update sudo apt install akonadi* --reinstall sudo reboot now But I had to recreate the imap accounts in Kmail after it.
Have the same problem. When install clean system akonadi works good and kate work. When I install mysqlserver akonadi crashed. Deleting mysqlserver does not solve problem. Operating System: Kubuntu 20.04 KDE Plasma Version: 5.18.4 KDE Frameworks Version: 5.68.0 Qt Version: 5.12.5 Kernel Version: 5.4.0-21-generic OS Type: 64-bit Processors: 8 × Intel® Core™ i7-7700HQ CPU @ 2.80GHz Memory: 15,5 ГиБ
Same here since an update in Kubuntu 18.04. I moved to 19.10 and then a few days ago to 20.04, but got the same errors while launching akonadictl from terminal: QUOTE rg.kde.pim.akonadiserver: Starting up the Akonadi Server... mysqld-akonadi: [ERROR] Failed to open required defaults file: /home/gkourtev/ mysqld-akonadi: [ERROR] Fatal error in defaults handling. Program aborted! 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/gkourtev/.local/share/akonadi/mysql.conf", "--datadir=/home/gkourtev/.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: "mysqld-akonadi: [ERROR] Failed to open required defaults file: /home/gkourtev/.local/share/akonadi/mysql.conf\nmysqld-akonadi: [ERROR] Fatal error in defaults handling. Program aborted!\n" 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/1000/akonadi/mysql.socket' (2)' Check that mysqld is running and that the socket: '/run/user/1000/akonadi/mysql.socket' exists! org.kde.pim.akonadiserver: Failed to remove runtime connection config file org.kde.pim.akonadiserver: Shutting down AkonadiServer... org.kde.pim.akonadicontrol: Application '/usr/bin/akonadiserver' exited normally... UNQUOTE Operating System: Kubuntu 20.04 KDE Plasma Version: 5.18.4 KDE Frameworks Version: 5.68.0 Qt Version: 5.12.8 Kernel Version: 5.4.0-28-generic OS Type: 64-bit Processors: 4 × Intel® Core™ i7-6500U CPU @ 2.50GHz Memory: 15,5 GiB of RAM
(In reply to GK from comment #24) > Same here since an update in Kubuntu 18.04. I moved to 19.10 and then a few > days ago to 20.04, but got the same errors while launching akonadictl from > terminal: > > QUOTE > rg.kde.pim.akonadiserver: Starting up the Akonadi Server... > mysqld-akonadi: [ERROR] Failed to open required defaults file: > /home/gkourtev/ > mysqld-akonadi: [ERROR] Fatal error in defaults handling. Program aborted! > 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/gkourtev/.local/share/akonadi/mysql.conf", > "--datadir=/home/gkourtev/.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: "mysqld-akonadi: [ERROR] Failed to open > required defaults file: > /home/gkourtev/.local/share/akonadi/mysql.conf\nmysqld-akonadi: [ERROR] > Fatal error in defaults handling. Program aborted!\n" > 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/1000/akonadi/mysql.socket' (2)' > Check that mysqld is running and that the socket: > '/run/user/1000/akonadi/mysql.socket' exists! > org.kde.pim.akonadiserver: Failed to remove runtime connection config file > org.kde.pim.akonadiserver: Shutting down AkonadiServer... > org.kde.pim.akonadicontrol: Application '/usr/bin/akonadiserver' exited > normally... > UNQUOTE > > Operating System: Kubuntu 20.04 > KDE Plasma Version: 5.18.4 > KDE Frameworks Version: 5.68.0 > Qt Version: 5.12.8 > Kernel Version: 5.4.0-28-generic > OS Type: 64-bit > Processors: 4 × Intel® Core™ i7-6500U CPU @ 2.50GHz > Memory: 15,5 GiB of RAM Can you try to disable AppArmor and start it? It helped for me when I had this bug. Seems to be something wrong with the AA policy which causes mysqld-akonadi to be unable to read it's configuration. Anyway, I'm changing this bug product because it's not really Neon-specific.
Hi, Yes I tried to disable, but does not change anything.
@GK: please report this issue at kubuntu directly as this is properly a packaging issue. Otherwise this may be a unrelated issue. Also for the people having this issue with Neon please report directly on Neon, I am quite sure, that the neon people are NOT aware of this issue.
1) updated Kubuntu 19-10 -> 20.04 yesterday, problems with kmail & kontact: akonadi not running 2) > akonadictl start - didn't work, error "Could not open required defaults file: /home/NNN/.local/share/akonadi/mysql.conf"[...] 3) started apparmor notification: > started aa-notify -p saw problem with mysql 4) searched more, found: https://askubuntu.com/questions/1144497/how-to-disable-apparmor-for-mysql , followed instructions: 5) > sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ > sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld 6) > akonadictl start - works! :-) (in kontact, the calendars were no longer chosen, I had to reactivate the checkboxes, kmail works) If I understand correctly, apparmor is now not longer protecting mysql. I have to re-activate, once another solution is found: same askubuntu...
Better is disabling only akonadiserver instead of whole mysql: sudo ln -s /etc/apparmor.d/usr.bin.akonadiserver /etc/apparmor.d/disable/ But in my case this file was missing. I had to copy from https://cgit.kde.org/akonadi.git/tree/apparmor/usr.bin.akonadiserver Also if have KDEAPPS older than 19.12.2 you should update /etc/apparmor.d/mysqld_akonadi to latest from https://cgit.kde.org/akonadi.git/tree/apparmor/mysqld_akonadi (because patch) This (for me working) solution became from https://bugs.kde.org/show_bug.cgi?id=416016
Someone already created an issue for this on Launchpad: https://bugs.launchpad.net/ubuntu/+source/akonadi/+bug/1873087 Following the instructions in the ticket description has fixed the issue for me.
So basically this means, misconfigured AppArmor rules prevent mysqld-akonadi from reading ~/.local/share/akonadi/mysql.conf, which causes this bug? if so, then it's a downstream issue in Kubuntu, and has to be fixed there, IIUC.
This bug seems solved in kde neon based on Ubuntu 20.04 (at least on my upgraded system). Removing and reinstalling apparmor and snapd may help (Anyway I still have snapd removed)
After many tests (either on my work computer and in some VirtualBox machines) I discovered that this problem happens to me when I install the package mysql-server which removes some Akonadi related packages[1]. In other words, if I don't install mysql-server, Akonadi works fine. After the installation of mysql-server, Akonadi stops working. In this situation, since I need a LAMP server on my machine, I have to perform some actions in order to make Akonadi work with mysql-server. [1] MySQL is correctly installed but these are some of the lines printed during the installation process: Preconfiguring packages ... dpkg: mariadb-client-core-10.3: dependency problems, but removing anyway as you requested: akonadi-backend-mysql depends on mariadb-client-core-10.3 | virtual-mysql-client-core; however: Package mariadb-client-core-10.3 is to be removed. Package virtual-mysql-client-core is not installed. Package mariadb-client-core-10.3 which provides virtual-mysql-client-core is to be removed.
@Aldo: this looks like a downstream packaging issue, I suggest you file a bug report in your distro's bug tracker.