Akonadi fails to start

KDE Plasma: 5.10.5
KDE Frameworks: 5.37.0
Qt: 5.9.1
Kernel 4.13.1-1-defaults

Akonadi is failing to start with the following message

lucifer@andromeda-ascendant:/tmp/akonadi-lucifer.X4xmhf> akonadictl start                                 
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)    
lucifer@andromeda-ascendant:/tmp/akonadi-lucifer.X4xmhf> 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"                                                 
org.kde.pim.akonadiserver: arguments: ("--defaults-file=/home/lucifer/.local/share/akonadi/mysql.conf", "--datadir=/home/lucifer/.local/share/akonadi/db_data/", "--socket=/tmp/akonadi-lucifer.X4xmhf/mysql.socket", "--pid-file=/tmp/akonadi-lucifer.X4xmhf/mysql.pid") 
org.kde.pim.akonadiserver: stdout: ""                
org.kde.pim.akonadiserver: stderr: "2017-09-25 15:12:51 139908936808768 [Note] /usr/sbin/mysqld (mysqld 10.1.25-MariaDB) starting as process 17863 ...
"                                                            
org.kde.pim.akonadiserver: exit code: 1              
org.kde.pim.akonadiserver: process error: "Unknown error"                                                 
/usr/bin/mysqladmin: connect to server at 'localhost' failed                                              
error: 'Can't connect to local MySQL server through socket '/tmp/akonadi-lucifer.X4xmhf/mysql.socket' (2 "No such file or directory")'                                                                               
Check that mysqld is running and that the socket: '/tmp/akonadi-lucifer.X4xmhf/mysql.socket' exists!      
org.kde.pim.akonadiserver: Failed to remove runtime connection config file                                
org.kde.pim.akonadicontrol: Application 'akonadiserver' exited normally...

The socket file does not exist

lucifer@andromeda-ascendant:~> cd /tmp/akonadi-lucifer.X4xmhf/                                            
lucifer@andromeda-ascendant:/tmp/akonadi-lucifer.X4xmhf> ls

Searching the Internet suggests that I should manually create the socket, which I do using python as I’m not sure how to do so in bash.

lucifer@andromeda-ascendant:/tmp/akonadi-lucifer.X4xmhf> python -c "import socket as s; sock = s.socket(s.AF_UNIX); sock.bind('/tmp/akonadi-lucifer.X4xmhf/mysql.socket')"                                           
lucifer@andromeda-ascendant:/tmp/akonadi-lucifer.X4xmhf> ls -l                                            
total 0                                              
srwxr-xr-x 1 lucifer users 0 Sep 25 15:14 mysql.socket

This time trying to start akonadi results in a connection refused error.

lucifer@andromeda-ascendant:/tmp/akonadi-lucifer.X4xmhf> akonadictl start
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)    
lucifer@andromeda-ascendant:/tmp/akonadi-lucifer.X4xmhf> org.kde.pim.akonadiserver: Failed to connect to database!                                                                                                   
org.kde.pim.akonadiserver: Database error: "Can't connect to local MySQL server through socket '/tmp/akonadi-lucifer.X4xmhf/mysql.socket' (111 \"Connection refused\") QMYSQL: Unable to connect"                    
org.kde.pim.akonadiserver: Failed to remove runtime connection config file                                
org.kde.pim.akonadicontrol: Application 'akonadiserver' exited normally...

The Internet suggests deleting the socket file and letting akonadi create a new one which results in the first error again! I have tried removing all the files ~/.config/akonadi* and going through this process again but got the same results. If it makes a difference this machine has been installed recently with the user home directory kept from Kubuntu, 16.something I think.

If you deleted ~/.config/akonadi you threw away the accounts. If you want to start from scratch there’s a couple of things to consider:

  • Was ~/.local/share/akonadi removed as well?
  • Is the UUID in /home/your_user_on_opensuse_as_well_as_kubuntu the same. Also check the group ID,
  • Did you really delete stuff, or rename it ( if the latter we could check what’s going wrong ) ?

Some further remarks to what Knurpht already wrote.
(and yes, considering what he wrote may just as well help you already… :wink: )

That’s nonsense, where did you find this advise?

The socket file is created by the mysql server, and that one fails to start in your case.

The Internet suggests deleting the socket file and letting akonadi create a new one

That is correct in so far as that there was a bug that Akonadi didn’t start if it already existed…

Should be fixed meanwhile though.
So again, nonsense… :stuck_out_tongue:

Please don’t follow random advise from “the Internet” if you are not sure it applies to your situation.
Many users (Windows users in particular) have actively broken their system in the past by doing that… :wink:

I forgot to delete ~/.local/share/akonadi which has solved it. I’m OK with starting from scratch this time as I only had two accounts to set up and I just needed to get it working.

Thanks for your help/

It was on a mysql forum; I figured they’d know what they were talking about but it didn’t make any difference anyway. I vaguely recall a few years ago having to manually create a socket file on a CentOS server to get mysql working on it.

Heh! It was your advice about deleting the socket which is actually pretty **** random; in my mind anyway :smiley:

There is a difference between starting mysql yourself and using Akonadi though.

And actually that’s one example what I meant by “random advises”… :wink:

Heh! It was your advice about deleting the socket which is actually pretty **** random; in my mind anyway :smiley:

As I wrote, there was a bug in Akonadi that it didn’t start when the socket file already existed.
I agree, there were threads about this here where I suggested to delete that file.

But the problem is fixed by now, and Tumbleweed is always changing and getting the latest and greatest.
So… :wink:

Well, let’s agree we have a solution to regenerate the akonadi database.

Well, it’s happily using the socket so…