Korganizer not working: the Akonadi PIM service is not running

I use Korganizer in task bar, today i was going to register a date and I found this error, a START button appears. Clicking START returns an error: the AKonadi PIM service is not operational. I have tried to start akonadi:


fernando@andromeda:~> akonadictl start
fernando@andromeda:~> Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
org.kde.pim.akonadiserver: Starting up the Akonadi Server...
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-fernando.lI3XC2/mysql.socket' (111) 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 'akonadiserver' exited normally...

fernando@andromeda:~> 

I dint remember having mysql running but it might be so, so I checked:


andromeda:~ # service mysql status 
● mariadb.service - MySQL server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
   Active: inactive (dead)
andromeda:~ # 

Well, It is not running… might be simply dead, but what baffled me is that is disabled… well, I try to start it


andromeda:~ # service mysql restart

andromeda:~ # 
andromeda:~ # service mysql status 
● mariadb.service - MySQL server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
   Active: active (running) since Sat 2020-06-06 12:27:58 CEST; 17s ago
  Process: 10177 ExecStartPre=/usr/lib/mysql/mysql-systemd-helper upgrade (code=exited, status=0/SUCCESS)
  Process: 10110 ExecStartPre=/usr/lib/mysql/mysql-systemd-helper install (code=exited, status=0/SUCCESS)
 Main PID: 10183 (mysqld)
   Status: "Taking your SQL requests now..."
    Tasks: 30
   CGroup: /system.slice/mariadb.service
           └─10183 /usr/sbin/mysqld --defaults-file=/etc/my.cnf --user=mysql

Jun 06 12:27:57 andromeda mysql-systemd-helper[10110]: rcmysql start
Jun 06 12:27:57 andromeda mysql-systemd-helper[10110]: You can test the MariaDB daemon with mariadb-test package
Jun 06 12:27:57 andromeda mysql-systemd-helper[10110]: Please report any problems at http://mariadb.org/jira
Jun 06 12:27:57 andromeda mysql-systemd-helper[10110]: The latest information about MariaDB is available at http://mariadb.org/.
Jun 06 12:27:57 andromeda mysql-systemd-helper[10110]: You can find additional information about the MySQL part at:
Jun 06 12:27:57 andromeda mysql-systemd-helper[10110]: http://dev.mysql.com
Jun 06 12:27:57 andromeda mysql-systemd-helper[10110]: Consider joining MariaDB's strong and vibrant community:
Jun 06 12:27:57 andromeda mysql-systemd-helper[10110]: https://mariadb.org/get-involved/
Jun 06 12:27:57 andromeda mysql-systemd-helper[10183]: 2020-06-06 12:27:57 139907386782592 [Note] /usr/sbin/mysqld (mysqld 10.2.31-MariaDB) starting as process 10183 ...
Jun 06 12:27:58 andromeda systemd[1]: Started MySQL server.
andromeda:~ # 

Well, it seemed it worked, so I try to start akonadi again


fernando@andromeda:~> akonadictl start
fernando@andromeda:~> Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
org.kde.pim.akonadiserver: Starting up the Akonadi Server...
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-fernando.lI3XC2/mysql.socket' (111) 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 'akonadiserver' exited normally...

fernando@andromeda:~> 


Same error… I don’t know waht to do now, some ideas please?

best regards

IMHO you now (tried to) start the system MySQL/MariaDB server, which is not configured by you, nor needed I assume. This is different from the database run by KDE-PIM for a user (of which there can be of course more running for every user that is loged in and uses KDE-PIM).

  1. Is the systemd “mysql.service” enabled and running?
  2. What’s the contents of “~/.local/share/akonadi/”?
  3. In “~/.local/share/akonadi/”, do the Akonadi Control and Server error files give any indication of why it ain’t starting? – There should be only entries related to “Connecting to deprecated signal” in there …
  4. In “~/.local/share/akonadi/”, is there a symbolic link for a socket present, pointing to a user’s directory in “/tmp/”?
  5. Are the Akonadi configuration files present in “~/.config/”?

Hm, I am still not convinced that your item 1 above is needed.

Please compare these two 15.1 systems, both with a user loged in using KDE.
On the first one mysql.service is disable, nevertheless the user reports no problems in using KDE-PIM.

mgi@beneden:~> ps -ef | grep mysq
marian    1424  1409  0 09:16 ?        00:00:15 /usr/sbin/mysqld --defaults-file=/home/marian/.local/share/akonadi/mysql.conf --datadir=/home/marian/.local/share/akonadi/db_data/ --socket=/tmp/akonadi-marian.Cgk00M/mysql.socket --pid-file=/tmp/akonadi-marian.Cgk00M/mysql.pid
mgi       9693  9652  0 14:10 pts/0    00:00:00 grep --color=auto mysq
mgi@beneden:~> systemctl status mysql
● mariadb.service - MySQL server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
   Active: inactive (dead)
mgi@beneden:~

This one also has a LAMP server role and thus mysql is enabled and running:

henk@boven:~> ps -ef | grep mysq
mysql      702     1  0 09:09 ?        00:00:10 /usr/sbin/mysqld --defaults-file=/etc/my.cnf --user=mysql
henk      1352  1343  0 09:09 ?        00:00:14 /usr/sbin/mysqld --defaults-file=/home/henk/.local/share/akonadi/mysql.conf --datadir=/home/henk/.local/share/akonadi/db_data/ --socket=/tmp/akonadi-henk.F9CpFi/mysql.socket --pid-file=/tmp/akonadi-henk.F9CpFi/mysql.pid
henk     11074 11050  0 14:11 pts/2    00:00:00 grep --color=auto mysq
henk@boven:~> systemctl status mysql
● mariadb.service - MySQL server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
   Active: active (running) since Sat 2020-06-06 09:09:08 CEST; 5h 3min ago
  Process: 655 ExecStartPre=/usr/lib/mysql/mysql-systemd-helper upgrade (code=exited, status=0/SUCCESS)
  Process: 630 ExecStartPre=/usr/lib/mysql/mysql-systemd-helper install (code=exited, status=0/SUCCESS)
 Main PID: 702 (mysqld)
   Status: "Taking your SQL requests now..."
    Tasks: 30
   CGroup: /system.slice/mariadb.service
           └─702 /usr/sbin/mysqld --defaults-file=/etc/my.cnf --user=mysql

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
henk@boven:~>

it wasn’t but I think it has never been. Anyway starting it does not change anything.

  1. What’s the contents of “~/.local/share/akonadi/”?

fernando@andromeda:~> ls .local/share/akonadi/ -l
total 28
-rw-r--r-- 1 fernando users  150 jun  6 12:33 akonadi_control.error
-rw-r--r-- 1 fernando users  150 jun  6 12:33 akonadi_control.error.old
-rw-r--r-- 1 fernando users    0 jun  6 12:33 akonadictl.error
-rw-r--r-- 1 fernando users    0 jun  6 12:33 akonadictl.error.old
-rw-r--r-- 1 fernando users  289 jun  6 12:33 akonadiserver.error
-rw-r--r-- 1 fernando users  289 jun  6 12:33 akonadiserver.error.old
srwxr-xr-x 1 fernando users    0 abr  6  2011 akonadiserver.socket
drwxr-xr-x 1 fernando users  410 may 30 17:30 db_data
drwxr-xr-x 1 fernando users    0 abr  6  2011 db_misc
drwxr-xr-x 1 fernando users    0 ago 27  2010 file_db_data
-rw-r--r-- 1 fernando users 3423 nov 27  2019 mysql.conf
drwxr-xr-x 1 fernando users   22 ago 10  2017 search_db
lrwxrwxrwx 1 fernando users   28 feb  5  2019 socket-andromeda -> /tmp/akonadi-fernando.lI3XC2
lrwxrwxrwx 1 fernando users   28 feb  6  2019 socket-andromeda.samara.com.es -> /tmp/akonadi-fernando.z3OqhN
fernando@andromeda:~> 

  1. In “~/.local/share/akonadi/”, do the Akonadi Control and Server error files give any indication of why it ain’t starting? – There should be only entries related to “Connecting to deprecated signal” in there …

It seems to be the same information I reported previously.


fernando@andromeda:~> cat .local/share/akonadi/akonadi_control.error
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
Application 'akonadiserver' exited normally...
fernando@andromeda:~> cat .local/share/akonadi/akonadiserver.error
Starting up the Akonadi Server...
Failed to connect to database!
Database error: "Can't connect to local MySQL server through socket '/tmp/akonadi-fernando.lI3XC2/mysql.socket' (111) QMYSQL: Unable to connect"
Failed to remove runtime connection config file
Shutting down AkonadiServer...
fernando@andromeda:~> 


  1. In “~/.local/share/akonadi/”, is there a symbolic link for a socket present, pointing to a user’s directory in “/tmp/”?

Yes

  1. Are the Akonadi configuration files present in “~/.config/”?

These files?

fernando@andromeda:~> ls  .config/akonadi
agent_config_akonadi_akonotes_resource_0                  agent_config_akonadi_googlecalendar_resource_1              agent_config_akonadi_notes_agent_changes.dat
agent_config_akonadi_akonotes_resource_0_changes.dat      agent_config_akonadi_googlecalendar_resource_1_changes.dat  agent_config_akonadi_openxchange_resource_1
agent_config_akonadi_archivemail_agent_changes.dat        agent_config_akonadi_indexing_agent                         agent_config_akonadi_openxchange_resource_1_changes.dat
agent_config_akonadi_davgroupware_resource_4              agent_config_akonadi_indexing_agent_changes.dat             agent_config_akonadi_sendlater_agent_changes.dat
agent_config_akonadi_davgroupware_resource_4_changes.dat  agent_config_akonadi_maildir_resource_0                     agent_config_akonadi_unifiedmailbox_agent
agent_config_akonadi_davgroupware_resource_5              agent_config_akonadi_maildir_resource_0_changes.dat         agent_config_akonadi_unifiedmailbox_agent_changes.dat
agent_config_akonadi_davgroupware_resource_5_changes.dat  agent_config_akonadi_maildispatcher_agent_changes.dat       agentsrc
agent_config_akonadi_facebook_resource_0                  agent_config_akonadi_mailfilter_agent_changes.dat           akonadiserverrc
agent_config_akonadi_facebook_resource_0_changes.dat      agent_config_akonadi_migration_agent_changes.dat
agent_config_akonadi_followupreminder_agent_changes.dat   agent_config_akonadi_newmailnotifier_agent_changes.dat
fernando@andromeda:~> 

Check the permissions of /tmp/akonadi-fernando.lI3XC2/mysql.socket


fernando@andromeda:~> ls -l /tmp/akonadi-fernando.lI3XC2/mysql.socket
srwxrwxrwx 1 fernando users 0 may 30 17:31 /tmp/akonadi-fernando.lI3XC2/mysql.socket
fernando@andromeda:~> 

That’s only the content of the directory “~/.config/akonadi/” – there’re also Akonadi configuration files in “~/.config/” …

  • “akonadi*” …
  1. Does the directory /tmp/akonadi-fernando.z3OqhN/ exist and, does it have content?
  2. Is there any reference to either “socket-andromeda.samara.com.es” or “/tmp/akonadi-fernando.z3OqhN” in the Akonadi configuration files in “~/.config/”?

fernando@andromeda:~> ls .config/ako*
.config/akonadi_akonotes_resource_0rc  .config/akonadi_davgroupware_resource_4rc    .config/akonadi_indexing_agentrc      .config/akonadi_mailfilter_agentrc       .config/akonadi_openxchange_resource_1rc
.config/akonadi_akonotes_resource_4rc  .config/akonadi_davgroupware_resource_5rc    .config/akonadi_maildir_resource_0rc  .config/akonadi-migrationrc
.config/akonadi_akonotes_resource_5rc  .config/akonadi-firstrunrc                   .config/akonadi_maildir_resource_1rc  .config/akonadi_newmailnotifier_agentrc
.config/akonadi_contactrc              .config/akonadi_googlecalendar_resource_1rc  .config/akonadi_maildir_resource_2rc  .config/akonadi_notes_agentrc

.config/akonadi:
agent_config_akonadi_akonotes_resource_0                  agent_config_akonadi_googlecalendar_resource_1              agent_config_akonadi_notes_agent_changes.dat
agent_config_akonadi_akonotes_resource_0_changes.dat      agent_config_akonadi_googlecalendar_resource_1_changes.dat  agent_config_akonadi_openxchange_resource_1
agent_config_akonadi_archivemail_agent_changes.dat        agent_config_akonadi_indexing_agent                         agent_config_akonadi_openxchange_resource_1_changes.dat
agent_config_akonadi_davgroupware_resource_4              agent_config_akonadi_indexing_agent_changes.dat             agent_config_akonadi_sendlater_agent_changes.dat
agent_config_akonadi_davgroupware_resource_4_changes.dat  agent_config_akonadi_maildir_resource_0                     agent_config_akonadi_unifiedmailbox_agent
agent_config_akonadi_davgroupware_resource_5              agent_config_akonadi_maildir_resource_0_changes.dat         agent_config_akonadi_unifiedmailbox_agent_changes.dat
agent_config_akonadi_davgroupware_resource_5_changes.dat  agent_config_akonadi_maildispatcher_agent_changes.dat       agentsrc
agent_config_akonadi_facebook_resource_0                  agent_config_akonadi_mailfilter_agent_changes.dat           akonadiserverrc
agent_config_akonadi_facebook_resource_0_changes.dat      agent_config_akonadi_migration_agent_changes.dat
agent_config_akonadi_followupreminder_agent_changes.dat   agent_config_akonadi_newmailnotifier_agent_changes.dat
fernando@andromeda:~> 


yes

fernando@andromeda:~> ls -l /tmp/akonadi-fernando.z3OqhN/
total 0
srwxr-xr-x 1 fernando users 0 feb 10  2019 akonadiserver-cmd.socket
srwxr-xr-x 1 fernando users 0 feb 10  2019 akonadiserver-ntf.socket
fernando@andromeda:~> 

  1. Is there any reference to either “socket-andromeda.samara.com.es” or “/tmp/akonadi-fernando.z3OqhN” in the Akonadi configuration files in “~/.config/”?

No, only to /tmp/akonadi-fernando.lI3XC2/mysql.socket


fernando@andromeda:~> cat .config/*rc |grep /tmp/akonadi-fernando.z3OqhN
fernando@andromeda:~> cat .config/*rc |grep socket-andromeda.samara.com.es
fernando@andromeda:~> cat .config/akonadi/*rc |grep socket-andromeda.samara.com.es
fernando@andromeda:~> cat .config/akonadi/*rc |grep /tmp/akonadi-fernando.z3OqhN
fernando@andromeda:~> 


fernando@andromeda:~> cat .config/akonadi/akonadiserverrc
[Debug]
Tracer=null

%General]
Driver=QMYSQL

[QMYSQL]
Host=
Name=akonadi
Options="UNIX_SOCKET=/tmp/akonadi-fernando.lI3XC2/mysql.socket"
ServerPath=/usr/sbin/mysqld
StartServer=true
fernando@andromeda:~> 

Please show content of akonadiserverrc ( you should not have two symlinks in your ~/.local/share/akonadi )

Also show the permissions of the other /tmp entry for akonadi

It is the one in the post above isn’t it? (.config/akonadi/akonadiserverrc)

Also show the permissions of the other /tmp entry for akonadi[/QUOTE]


fernando@andromeda:~> ls -l /tmp |grep akonadi
drwx------ 1 fernando users       120 may 30 17:31 akonadi-fernando.lI3XC2
drwx------ 1 fernando users        96 ene 18  2019 akonadi-fernando.vMKry9
drwx------ 1 fernando users        96 feb 10  2019 akonadi-fernando.z3OqhN
fernando@andromeda:~> 


Rename tmp/akonadi-fernando.lI3XC2/mysql.socket to tmp/akonadi-fernando.lI3XC2/mysql.socket.old and try to start akonadi

yep, it worked!

Did you also do the following? – You should do this as well …

  1. Unlink “~/.local/share/akonadi/socket-andromeda.samara.com.es” and, remove the directory “/tmp/akonadi-fernando.z3OqhN/” and it’s contents.
  2. There’s another Akonadi sockets directory in “/tmp/”: “/tmp/akonadi-fernando.vMKry9/” – Also remove that directory and it’s contents.

Done. thanks.

Awesome. Thanks for reporting back

The same with Tumbleweed. But there is a bit different.

Hi, I am in a very similar situation with the difference (if any) that my system is Tumbleweed instaed of LEAP.
Anyway, my akonadiserverrc in ~/.config/akonadi has the following lines in it

[QMYSQL]
Host=
Name=akonadi
Options="UNIX_SOCKET=/run/user/1000/akonadi/mysql.socket"

(NB: 1000 is my user id)

so I renamed the file /run/user/1000/akonadi/mysql.socket in /run/user/1000/akonadi/mysql.socket.old but after restarting akonadi with: akonadictl start
I got the following error:

**lnx-marco:/run/user #** akonadictl start
QStandardPaths: runtime directory '/run/user/1000' is not owned by UID 0, but a directory permissions 0700 owned by UID 1000 GID 100
QStandardPaths: runtime directory '/run/user/1000' is not owned by UID 0, but a directory permissions 0700 owned by UID 1000 GID 100
D-Bus session bus is not available!
KCrash: Application 'akonadictl' crashing...
KCrash: Attempting to start /usr/lib64/libexec/drkonqi
QStandardPaths: runtime directory '/run/user/1000' is not owned by UID 0, but a directory permissions 0700 owned by UID 1000 GID 100
QStandardPaths: runtime directory '/run/user/1000' is not owned by UID 0, but a directory permissions 0700 owned by UID 1000 GID 100

I switched back to the original name but I still get the same error… what can I do now?
thanks for any suggestions
Marco