Bug 259524 - akonadi server cannot connect to MySQL server
Summary: akonadi server cannot connect to MySQL server
Status: RESOLVED FIXED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: server (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
: 259047 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-12-11 15:09 UTC by Alex Merry
Modified: 2010-12-28 15:42 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Merry 2010-12-11 15:09:23 UTC
Version:           unspecified (using Devel) 
OS:                Linux

I'm running KDE trunk.  I just updated yesterday (previously I was running trunk from a couple of weeks ago), and akonadi server has stopped working.

What I've found is that starting akonadi server starts mysqld, which runs just fine, but then akonadi server can't connect to it:


Database error: Cannot open database.
Last driver error: "QMYSQL: Unable to connect"
Last database error: "Can't connect to local MySQL server through socket '/home/alex/.local/share/akonadi/db_misc/mysql.socket' (2)"
Unable to open database "Can't connect to local MySQL server through socket '/home/alex/.local/share/akonadi/db_misc/mysql.socket' (2) QMYSQL: Unable to connect"
"[
0: akonadiserver(_Z11akBacktracev+0x30) [0x490fcc]
1: akonadiserver() [0x491312]
2: /lib/libc.so.6(+0x32610) [0x7fdac6623610]
3: /lib/libc.so.6(gsignal+0x35) [0x7fdac6623595]
4: /lib/libc.so.6(abort+0x186) [0x7fdac6624a16]
5: /usr/lib/libQtCore.so.4(_Z17qt_message_output9QtMsgTypePKc+0x6f) [0x7fdac852c4ff]
6: akonadiserver(_ZN15FileDebugStream9writeDataEPKcx+0x114) [0x492392]
7: /usr/lib/libQtCore.so.4(_ZN9QIODevice5writeEPKcx+0x77) [0x7fdac85b87f7]
8: /usr/lib/libQtCore.so.4(+0xfebe6) [0x7fdac85c0be6]
9: /usr/lib/libQtCore.so.4(_ZN11QTextStreamD1Ev+0x3b) [0x7fdac85c9aab]
10: akonadiserver(_ZN6QDebug6StreamD1Ev+0x29) [0x48bcfb]
11: akonadiserver(_ZN6QDebugD1Ev+0x9b) [0x48bdb7]
12: akonadiserver(_ZN7Akonadi13AkonadiServerC2EP7QObject+0x529) [0x492f99]
13: akonadiserver(_ZN7Akonadi13AkonadiServer8instanceEv+0x30) [0x494456]
14: akonadiserver(main+0x35c) [0x48b821]
15: /lib/libc.so.6(__libc_start_main+0xfd) [0x7fdac660fc4d]
16: akonadiserver() [0x48b3d9]
]
"
ProcessControl: Application 'akonadiserver' returned with exit code 255 (Unknown error)


MySql's socket is in /tmp/akonadi-alex.UqVHzh, not where akonadi server is looking for it.  The problem appears to be commit e4affdfc2922efc10b647939fd4e068c02e256eb, which changes the preferred socket directory.  However, akonadi has previously put the following in the akonadiserverrc:

[QMYSQL]
Name=akonadi
Host=
Options="UNIX_SOCKET=/home/alex/.local/share/akonadi/db_misc/mysql.socket"
ServerPath=/usr/sbin/mysqld
StartServer=true


As a result, it's still looking where the socket used to be.

Clearly, I can change this.  In fact, deleting akonadiserverrc fixes the issue.  However, this seems to be an upgrade path issue.

Also, I suggest doing a `git grep db_misc` in the akonadi source code to see where the old socket folder is referenced from.  There are a couple of shell scripts that look like they might need changing.

Reproducible: Always
Comment 1 Christoph Feck 2010-12-11 15:17:35 UTC
*** Bug 259047 has been marked as a duplicate of this bug. ***
Comment 2 Christoph Feck 2010-12-11 15:20:55 UTC
Additionally, it should probably use the ksocket-<user> directory instead of /tmp directly.

(or maybe it's time to try the sqlite backend :)
Comment 3 Michael Pyne 2010-12-16 04:31:27 UTC
I've been bit hard by this. Had the email drafted and everything, had to kill Kontact after it froze trying to send Akonadi a DBus message which never received a reply (apparently because Akonadi was waiting for mysql). Email didn't come back after rebooting Kontact. :(
Comment 4 Christophe Marin 2010-12-28 10:25:10 UTC
Can you update your akonadi checkout and retry ? This should be fixed now. [1]

See http://gitweb.kde.org/akonadi.git/commit/1fa22c55fd98f29321b943605466ef4d4640de53
Comment 5 Alex Merry 2010-12-28 13:55:03 UTC
I can't test it, as I manually fixed the configuration so I could continue using KMail.
Comment 6 Volker Krause 2010-12-28 15:41:42 UTC
Fixed with commit 1fa22c55fd98f29321b943605466ef4d4640de53.