Bug 407170 - Akonadi won't start for Domain Users
Summary: Akonadi won't start for Domain Users
Status: RESOLVED FIXED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.10.3
Platform: unspecified Linux
: NOR critical (vote)
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-03 04:43 UTC by Don Robertson
Modified: 2019-06-13 20:22 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 19.04.3


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Don Robertson 2019-05-03 04:43:48 UTC
SUMMARY
When logging into Kubuntu 18.xx and 19.04 with a domain login, Akonadi won't start. It will start if logging in as a local user.

I am running Nethserver - a CentOS based server - with Samba 4 set to act as a Active Directory and DOmain Controller. Nethserver sets the home directory to /var/lib/nethserver/home/USERNAME


STEPS TO REPRODUCE
1. Install and configure domain controller, get Kubuntu to use DC to authenticate and log in. I used the instructions on this (https://bitsofwater.com/2018/05/08/join-ubuntu-18-04-to-active-directory/) page to join the Kubuntu client to the domain.
2. Attempt to start Akonadi

OBSERVED RESULT

When starting Akonadi:

username@domain.name@machinename:~$ akonadictl start
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
username@domain.name@machinename:~$ org.kde.pim.akonadiserver: Starting up the Akonadi Server...
mysqld: [ERROR] Could not open required defaults file: /var/lib/nethserver/home/username/
mysqld: [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=/var/lib/nethserver/home/username/.local/share/akonadi/mysql.conf", "--datadir=/var/lib/nethserver/home/username/.local/share/akonadi/db_data/", "--socket=/tmp/akonadi-don@rnet.duckdns.org.46qsbJ/mysql.socket", "--pid-file=/tmp/akonadi-don@rnet.duckdns.org.46qsbJ/mysql.pid")
org.kde.pim.akonadiserver: stdout: ""
org.kde.pim.akonadiserver: stderr: "mysqld: [ERROR] Could not open required defaults file: /var/lib/nethserver/home/username/.local/share/akonadi/mysql.conf\nmysqld: [ERROR] Fatal error in defaults handling. Program aborted!\n"
org.kde.pim.akonadiserver: exit code: 1
org.kde.pim.akonadiserver: process error: "Unknown error"
org.kde.pim.akonadiserver: Failed to remove runtime connection config file
org.kde.pim.akonadiserver: Shutting down AkonadiServer...
org.kde.pim.akonadicontrol: Application 'akonadiserver' exited normally...

username@domain.name@machinename:~$


Permissions on /var/lib/nethserver/home/username/ seem to be okay - it is the users home directory, and the users have no other (software related) problems. The user can also read the ~/.local/share/akonadi/mysql.conf file and access the ~./local/share/akonadi/db_data/ directory.

Listing the ~/.local/share/akonadi/ directory gives:

username@domain.name@machinename:~$ ll ~/.local/share/akonadi/
total 28
drwxr-xr-x  2 username@domain.name domain users@domain.name 4096 Apr 11 10:36 ./
drwxr-xr-x 34 username@domain.name domain users@domain.name 4096 Apr 11 09:53 ../
-rw-r--r--  1 username@domain.name domain users@domain.name  150 Apr 11 10:36 akonadi_control.error
-rw-r--r--  1 username@domain.name domain users@domain.name  150 Apr 11 10:36 akonadi_control.error.old
-rw-r--r--  1 username@domain.name domain users@domain.name    0 Apr 11 10:36 akonadictl.error
-rw-r--r--  1 username@domain.name domain users@domain.name    0 Apr 11 10:36 akonadictl.error.old
-rw-r--r--  1 username@domain.name domain users@domain.name  734 Apr 11 10:36 akonadiserver.error
-rw-r--r--  1 username@domain.name domain users@domain.name  734 Apr 11 10:36 akonadiserver.error.old
-rw-r--r--  1 username@domain.name domain users@domain.name 3660 Apr  3 09:30 mysql.conf
lrwxrwxrwx  1 username@domain.name domain users@domain.name   40 Apr 11 10:02 socket-machinename -> '/tmp/akonadi-username@domain.name.KhWSEz'/

If I have a look in /tmp, I see:

username@domain.name@machinename:~$ ll /tmp/
total 88
drwxrwxrwt 16 root                 root 4096 Apr 11 10:53  ./
drwxr-xr-x 24 root                 root 4096 Apr  3 12:22  ../
drwx------  2 username@domain.name domain users@domain.name  4096 Apr 11 10:02 'akonadi-username@domain.name.KhWSEz'/

For local users, Akonadi/ Kontact works, and listing ~.local/share/akonadi/ gives

username@domain.name@machinename:~$ ll ~/.local/share/akonadi/
total 28
drwxrwxr-x  4 username usergroup 4096 Apr  3 09:29 ./
drwxr-xr-x 21 username usergroup 4096 Apr  3 09:29 ../
-rw-rw-r--  1 username usergroup  827 Apr  3 09:30 akonadi_control.error
-rw-rw-r--  1 username usergroup    0 Apr  3 09:29 akonadictl.error
-rw-rw-r--  1 username usergroup    0 Apr  3 09:29 akonadictl.error.old
-rw-rw-r--  1 username usergroup  230 Apr  3 09:29 akonadiserver.error
drwxr-x---  6 username usergroup 4096 Apr  3 09:30 db_data/
-rw-rw-r--  1 username usergroup 3660 Apr  3 09:28 mysql.conf
drwxrwxr-x  8 username usergroup 4096 Apr  3 09:29 search_db/
lrwxrwxrwx  1 username usergroup   23 Apr  3 09:28 socket-Aspire-S3-391 -> /tmp/akonadi-username.RoDq2s


EXPECTED RESULT

Akonadi starts, KDE PIM runs.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.15.4
KDE Frameworks Version: 5.56.0
Qt Version: 5.12.2

ADDITIONAL INFORMATION

While googling for a solution, I found a lot of posts suggesting a directory '/var/lib/mysql-files' needs to be created. I did this and gave permissions for the MySQL user to rwx to it, but this did not help.
Comment 1 Daniel Vrátil 2019-06-13 09:06:10 UTC
This should be fixed as a side-effect of https://phabricator.kde.org/D21650 which has moved the MySQL socket file to /var/run/user/<uid>/akonadi, so the hostname or username no longer appears in the socket name.
Comment 2 Christophe Giboudeaux 2019-06-13 20:22:34 UTC
After updating, edit the akonadiserverrc file in $HOME/.config/akonadi/ and delete the lines pointing to the tmp folder. They will be recreated the next time you start akonadi with the new values.

(for the MySQL backend, the "Options" line, for the PSQL backend, the "Host" one)