Akonadi Console Launch: Failed to connect to database: Can't connect to local MySQL server through socket '/run/user/1000/akonadi/mysql.socket' (2) QMYSQL: Unable to connect

Bug #1876398 reported by Joshua Peisach
32
This bug affects 4 people
Affects Status Importance Assigned to Milestone
akonadi (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Launching Akonadi Console:

Failed to connect to database: Can't connect to local MySQL server through socket '/run/user/1000/akonadi/mysql.socket' (2) QMYSQL: Unable to connect

Running on Focal, installed all Plasma packages and KDE packages with no install recommends

sudo apt-get install kde-* plasma-* --no-install-recommends

Could be an issue on my end.

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: akonadiconsole 4:19.12.3-0ubuntu1
ProcVersionSignature: Ubuntu 5.4.0-28.32-generic 5.4.30
Uname: Linux 5.4.0-28-generic x86_64
ApportVersion: 2.20.11-0ubuntu27
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: KDE
Date: Fri May 1 22:06:25 2020
ExecutablePath: /usr/bin/akonadiconsole
InstallationDate: Installed on 2020-05-02 (0 days ago)
InstallationMedia: Kubuntu 20.04 LTS "Focal Fossa" - Release amd64 (20200423)
ProcEnviron:
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: akonadiconsole
UpgradeStatus: No upgrade log present (probably fresh install)
XsessionErrors:
 (process:1265): GLib-CRITICAL **: 22:01:26.926: g_atomic_ref_count_dec: assertion 'g_atomic_int_get (arc) > 0' failed
 (process:1265): GLib-CRITICAL **: 22:01:26.926: g_atomic_ref_count_dec: assertion 'g_atomic_int_get (arc) > 0' failed

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

akonadi recommends it's mysql backend, not depends on it, as you can validly choose alternative such as the sqlite or postgresql ones. so looks like you broke things yourself by weirdly doing -no-install-recommends

Also there is no need to report the same not bug 11 times!

affects: akonadiconsole (Ubuntu) → akonadi (Ubuntu)
Changed in akonadi (Ubuntu):
status: New → Invalid
Revision history for this message
Juan Canham (riotingpacifist) wrote :

Bug present even when akonadi-backend-mysql installed,

akonadi-backend-mysql 4:19.12.3-0ubuntu2

Plus the dependencies for the package are wrong if a package depends on A or B or C, setting it to recommends A and B and C isn't the same thing.

Changed in akonadi (Ubuntu):
status: Invalid → New
Revision history for this message
Juan Canham (riotingpacifist) wrote :

It appears that akondictl stop doesn't cleanup mysqld-akonadictl

Akonadi Control: stopped
Akonadi Server: stopped
Akonadi Server Search Support: available (Remote Search, Akonadi Search Plugin)
Available Agent Types: akonadi_akonotes_resource, akonadi_archivemail_agent, akonadi_birthdays_resource, akonadi_contacts_resource, akonadi_davgroupware_resource, akonadi_ews_resource, akonadi_ewsmta_resource, akonadi_followupreminder_agent, akonadi_googlecalendar_resource, akonadi_googlecontacts_resource, akonadi_ical_resource, akonadi_icaldir_resource, akonadi_imap_resource, akonadi_indexing_agent, akonadi_kalarm_dir_resource, akonadi_kalarm_resource, akonadi_kolab_resource, akonadi_maildir_resource, akonadi_maildispatcher_agent, akonadi_mailfilter_agent, akonadi_mbox_resource, akonadi_migration_agent, akonadi_mixedmaildir_resource, akonadi_newmailnotifier_agent, akonadi_notes_agent, akonadi_notes_resource, akonadi_openxchange_resource, akonadi_pop3_resource, akonadi_sendlater_agent, akonadi_tomboynotes_resource, akonadi_unifiedmailbox_agent, akonadi_vcard_resource, akonadi_vcarddir_resource

$ akonadictl start
org.kde.pim.akonadicontrol: Service org.freedesktop.Akonadi.Control.lock already registered, terminating now.
Error: akonadi_control was started but didn't register at D-Bus session bus.
Make sure your system is set up correctly!

$ org.kde.pim.akonadiserver: Failed to connect to database!
org.kde.pim.akonadiserver: Database error: "Can't connect to local MySQL server through socket '/run/user/1000/akonadi/mysql.socket' (2) QMYSQL: Unable to connect"
org.kde.pim.akonadiserver: Shutting down AkonadiServer...
org.kde.pim.akonadicontrol: Application '/usr/bin/akonadiserver' exited normally...

$ pkill mysqld-akonadi

$ akonadictl start
<Works>

I've also attached the full output of akonadiselftest, but AFAICT there is nothing of use in there.

Revision history for this message
Juan Canham (riotingpacifist) wrote :

I think this should address the dependency problem, apologies if the patch isn't against the corrupt upstream.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Patch to create akonadi backend any" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Juan Canham (riotingpacifist) wrote :

Attached the crashlog, unfortunately I couldn't get all of the symbols but I can reproduce the bug 100% of the time, so if somebody how to get the debug symbols I'll be happy to help.

Revision history for this message
Juan Canham (riotingpacifist) wrote :

Attached the log from akonadictl --verbose stop

Changed in akonadi (Ubuntu):
status: New → Invalid
status: Invalid → New
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in akonadi (Ubuntu):
status: New → Confirmed
Rik Mills (rikmills)
Changed in akonadi (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Encolpe Degoute (encolpe) wrote :

This bug last for years around akonadictl.
What seems to happen: the mysql crash partialy letting a mysqld-ak process locking the $HOME/.local/share/akonadi/db_data/ibdata1 file. I don't know why but other files seem to block the restart.

So:
1. Verify that the akonadictl is stopped
2. Kill the mysqld-ak process
3. Cleanup files
4. Restart akonadictl

akonadictl stop #Optional
cd $HOME/.local/share/akonadi/db_data
kill $(lsof $HOME/.local/share/akonadi/db_data/ibdata1 | cut -d ' ' -f 2)
rm mysql.err* multi-master.info ib_logfile* aria_log*
akonadictl --verbose start

This not fix the upstream bug that crash the mysqld service.

In some extrem case I remove the $HOME/.local/share/akonadi/db_data folder.
You will loose your IMAP cache but not your account configuration.

Revision history for this message
Nick Law (partialvolume) wrote (last edit ):

I also have this problem. It's only started in the last few days. I've been using kmail & akonadi for years now so am familiar with how it normally operates.

This message pops up in a "Error - Akonadi Console" message box.

>Failed to connect to database: Can't connect to local MySQL server through socket '/run/user/1000/akonadi/mysql.socket' (2) QMYSQL: Unable to connect

I have to use the akonadi console to restart various agents. Also I'm unable to send/receive emails until I restart various agents in akonadi. As soon as reboot my laptop the message pops up again. 100% reproducible.

The workaround provided by Encolpe Degoute in the previous post seems to have got rid of the akonadi mysql error for me https://bugs.launchpad.net/ubuntu/+source/akonadi/+bug/1876398/comments/10

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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