Bug 416016 - Akonadi can no longer start : /run/user/1000/akonadi problem
Summary: Akonadi can no longer start : /run/user/1000/akonadi problem
Status: RESOLVED FIXED
Alias: None
Product: neon
Classification: KDE Neon
Component: general (show other bugs)
Version: unspecified
Platform: Neon Linux
: NOR critical
Target Milestone: ---
Assignee: Neon Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-08 19:57 UTC by Patrice Grundmann
Modified: 2020-01-10 07:17 UTC (History)
11 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrice Grundmann 2020-01-08 19:57:22 UTC
~/ akonadictl stop                                                                                                                                          
Akonadi is not running.
█▓▒░patrice@kdeneon-vm░▒▓██▓▒░ mer. janv. 08 08:36:33 
~/ akonadictl start
█▓▒░patrice@kdeneon-vm░▒▓██▓▒░ mer. janv. 08 08:36:37 
~/ Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
org.kde.pim.akonadiserver: Starting up the Akonadi Server...
org.kde.pim.akonadiprivate: StandardDirs::saveDir: failed to create directory ' "/run/user/1000/akonadi" '
QDir::mkpath: Empty or null file name
org.kde.pim.akonadiserver: Creating socket directory with name "" failed: Succès
org.kde.pim.akonadiserver: Could not create socket directory for Akonadi.
org.kde.pim.akonadiprivate: StandardDirs::saveDir: failed to create directory ' "/run/user/1000/akonadi" '
QDir::mkpath: Empty or null file name
org.kde.pim.akonadiserver: Creating socket directory with name "" failed: Succès
org.kde.pim.akonadiserver: Could not create socket directory for Akonadi.
org.kde.pim.akonadiserver: Failed to connect to database!
org.kde.pim.akonadiserver: Database error: "Can't connect to local MySQL server through socket '/home/patrice/.local/share/akonadi/db_misc/mysql.socket' (2) QMYSQL: Unable to connect"
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...

STEPS TO REPRODUCE
1. update KDE neon (with pkcon of course)

OBSERVED RESULT
Impossible to launch Akonadi in Kontact


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 5.17.5
KDE Plasma Version: 
KDE Frameworks Version: 5.65.0
Qt Version: 5.13.2

ADDITIONAL INFORMATION
(again a Akonadi bug)
akonadictl --version
akonadictl 5.13.0 (19.12.0)
Comment 1 David de Cos 2020-01-09 10:09:21 UTC
Can confirm. Updated to 5.17.5 half an hour ago, and now I'm stuck out of my mail. This can't be happening...

If anyone knows of a workaround before the fix comes, please share!
Comment 2 Christoph Feck 2020-01-09 12:47:21 UTC
Plasma is unrelated to KDEPIM. Which other packages besides Plasma did you update? Anything SQL database related?
Comment 3 dharman 2020-01-09 13:04:45 UTC
(In reply to Christoph Feck from comment #2)
> Plasma is unrelated to KDEPIM. Which other packages besides Plasma did you
> update? Anything SQL database related?

I've the same identical problem. 
I'm using KDE Neon LTE User edition and apply all suggested update everyday. 
I've nomore additional repositories but nextcloud-client one.

After an upgrade (as suggested and processed by discover) from Plasma 5.17.4 to 5.17.5 and a normal reboot, Akonadi refused to start. 
Nothing else.
Comment 4 David de Cos 2020-01-09 13:11:35 UTC
Christoph Feck is absolutely right. I also applied all updates in KDE Neon, and assumed all the packages were 5.17.5 related, because that was all Synaptic was showing me. However, it seems that an akonadi update to build41 (same version, new build) snuck into my update too. The problem lies within those packages.

I had to downgrade those packages to build39. This command did the trick for me:

sudo apt-get install akonadi-backend-mysql=4:19.12.0-0xneon+18.04+bionic+build39 akonadi-server=4:19.12.0-0xneon+18.04+bionic+build39 libkf5akonadiagentbase5=4:19.12.0-0xneon+18.04+bionic+build39 libkf5akonadicore5=4:19.12.0-0xneon+18.04+bionic+build39 libkf5akonadi-data=4:19.12.0-0xneon+18.04+bionic+build39 libkf5akonadiprivate5=4:19.12.0-0xneon+18.04+bionic+build39 libkf5akonadiwidgets5=4:19.12.0-0xneon+18.04+bionic+build39 libkf5akonadixml5=4:19.12.0-0xneon+18.04+bionic+build39
Comment 5 Bruno P. 2020-01-09 13:35:08 UTC
This is an issue with apparmor and Ubuntu. Everything works if the apparmor profile usr.bin.akonadiserver is disabled.

It seems that the apparmor profile provided in the KDE Neon package akonadi-server needs at least a line to allow read and write in /run/user :

owner /{,var/}run/user/@{uid}/akonadi** rwk,

Not that this line is present in the master branch :
https://cgit.kde.org/akonadi.git/tree/apparmor/usr.bin.akonadiserver
Comment 6 dharman 2020-01-09 13:51:36 UTC
(In reply to Bruno Patri from comment #5)
> This is an issue with apparmor and Ubuntu. Everything works if the apparmor
> profile usr.bin.akonadiserver is disabled.
> 
> It seems that the apparmor profile provided in the KDE Neon package
> akonadi-server needs at least a line to allow read and write in /run/user :
> 
> owner /{,var/}run/user/@{uid}/akonadi** rwk,
> 
> Not that this line is present in the master branch :
> https://cgit.kde.org/akonadi.git/tree/apparmor/usr.bin.akonadiserver

It works for me...thank you!
Comment 7 Stefan 2020-01-09 16:34:18 UTC
(In reply to dharman from comment #6)
> (In reply to Bruno Patri from comment #5)
> > This is an issue with apparmor and Ubuntu. Everything works if the apparmor
> > profile usr.bin.akonadiserver is disabled.
> > 
> > It seems that the apparmor profile provided in the KDE Neon package
> > akonadi-server needs at least a line to allow read and write in /run/user :
> > 
> > owner /{,var/}run/user/@{uid}/akonadi** rwk,
> > 
> > Not that this line is present in the master branch :
> > https://cgit.kde.org/akonadi.git/tree/apparmor/usr.bin.akonadiserver
> 
> It works for me...thank you!
Unfortunately this has not worked for me
Comment 8 Jonathan Riddell 2020-01-09 16:35:19 UTC
Changes to apparmor profiles typically need a reboot to take effect
Comment 9 Stefan 2020-01-09 16:44:00 UTC
(In reply to Jonathan Riddell from comment #8)
> Changes to apparmor profiles typically need a reboot to take effect

Yes I know. But still this doesn't help.
Comment 10 Bruno P. 2020-01-09 17:18:06 UTC
(In reply to Stefan from comment #7)
…
> > > https://cgit.kde.org/akonadi.git/tree/apparmor/usr.bin.akonadiserver
> > 
> > It works for me...thank you!
> Unfortunately this has not worked for me

If you replace the two files under /etc/apparmor.d usr.bin.akonadiserver and mysql_akonadi by the ones in https://cgit.kde.org/akonadi.git/tree/apparmor, it should work.
Comment 11 Stefan 2020-01-09 17:32:49 UTC
(In reply to Bruno Patri from comment #10)
> (In reply to Stefan from comment #7)
> …
> > > > https://cgit.kde.org/akonadi.git/tree/apparmor/usr.bin.akonadiserver
> > > 
> > > It works for me...thank you!
> > Unfortunately this has not worked for me
> 
> If you replace the two files under /etc/apparmor.d usr.bin.akonadiserver and
> mysql_akonadi by the ones in https://cgit.kde.org/akonadi.git/tree/apparmor,
> it should work.

This doesn't work either.
Comment 12 Jonathan Riddell 2020-01-09 17:39:33 UTC
The fix is now published, please update and reboot.
Comment 13 Bruno P. 2020-01-09 18:01:37 UTC
@Jonathan Riddell, thanks for the quick fix.
It works  now.
Comment 14 Stefan 2020-01-09 18:13:03 UTC
(In reply to Bruno Patri from comment #13)
> @Jonathan Riddell, thanks for the quick fix.
> It works  now.
I can confirm this too. After removing the leftovers:
rm /etc/apparmor.d/usr.bin.akonadiserver*
rm /etc/apparmor.d/usr.sbin.mysqld-akonadi*

By the way this was enough to reload the profiles:
systemctl restart apparmor.service

There is only one profile now:
/etc/apparmor.d/mysqld_akonadi
Comment 15 KOT040188 2020-01-09 19:30:14 UTC
KDENeon plasma 5.17.5

kot@kot-MS-7930:~$ akonadictl start
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
kot@kot-MS-7930:~$ Invalid Context= "Panel" line for icon theme:  "/usr/share/icons/Numix-Circle/16/panel/"
Invalid Context= "Panel" line for icon theme:  "/usr/share/icons/Numix-Circle/16@2x/panel/"
Invalid Context= "Panel" line for icon theme:  "/usr/share/icons/Numix-Circle/22/panel/"
Invalid Context= "Panel" line for icon theme:  "/usr/share/icons/Numix-Circle/22@2x/panel/"
Invalid Context= "Panel" line for icon theme:  "/usr/share/icons/Numix-Circle/24/panel/"
Invalid Context= "Panel" line for icon theme:  "/usr/share/icons/Numix-Circle/24@2x/panel/"
org.kde.pim.akonadiserver: Starting up the Akonadi Server...
org.kde.pim.akonadiprivate: StandardDirs::saveDir: failed to create directory ' "/run/user/1000/akonadi" '
QDir::mkpath: Empty or null file name
org.kde.pim.akonadiserver: Creating socket directory with name "" failed: Выполнено
org.kde.pim.akonadiserver: Could not create socket directory for Akonadi.
org.kde.pim.akonadiprivate: StandardDirs::saveDir: failed to create directory ' "/run/user/1000/akonadi" '
QDir::mkpath: Empty or null file name
org.kde.pim.akonadiserver: Creating socket directory with name "" failed: Выполнено
org.kde.pim.akonadiserver: Could not create socket directory for Akonadi.
akonadi.collectionattributetable                   OK
akonadi.collectionmimetyperelation                 OK
akonadi.collectionpimitemrelation                  OK
akonadi.collectiontable                            OK
akonadi.flagtable                                  OK
akonadi.mimetypetable                              OK
akonadi.parttable                                  OK
akonadi.parttypetable                              OK
akonadi.pimitemflagrelation                        OK
akonadi.pimitemtable                               OK
akonadi.pimitemtagrelation                         OK
akonadi.relationtable                              OK
akonadi.relationtypetable                          OK
akonadi.resourcetable                              OK
akonadi.schemaversiontable                         OK
akonadi.tagattributetable                          OK
akonadi.tagremoteidresourcerelationtable           OK
akonadi.tagtable                                   OK
akonadi.tagtypetable                               OK
org.kde.pim.akonadiprivate: StandardDirs::saveDir: failed to create directory ' "/run/user/1000/akonadi" '
QDir::mkpath: Empty or null file name
org.kde.pim.akonadiserver: Creating socket directory with name "" failed: Выполнено
org.kde.pim.akonadiserver: Could not create socket directory for Akonadi.
org.kde.pim.akonadiserver: Running DB initializer
org.kde.pim.akonadiserver: DB initializer done
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
org.kde.pim.akonadiserver: Unable to connect to dbus service:  "An AppArmor policy prevents this sender from sending this message to this recipient; type=\"method_call\", sender=\":1.228\" (uid=1000 pid=29849 comm=\"/usr/bin/akonadiserver \" label=\"/usr/bin/akonadiserver (enforce)\") interface=\"org.freedesktop.DBus\" member=\"RequestName\" error name=\"(unset)\" requested_reply=\"0\" destination=\"org.freedesktop.DBus\" (bus)"
org.kde.pim.akonadicontrol: Application '/usr/bin/akonadiserver' exited normally...
Comment 16 Stefan 2020-01-09 20:16:22 UTC
(In reply to KOT040188 from comment #15)
> KDENeon plasma 5.17.5
Have you updated your system? Afterwards you have to reboot (more secure) or to run
service apparmor teardown
systemctl restart apparmor.service
Comment 17 KOT040188 2020-01-09 20:18:45 UTC
(In reply to Stefan from comment #16)
> (In reply to KOT040188 from comment #15)
> > KDENeon plasma 5.17.5
> Have you updated your system? Afterwards you have to reboot (more secure) or
> to run
> service apparmor teardown
> systemctl restart apparmor.service

Yes, I updated. systemctl restart apparmor.service did not help, but I rebooted the system and everything is fine.
Comment 18 Stefan 2020-01-09 20:24:39 UTC
(In reply to KOT040188 from comment #17)
> (In reply to Stefan from comment #16)
> > (In reply to KOT040188 from comment #15)
> > > KDENeon plasma 5.17.5
> > Have you updated your system? Afterwards you have to reboot (more secure) or
> > to run
> > service apparmor teardown
> > systemctl restart apparmor.service
> 
> Yes, I updated. systemctl restart apparmor.service did not help, but I
> rebooted the system and everything is fine.

Sorry I was wrong in Comment 14. As written in comment 16 it's necessary to run the teardown command before.