akonadi fails to start for fresh user/install in Cosmic

Bug #1797643 reported by Rik Mills
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Akonadi
Unknown
Critical
akonadi (Ubuntu)
Fix Released
High
Unassigned

Bug Description

Cosmic
akonadi 4:18.04.3-0ubuntu1

On a new user or fresh install with no existing akonadi database present, akonadi fails to start as below:

$ akonadictl start
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
mysqld: [ERROR] Could not open required defaults file: /home/cosmic2/
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=/home/cosmic2/.local/share/akonadi/mysql.conf", "--datadir=/home/cosmic2/.local/share/akonadi/db_data/", "--socket=/tmp/akonadi-cosmic2.D2M7Vb/mysql.socket", "--pid-file=/tmp/akonadi-cosmic2.D2M7Vb/mysql.pid")
org.kde.pim.akonadiserver: stdout: ""
org.kde.pim.akonadiserver: stderr: "mysqld: Can't change dir to '/home/cosmic2/.local/share/akonadi/db_data/' (Errcode: 2 - No such file or directory)\n2018-10-12T20:43:35.453607Z 0 [Warning] The syntax '--log_warnings/-W' is deprecated and will be removed in a future release. Please use '--log_error_verbosity' instead.\n2018-10-12T20:43:35.453700Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).\n2018-10-12T20:43:35.454504Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.\n2018-10-12T20:43:35.454549Z 0 [Warning] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.\n2018-10-12T20:43:35.455216Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.23-2ubuntu1) starting as process 11227 ...\n2018-10-12T20:43:35.536547Z 0 [Warning] Can't create test file /home/cosmic2/.local/share/akonadi/db_data/cosmic2-VirtualBox.lower-test\n2018-10-12T20:43:35.536581Z 0 [Warning] Can't create test file /home/cosmic2/.local/share/akonadi/db_data/cosmic2-VirtualBox.lower-test\n2018-10-12T20:43:35.536618Z 0 [ERROR] failed to set datadir to /home/cosmic2/.local/share/akonadi/db_data/\n2018-10-12T20:43:35.536622Z 0 [ERROR] Aborting\n\n2018-10-12T20:43:35.536631Z 0 [Note] Binlog end\n2018-10-12T20:43:35.543857Z 0 [Note] /usr/sbin/mysqld: Shutdown complete\n\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.akonadicontrol: Application 'akonadiserver' exited normally...

dmesg output
ces/system/node/" pid=11843 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[ 648.247460] audit: type=1400 audit(1539377270.325:55): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld-akonadi///usr/sbin/mysqld" name="/etc/mysql/my.cnf.fallback" pid=11843 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[ 648.252570] audit: type=1400 audit(1539377270.329:56): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld-akonadi///usr/sbin/mysqld" name="/sys/devices/system/node/" pid=11844 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[ 648.252573] audit: type=1400 audit(1539377270.329:57): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld-akonadi///usr/sbin/mysqld" name="/home/cosmic2/" pid=11844 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000
[ 648.256661] audit: type=1400 audit(1539377270.333:58): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld-akonadi///usr/sbin/mysqld" name="/sys/devices/system/node/" pid=11845 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[ 716.311650] audit: type=1400 audit(1539379319.310:59): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld-akonadi///usr/sbin/mysqld" name="/sys/devices/system/node/" pid=11891 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[ 716.312669] audit: type=1400 audit(1539379319.310:60): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld-akonadi///usr/sbin/mysqld" name="/etc/mysql/my.cnf.fallback" pid=11891 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[ 716.348455] audit: type=1400 audit(1539379319.346:61): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld-akonadi///usr/sbin/mysqld" name="/sys/devices/system/node/" pid=11892 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[ 716.349006] audit: type=1400 audit(1539379319.346:62): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld-akonadi///usr/sbin/mysqld" name="/home/cosmic2/" pid=11892 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000
[ 716.353072] audit: type=1400 audit(1539379319.350:63): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld-akonadi///usr/sbin/mysqld" name="/sys/devices/system/node/" pid=11893 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0

ProblemType: Bug
DistroRelease: Ubuntu 18.10
Package: akonadi-server 4:18.04.3-0ubuntu1
ProcVersionSignature: Ubuntu 4.18.0-8.9-generic 4.18.7
Uname: Linux 4.18.0-8-generic x86_64
ApportVersion: 2.20.10-0ubuntu11
Architecture: amd64
CurrentDesktop: KDE
Date: Fri Oct 12 22:25:33 2018
InstallationDate: Installed on 2018-10-12 (0 days ago)
InstallationMedia: Kubuntu 18.10 "Cosmic Cuttlefish" - Beta amd64 (20181012)
SourcePackage: akonadi
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
In , Patrice (patrice-grundmann) wrote :

Created attachment 115390
Akonadi selftest report

SUMMARY

STEPS TO REPRODUCE
1. in a fresh installation of KDE Neon, I have apt install Kontact

OBSERVED RESULT

— A error windows appear, here is the log joined
— I have try a : akonadictl start but I have a error (commande line result joined)

EXPECTED RESULT

$ akonadictl start
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)

FATAL ERROR: Could not find my_print_defaults

The following directories were searched:

    /usr/bin
    /usr/extra

If you compiled from source, you need to either run 'make install' to
copy the software into the correct location ready for operation.
If you don't want to do a full install, you can use the --srcddir
option to only install the mysql database and privilege tables

If you are using a binary release, you must either be at the top
level of the extracted archive, or pass the --basedir option
pointing to that location.

The latest information about mysql_install_db is available at
https://mariadb.com/kb/en/installing-system-tables-mysql_install_db
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/patrice/.local/share/akonadi/mysql.conf", "--datadir=/home/patrice/.local/share/akonadi/db_data/", "--socket=/tmp/akonadi-patrice.21Y4l2/mysql.socket", "--pid-file=/tmp/akonadi-patrice.21Y4l2/mysql.pid")
org.kde.pim.akonadiserver: stdout: ""
org.kde.pim.akonadiserver: stderr: "2018-10-03 11:25:50 139824482577536 [Note] /usr/sbin/mysqld (mysqld 10.1.34-MariaDB-0ubuntu0.18.04.1) starting as process 3306 ...\n2018-10-03 11:25:50 139824482577536 [Warning] Can't create test file /home/patrice/.local/share/akonadi/db_data/neon.lower-test\n\x07/usr/sbin/mysqld: Can't change dir to '/home/patrice/.local/share/akonadi/db_data/' (Errcode: 2 \"No such file or directory\")\n2018-10-03 11:25:50 139824482577536 [ERROR] Aborting\n\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.akonadicontrol: Application 'akonadiserver' exited normally...

SOFTWARE VERSIONS
(available in About System)
KDE Plasma Version: 5.13.5
KDE Frameworks Version: 5.50
Qt Version: 5.11.1

ADDITIONAL INFORMATION

Revision history for this message
In , Rik Mills (rikmills) wrote :

I can reproduce this on Neon 18.04 user edition on a fresh install, and using Kubuntu CI builds of apps/akonadi stable 18.08 branch.

(1) I am not sure it was intentional for Neon to switch to mariadb. This may be a result of the packaging for the mysql backend having:

Depends: libqt5sql5-mysql,
         mysql-client-core-5.6 | virtual-mysql-client-core,
         mysql-server-core-5.6 | virtual-mysql-server-core,

whereas mysql 5.6 package do not exist in Bionic (5.7 is there) so mariadb gets pulled in instead.

(2) This looks very similar to https://bugs.kde.org/show_bug.cgi?id=392948 which was supposedly fixed.

I would note that the same result and workaround

mkdir -p ~/.local/share/akonadi/db_data/

before starting akonadi for the 1st time, works with both mariadb on Neon and mysql on Kubuntu.

Revision history for this message
In , Rik Mills (rikmills) wrote :

Testing with Kubuntu 18.01 daily iso with akonadi 18.04.3, and all starts ok.

Revision history for this message
In , Rik Mills (rikmills) wrote :

(In reply to Rik Mills from comment #2)
> Testing with Kubuntu 18.01 daily iso with akonadi 18.04.3, and all starts ok.

Should read Cosmic 18.10.

Revision history for this message
Rik Mills (rikmills) wrote :
Revision history for this message
In , Rik Mills (rikmills) wrote :

Correction. Akonadi 18.04.3 on Cosmic 18.10 fails to start also, using mysql 5.7

https://bugs.launchpad.net/ubuntu/+source/akonadi/+bug/1797643

18.08.1 also fails to start on debian unstable with mariadb in a similar manner.

Revision history for this message
Rik Mills (rikmills) wrote :

Workaround is to:

mkdir -p ~/.local/share/akonadi/db_data

Revision history for this message
Darin Miller (darinmiller) wrote :

Confirmed. FYI, the correct command for launching is:

   akonadictl start

Rik Mills (rikmills)
description: updated
Revision history for this message
Ian Bell (ibell863) wrote :

I was requested to check this on debian. A similar issue exists, so I have reported that.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=910902

In this case the database is mariadb but the error is the same that ~/.local/share/akonadi/db_data/ does not exist. Presumably not automatically created as should have been.

Revision history for this message
In , Rik Mills (rikmills) wrote :

Now also reported in Debian (Cheers Ian)

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=910902

Rik Mills (rikmills)
Changed in akonadi (Ubuntu):
status: New → Confirmed
importance: Undecided → High
Rik Mills (rikmills)
Changed in akonadi (Ubuntu):
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package akonadi - 4:18.04.3-0ubuntu2

---------------
akonadi (4:18.04.3-0ubuntu2) cosmic; urgency=medium

  * Update mysql backend apparmor profile. (LP: #1797643)

 -- Rik Mills <email address hidden> Sat, 13 Oct 2018 11:15:42 +0100

Changed in akonadi (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
In , Dvratil-7 (dvratil-7) wrote :
Revision history for this message
In , Sknauss (sknauss) wrote :

A working workaround is to install mariadb-server than my_print_defaults gets installed. But this doesn't feel like a good solution, we should better make sure that my_print_defaults gets to mariadb-server-core.

Revision history for this message
In , Sknauss (sknauss) wrote :

Additionally I needed to replace:

   rm /usr/sbin/mysqld-akonadi
   ln -s /usr/sbin/mysqld /usr/sbin/mysqld-akonadi

still an issue for 18.08.1. @dvratil so you check does not help here, because we need my_print_defaults in both cases.

Revision history for this message
In , Jonathan Riddell (jr) wrote :

I can recreate this using KDE neon user edition ISO from today, the ISO image must be installed (not live) to get the problem

Revision history for this message
In , Jonathan Riddell (jr) wrote :

For now I've added in this more permissive change to apparmour permissions from kubuntu which seems to stop the first-run error
https://launchpadlibrarian.net/393075010/akonadi_4%3A18.04.3-0ubuntu1_4%3A18.04.3-0ubuntu2.diff.gz
Switching to a symlink as suggested by Sandro may make more sense.
I'm unclear what this stuff about mariadb is about.

Revision history for this message
In , Jonathan Riddell (jr) wrote :

the apparmour update has now been deployed and testing on virtualbox and docker with new installs kontact runs fine

Changed in akonadi:
importance: Unknown → Critical
Revision history for this message
In , Cfeck (cfeck) wrote :

Can this closed?

Revision history for this message
James Pirie (jkp-k) wrote :

Hi there,
I don't think this is solved in Kubuntu 18.10 Cosmic!

Today I tried to open a new account for my wife. New user created using terminal and all correct permissions for home directory ownership etc applied.

Cannot use Kontact PIM due to Akonadi not starting correctly!

dorell@Kubasus:~$ akonadictl start
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
dorell@Kubasus:~$ WARNING: Could not write to config file /usr/my-new.cnf: Permission denied

FATAL ERROR: Neither host 'Kubasus' nor 'localhost' could be looked up with
/usr/bin/resolveip
Please configure the 'hostname' command to return a correct
hostname.
If you want to solve this at a later stage, restart this script
with the --force option
/usr/bin/mysqlcheck: Got error: 1049: Unknown database 'akonadi' when selecting the database
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
org.kde.pim.akonadicontrol: Agent instance "akonadi_baloo_indexer" has no interface!
org.kde.pim.akonadicontrol: Agent instance "akonadi_baloo_indexer" has no interface!
org.kde.pim.akonadicontrol: ProcessControl: Application "/usr/bin/akonadi_baloo_indexer" stopped unexpectedly ( "Process crashed" )
org.kde.pim.akonadicontrol: Application '/usr/bin/akonadi_baloo_indexer' crashed! 1 restarts left.
QProcess: Destroyed while process ("/usr/bin/akonadi_baloo_indexer") is still running.
org.kde.pim.akonadicontrol: ProcessControl: Application "/usr/bin/akonadi_baloo_indexer" stopped unexpectedly ( "Process crashed" )
org.kde.pim.akonadicontrol: Application '/usr/bin/akonadi_baloo_indexer' crashed! 0 restarts left.
org.kde.pim.kidentitymanagement: IdentityManager: There was no default identity. Marking first one as default.
org.kde.pim.maildirresource: the resource is not properly configured: there is no config file for the resource. We create a new one.
org.kde.pim.kidentitymanagement: IdentityManager: There was no default identity. Marking first one as default.
QObject::killTimer: Timers cannot be stopped from another thread
org.kde.pim.akonadi_indexer_agent: Xapian error in indexer: Document 2 not found

I created mkdir -p ~/.local/share/akonadi/db_data as per the workaround but this has not helped.

I wonder if this is the same problem or a different one? I'm not sure but I know that I cannot use Kontact/KMail because Akonadi refuses to play.

I'm not a very advanced user buut I can follow instructions and use the Terminal when asked :) If I should provide further detail than please ask.

Thanks.

James

Revision history for this message
In , Sknauss (sknauss) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.