Bug 270720

Summary: Akonadi can't find or load MySql Qt plugin (libqsqlmysql.so) and crashes
Product: [Frameworks and Libraries] Akonadi Reporter: Gatoso <gatoso>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED NOT A BUG    
Severity: crash    
Priority: NOR    
Version: 1.5.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Screenshot when KMail try to start Akonadi and it fails
Archlinux PKGBUILD bash script for building Qt
Archlinux PKGBUILD bash script for building Akonadi

Description Gatoso 2011-04-11 23:49:45 UTC
Created attachment 58810 [details]
Screenshot when KMail try to start Akonadi and it fails

Version:           1.5.0 (using KDE 4.6.2) 
OS:                Linux

Hello

First off, I have installed Akonadi 1.5.2. I don't see this version at the Application Version menu.

I have updated KDE to 4.6.2 on my Archlinux x86.

When I start KMail (1.13.6) I get this message in a pop up:

Databse driver not found
Details:
The QtSQL driver 'QMYSQL' is required by your current Akonadi server configuration.
The following drivers are installed: QSQLITE, QSQLITE3, QODBC3, QODBC, QPSQL7, QPSQL.
Make sure the required driver is installed.

So, I was reading here:

http://userbase.kde.org/Akonadi_4.4/Troubleshooting#Missing_Prerequisite

Considering that I have compiled Qt-4.7.2 by myself using an oficial Archlinux's PKGBUILD with a little changes (PKGBUILD attached), I have paid attention to this:

If you compile Qt4 yourself, make sure to tell the configure script to build in MySQL support by passing it the following option: 
-plugin-sql-mysql

But if you see the PKGBUILD it has the flag: 

-plugin-sql-{psql,mysql,sqlite,odbc}

I guess as that flag enabled the QtSQL driver on my system.

Also, the same web page says:

The driver you need is libqsqlmysql.so

So, I ran a command to see if that file exists on my system:

$ pacman -Ql | grep libqsqlmysql.so
qt /usr/lib/qt/plugins/sqldrivers/libqsqlmysql.so

As you see the file is on my system and it is provided by the package qt.

I tried to stop Akonadi from a terminal:

$ akonadictl stop
Akonadi is not running.

So, I tried to start Akonadi:

$ akonadictl start
Starting Akonadi Server...
   done.
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
[zuargo@zuargo-archlinux ~]$ search paths:  ("/usr/local/bin", "/usr/bin", "/bin", "/usr/local/sbin", "/usr/sbin", "/sbin", "/usr/share/java/apache-ant/bin", "/opt/java/bin", "/opt/java/db/bin", "/opt/java/jre/bin", "/usr/bin/core_perl", "/usr/sbin", "/usr/local/sbin", "/usr/local/libexec", "/usr/libexec", "/opt/mysql/libexec", "/opt/local/lib/mysql5/bin", "/opt/mysql/sbin") 
Found mysql_install_db:  "/usr/bin/mysql_install_db" 
Found mysqlcheck:  "/usr/bin/mysqlcheck" 
QSqlDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QSQLITE3 QODBC3 QODBC QPSQL7 QPSQL
Invalid database object during database server startup
"[
0: akonadiserver(_Z11akBacktracev+0x35) [0x8087295]
1: akonadiserver() [0x808773b]
2: [0xb782a400]
3: [0xb782a424]
4: /lib/libc.so.6(gsignal+0x52) [0xb6f0fdb2]
5: /lib/libc.so.6(abort+0x17c) [0xb6f1164c]
6: /usr/lib/libQtCore.so.4(_Z17qt_message_output9QtMsgTypePKc+0x82) [0xb75a7a72]
7: akonadiserver(_ZN15FileDebugStream9writeDataEPKcx+0xc4) [0x8089ac4]
8: /usr/lib/libQtCore.so.4(_ZN9QIODevice5writeEPKcx+0x8f) [0xb764aabf]
9: /usr/lib/libQtCore.so.4(+0x107057) [0xb7656057]
10: /usr/lib/libQtCore.so.4(_ZN11QTextStreamD2Ev+0x3e) [0xb766084e]
11: akonadiserver(_ZN6QDebugD1Ev+0x44) [0x8082b34]
12: akonadiserver(_ZN13DbConfigMysql19startInternalServerEv+0x31f0) [0x81109e0]
13: akonadiserver(_ZN7Akonadi13AkonadiServer20startDatabaseProcessEv+0xe3) [0x8089ed3]
14: akonadiserver() [0x808ca70]
15: akonadiserver(_ZN7Akonadi13AkonadiServer8instanceEv+0x3d) [0x808e03d]
16: akonadiserver(main+0x219) [0x8081fa9]
17: /lib/libc.so.6(__libc_start_main+0xe7) [0xb6efbdc7]
18: akonadiserver() [0x8081cc1]
]
"
ProcessControl: Application 'akonadiserver' returned with exit code 255 (Unknown error)
search paths:  ("/usr/local/bin", "/usr/bin", "/bin", "/usr/local/sbin", "/usr/sbin", "/sbin", "/usr/share/java/apache-ant/bin", "/opt/java/bin", "/opt/java/db/bin", "/opt/java/jre/bin", "/usr/bin/core_perl", "/usr/sbin", "/usr/local/sbin", "/usr/local/libexec", "/usr/libexec", "/opt/mysql/libexec", "/opt/local/lib/mysql5/bin", "/opt/mysql/sbin") 
Found mysql_install_db:  "/usr/bin/mysql_install_db" 
Found mysqlcheck:  "/usr/bin/mysqlcheck" 
QSqlDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QSQLITE3 QODBC3 QODBC QPSQL7 QPSQL
Invalid database object during database server startup
"[
0: akonadiserver(_Z11akBacktracev+0x35) [0x8087295]
1: akonadiserver() [0x808773b]
2: [0xb7712400]
3: [0xb7712424]
4: /lib/libc.so.6(gsignal+0x52) [0xb6df7db2]
5: /lib/libc.so.6(abort+0x17c) [0xb6df964c]
6: /usr/lib/libQtCore.so.4(_Z17qt_message_output9QtMsgTypePKc+0x82) [0xb748fa72]
7: akonadiserver(_ZN15FileDebugStream9writeDataEPKcx+0xc4) [0x8089ac4]
8: /usr/lib/libQtCore.so.4(_ZN9QIODevice5writeEPKcx+0x8f) [0xb7532abf]
9: /usr/lib/libQtCore.so.4(+0x107057) [0xb753e057]
10: /usr/lib/libQtCore.so.4(_ZN11QTextStreamD2Ev+0x3e) [0xb754884e]
11: akonadiserver(_ZN6QDebugD1Ev+0x44) [0x8082b34]
12: akonadiserver(_ZN13DbConfigMysql19startInternalServerEv+0x31f0) [0x81109e0]
13: akonadiserver(_ZN7Akonadi13AkonadiServer20startDatabaseProcessEv+0xe3) [0x8089ed3]
14: akonadiserver() [0x808ca70]
15: akonadiserver(_ZN7Akonadi13AkonadiServer8instanceEv+0x3d) [0x808e03d]
16: akonadiserver(main+0x219) [0x8081fa9]
17: /lib/libc.so.6(__libc_start_main+0xe7) [0xb6de3dc7]
18: akonadiserver() [0x8081cc1]
]
"
ProcessControl: Application 'akonadiserver' returned with exit code 255 (Unknown error)
search paths:  ("/usr/local/bin", "/usr/bin", "/bin", "/usr/local/sbin", "/usr/sbin", "/sbin", "/usr/share/java/apache-ant/bin", "/opt/java/bin", "/opt/java/db/bin", "/opt/java/jre/bin", "/usr/bin/core_perl", "/usr/sbin", "/usr/local/sbin", "/usr/local/libexec", "/usr/libexec", "/opt/mysql/libexec", "/opt/local/lib/mysql5/bin", "/opt/mysql/sbin") 
Found mysql_install_db:  "/usr/bin/mysql_install_db" 
Found mysqlcheck:  "/usr/bin/mysqlcheck" 
QSqlDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QSQLITE3 QODBC3 QODBC QPSQL7 QPSQL
Invalid database object during database server startup
"[
0: akonadiserver(_Z11akBacktracev+0x35) [0x8087295]
1: akonadiserver() [0x808773b]
2: [0xb76e9400]
3: [0xb76e9424]
4: /lib/libc.so.6(gsignal+0x52) [0xb6dcedb2]
5: /lib/libc.so.6(abort+0x17c) [0xb6dd064c]
6: /usr/lib/libQtCore.so.4(_Z17qt_message_output9QtMsgTypePKc+0x82) [0xb7466a72]
7: akonadiserver(_ZN15FileDebugStream9writeDataEPKcx+0xc4) [0x8089ac4]
8: /usr/lib/libQtCore.so.4(_ZN9QIODevice5writeEPKcx+0x8f) [0xb7509abf]
9: /usr/lib/libQtCore.so.4(+0x107057) [0xb7515057]
10: /usr/lib/libQtCore.so.4(_ZN11QTextStreamD2Ev+0x3e) [0xb751f84e]
11: akonadiserver(_ZN6QDebugD1Ev+0x44) [0x8082b34]
12: akonadiserver(_ZN13DbConfigMysql19startInternalServerEv+0x31f0) [0x81109e0]
13: akonadiserver(_ZN7Akonadi13AkonadiServer20startDatabaseProcessEv+0xe3) [0x8089ed3]
14: akonadiserver() [0x808ca70]
15: akonadiserver(_ZN7Akonadi13AkonadiServer8instanceEv+0x3d) [0x808e03d]
16: akonadiserver(main+0x219) [0x8081fa9]
17: /lib/libc.so.6(__libc_start_main+0xe7) [0xb6dbadc7]
18: akonadiserver() [0x8081cc1]
]
"
ProcessControl: Application 'akonadiserver' returned with exit code 255 (Unknown error)
search paths:  ("/usr/local/bin", "/usr/bin", "/bin", "/usr/local/sbin", "/usr/sbin", "/sbin", "/usr/share/java/apache-ant/bin", "/opt/java/bin", "/opt/java/db/bin", "/opt/java/jre/bin", "/usr/bin/core_perl", "/usr/sbin", "/usr/local/sbin", "/usr/local/libexec", "/usr/libexec", "/opt/mysql/libexec", "/opt/local/lib/mysql5/bin", "/opt/mysql/sbin") 
Found mysql_install_db:  "/usr/bin/mysql_install_db" 
Found mysqlcheck:  "/usr/bin/mysqlcheck" 
QSqlDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QSQLITE3 QODBC3 QODBC QPSQL7 QPSQL
Invalid database object during database server startup
"[
0: akonadiserver(_Z11akBacktracev+0x35) [0x8087295]
1: akonadiserver() [0x808773b]
2: [0xb78d6400]
3: [0xb78d6424]
4: /lib/libc.so.6(gsignal+0x52) [0xb6fbbdb2]
5: /lib/libc.so.6(abort+0x17c) [0xb6fbd64c]
6: /usr/lib/libQtCore.so.4(_Z17qt_message_output9QtMsgTypePKc+0x82) [0xb7653a72]
7: akonadiserver(_ZN15FileDebugStream9writeDataEPKcx+0xc4) [0x8089ac4]
8: /usr/lib/libQtCore.so.4(_ZN9QIODevice5writeEPKcx+0x8f) [0xb76f6abf]
9: /usr/lib/libQtCore.so.4(+0x107057) [0xb7702057]
10: /usr/lib/libQtCore.so.4(_ZN11QTextStreamD2Ev+0x3e) [0xb770c84e]
11: akonadiserver(_ZN6QDebugD1Ev+0x44) [0x8082b34]
12: akonadiserver(_ZN13DbConfigMysql19startInternalServerEv+0x31f0) [0x81109e0]
13: akonadiserver(_ZN7Akonadi13AkonadiServer20startDatabaseProcessEv+0xe3) [0x8089ed3]
14: akonadiserver() [0x808ca70]
15: akonadiserver(_ZN7Akonadi13AkonadiServer8instanceEv+0x3d) [0x808e03d]
16: akonadiserver(main+0x219) [0x8081fa9]
17: /lib/libc.so.6(__libc_start_main+0xe7) [0xb6fa7dc7]
18: akonadiserver() [0x8081cc1]
]
"
ProcessControl: Application 'akonadiserver' returned with exit code 255 (Unknown error)
"akonadiserver" crashed too often and will not be restarted!

I create a new user and I tried start akonadi with it. I get the same previous error.

This is very annoying. I have four email accounts and it is so tired to go account by account reading my emails. Becouse, also, and related to this latter thing, when kmail shows the error message I can't acces to the display area, there where you can read your emails. I just can acces to the main menu (Screenshot attached)

Thanks so much 

Reproducible: Always

Steps to Reproduce:
Try to start akonadi from a terminal by:

$ akonadictl start

Actual Results:  
Akonadi is not started

Expected Results:  
Akonadi is started

I am requesting help in the official KDE forum, at this thread:

http://forum.kde.org/viewtopic.php?f=20&t=94547
Comment 1 Gatoso 2011-04-11 23:54:20 UTC
Created attachment 58811 [details]
Archlinux PKGBUILD bash script for building Qt
Comment 2 Gatoso 2011-04-12 00:34:56 UTC
Created attachment 58814 [details]
Archlinux PKGBUILD bash script for building Akonadi

Also, I attached the Archlinux PKGBUILD bash script for building Akonadi
Comment 3 Christophe Marin 2011-04-12 01:16:29 UTC
anything missing if you run `ldd libqsqlmysql.so` ?

does `echo $QT_PLUGIN_PATH` return something ? Is it the correct path ?
Comment 4 Gatoso 2011-04-12 04:52:05 UTC
Terminal ouputs:

$ ldd /usr/lib/qt/plugins/sqldrivers/libqsqlmysql.so
        linux-gate.so.1 =>  (0xb77dc000)
        libmysqlclient.so.16 => not found
        libQtSql.so.4 => /usr/lib/libQtSql.so.4 (0xb7767000)
        libQtCore.so.4 => /usr/lib/libQtCore.so.4 (0xb74b1000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb73c3000)
        libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0xb73a8000)
        libc.so.6 => /lib/libc.so.6 (0xb725d000)
        libpthread.so.0 => /lib/libpthread.so.0 (0xb7244000)
        libz.so.1 => /usr/lib/libz.so.1 (0xb722f000)
        libdl.so.2 => /lib/libdl.so.2 (0xb722b000)
        libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0 (0xb7227000)
        librt.so.1 => /lib/librt.so.1 (0xb721d000)
        libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0xb714c000)
        libm.so.6 => /lib/libm.so.6 (0xb7126000)
        /lib/ld-linux.so.2 (0xb77dd000)
        libpcre.so.0 => /lib/libpcre.so.0 (0xb70e9000)

libmysqlclient.so.16 missing. On Archlinux, I guess, it should be provided by the package libmysqlclient but this package not includes that library, instead provides libmysqlclient.so.18.

So, it is a error of mysql, qt or archlinux?

$ echo $QT_PLUGIN_PATH
/home/zuargo/.kde4/lib/kde4/plugins/:/usr/lib/kde4/plugins/

How can I know whether is the correct path? (sorry, I am noob in all this)

Thank you so much.
Comment 5 Christophe Marin 2011-04-12 09:53:45 UTC
> So, it is a error of mysql, qt or archlinux?

> instead provides libmysqlclient.so.18

That means the libmysqlclient used to build Qt is not the same as the one currently installed on your system

I have no idea how Arch or Chakra works, but that reveals an installation problem.

Two solutions: 
- either rebuild the sql plugins with the libmysqlclient package you currently have
- Install whatever provides libmysqlclient16
Comment 6 Gatoso 2011-04-12 12:27:55 UTC
OK thank you so much

I have downgraded libmysqlclient package from 5.5.11 (wich one provides libmysqlclient.so.18) to libmysqlclient 5.5.9 (wich one provides libmysqlclient.so.16)

Problem solved thank you so much :)
Comment 7 Christophe Marin 2011-04-12 13:40:37 UTC
Thanks. Closing.
Comment 8 Christophe Marin 2011-04-12 13:41:54 UTC
(Don't forget to mark your forum post as resolved)