Bug 226978 - akonadi-server fails to start upon creating initial SQLite db
Summary: akonadi-server fails to start upon creating initial SQLite db
Status: RESOLVED NOT A BUG
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: server (show other bugs)
Version: 4.4
Platform: Gentoo Packages Linux
: NOR crash
Target Milestone: ---
Assignee: Volker Krause
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-15 12:46 UTC by Vasileios P. Lourdas
Modified: 2010-07-06 16:07 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 Vasileios P. Lourdas 2010-02-15 12:46:31 UTC
Version:            (using KDE 4.4.0)
Compiler:          gcc 4.4.3 gcc (Gentoo 4.4.3 p1.0) 4.4.3
OS:                Linux
Installed from:    Gentoo Packages

I know sqlite is not recommended for use by akonadi-server, but I don't want to use MySQL for the
PIM storage (at least not currently), so I'm falling back to sqlite.

When there's no sqlite database and you try to start akonadi-server by using the akonadictl tool,
akonadi-server crashes because of a mispelled SQL instruction. Details:

Connecting to deprecated signal
QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
[akonadiserver] QSqlDatabasePrivate::removeDatabase: connection 'initConnection' is still in use,
all queries will cease to work.
[akonadiserver] Database "/home/xxxxx/.local/share/akonadi/akonadi.db" opened using driver
"QSQLITE"
[akonadiserver] DbInitializer::run()
[akonadiserver] checking table  "SchemaVersionTable"
[akonadiserver] "CREATE TABLE SchemaVersionTable (version INTEGER NOT NULL);"
[akonadiserver] checking table  "ResourceTable"
[akonadiserver] "CREATE TABLE ResourceTable (id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, name
VARCHAR(255) COLLATE BINARY NOT NULL UNIQUE, isVirtual BOOL DEFAULT false);"
[akonadiserver] "Unable to add initial data to table 'ResourceTable'.
[akonadiserver] Query error: 'no such column: true Unable to execute statement'
[akonadiserver] Query was: INSERT INTO ResourceTable (name,isVirtual) VALUES
('akonadi_search_resource',true)"
[akonadiserver] Unable to initialize database.
[akonadiserver] "[
[akonadiserver] 0: akonadiserver(_Z11akBacktracev+0x39) [0x40af69]
[akonadiserver] 1: akonadiserver [0x40b4b2]
[akonadiserver] 2: /lib/libc.so.6 [0x7fe9618d9100]
[akonadiserver] 3: /lib/libc.so.6(gsignal+0x35) [0x7fe9618d9085]
[akonadiserver] 4: /lib/libc.so.6(abort+0x180) [0x7fe9618da4b0]
[akonadiserver] 5: /usr/lib64/qt4/libQtCore.so.4(_Z17qt_message_output9QtMsgTypePKc+0x74)
[0x7fe962a6a3a4]
[akonadiserver] 6: akonadiserver(_ZN15FileDebugStream9writeDataEPKcx+0xa8) [0x40c5b8]
[akonadiserver] 7: /usr/lib64/qt4/libQtCore.so.4(_ZN9QIODevice5writeEPKcx+0x78) [0x7fe962af8348]
[akonadiserver] 8: /usr/lib64/qt4/libQtCore.so.4 [0x7fe962b09699]
[akonadiserver] 9: /usr/lib64/qt4/libQtCore.so.4(_ZN11QTextStreamD1Ev+0x39) [0x7fe962b0a889]
[akonadiserver] 10: akonadiserver(_ZN6QDebugD1Ev+0x4d) [0x406b3d]
[akonadiserver] 11: /usr/lib64/libakonadiprivate.so.1(_ZN7Akonadi13AkonadiServerC1EP7QObject+0x5f4)
[0x7fe962ed6524]
[akonadiserver] 12: /usr/lib64/libakonadiprivate.so.1(_ZN7Akonadi13AkonadiServer8instanceEv+0x4a)
[0x7fe962ed72ca]
[akonadiserver] 13: akonadiserver(main+0x3aa) [0x40615a]
[akonadiserver] 14: /lib/libc.so.6(__libc_start_main+0xfd) [0x7fe9618c5a3d]
[akonadiserver] 15: akonadiserver(_ZNSt8ios_base4InitD1Ev+0x39) [0x405cb9]
[akonadiserver] ]
[akonadiserver] "
ProcessControl: Application 'akonadiserver' returned with exit code 255 (Unknown error)
[akonadiserver] QSqlDatabasePrivate::removeDatabase: connection 'initConnection' is still in use,
all queries will cease to work.
[akonadiserver] Database "/home/xxxxx/.local/share/akonadi/akonadi.db" opened using driver
"QSQLITE"
[akonadiserver] DbInitializer::run()
[akonadiserver] checking table  "SchemaVersionTable"
[akonadiserver] checking table  "ResourceTable"
[akonadiserver] "Unable to add initial data to table 'ResourceTable'.
[akonadiserver] Query error: 'no such column: true Unable to execute statement'
[akonadiserver] Query was: INSERT INTO ResourceTable (name,isVirtual) VALUES
('akonadi_search_resource',true)"
[akonadiserver] Unable to initialize database.
[akonadiserver] "[
[akonadiserver] 0: akonadiserver(_Z11akBacktracev+0x39) [0x40af69]
[akonadiserver] 1: akonadiserver [0x40b4b2]
[akonadiserver] 2: /lib/libc.so.6 [0x7fdb60e0c100]
[akonadiserver] 3: /lib/libc.so.6(gsignal+0x35) [0x7fdb60e0c085]
[akonadiserver] 4: /lib/libc.so.6(abort+0x180) [0x7fdb60e0d4b0]
[akonadiserver] 5: /usr/lib64/qt4/libQtCore.so.4(_Z17qt_message_output9QtMsgTypePKc+0x74)
[0x7fdb61f9d3a4]
[akonadiserver] 6: akonadiserver(_ZN15FileDebugStream9writeDataEPKcx+0xa8) [0x40c5b8]
[akonadiserver] 7: /usr/lib64/qt4/libQtCore.so.4(_ZN9QIODevice5writeEPKcx+0x78) [0x7fdb6202b348]
[akonadiserver] 8: /usr/lib64/qt4/libQtCore.so.4 [0x7fdb6203c699]
[akonadiserver] 9: /usr/lib64/qt4/libQtCore.so.4(_ZN11QTextStreamD1Ev+0x39) [0x7fdb6203d889]
[akonadiserver] 10: akonadiserver(_ZN6QDebugD1Ev+0x4d) [0x406b3d]
[akonadiserver] 11: /usr/lib64/libakonadiprivate.so.1(_ZN7Akonadi13AkonadiServerC1EP7QObject+0x5f4)
[0x7fdb62409524]
[akonadiserver] 12: /usr/lib64/libakonadiprivate.so.1(_ZN7Akonadi13AkonadiServer8instanceEv+0x4a)
[0x7fdb6240a2ca]
[akonadiserver] 13: akonadiserver(main+0x3aa) [0x40615a]
[akonadiserver] 14: /lib/libc.so.6(__libc_start_main+0xfd) [0x7fdb60df8a3d]
[akonadiserver] 15: akonadiserver(_ZNSt8ios_base4InitD1Ev+0x39) [0x405cb9]
[akonadiserver] ]
[akonadiserver] "
ProcessControl: Application 'akonadiserver' returned with exit code 255 (Unknown error)
[akonadiserver] QSqlDatabasePrivate::removeDatabase: connection 'initConnection' is still in use,
all queries will cease to work.
[akonadiserver] Database "/home/xxxxx/.local/share/akonadi/akonadi.db" opened using driver
"QSQLITE"
[akonadiserver] DbInitializer::run()
[akonadiserver] checking table  "SchemaVersionTable"
[akonadiserver] checking table  "ResourceTable"
[akonadiserver] "Unable to add initial data to table 'ResourceTable'.
[akonadiserver] Query error: 'no such column: true Unable to execute statement'
[akonadiserver] Query was: INSERT INTO ResourceTable (name,isVirtual) VALUES
('akonadi_search_resource',true)"
[akonadiserver] Unable to initialize database.
[akonadiserver] "[
[akonadiserver] 0: akonadiserver(_Z11akBacktracev+0x39) [0x40af69]
[akonadiserver] 1: akonadiserver [0x40b4b2]
[akonadiserver] 2: /lib/libc.so.6 [0x7fa25dacc100]
[akonadiserver] 3: /lib/libc.so.6(gsignal+0x35) [0x7fa25dacc085]
[akonadiserver] 4: /lib/libc.so.6(abort+0x180) [0x7fa25dacd4b0]
[akonadiserver] 5: /usr/lib64/qt4/libQtCore.so.4(_Z17qt_message_output9QtMsgTypePKc+0x74)
[0x7fa25ec5d3a4]
[akonadiserver] 6: akonadiserver(_ZN15FileDebugStream9writeDataEPKcx+0xa8) [0x40c5b8]
[akonadiserver] 7: /usr/lib64/qt4/libQtCore.so.4(_ZN9QIODevice5writeEPKcx+0x78) [0x7fa25eceb348]
[akonadiserver] 8: /usr/lib64/qt4/libQtCore.so.4 [0x7fa25ecfc699]
[akonadiserver] 9: /usr/lib64/qt4/libQtCore.so.4(_ZN11QTextStreamD1Ev+0x39) [0x7fa25ecfd889]
[akonadiserver] 10: akonadiserver(_ZN6QDebugD1Ev+0x4d) [0x406b3d]
[akonadiserver] 11: /usr/lib64/libakonadiprivate.so.1(_ZN7Akonadi13AkonadiServerC1EP7QObject+0x5f4)
[0x7fa25f0c9524]
[akonadiserver] 12: /usr/lib64/libakonadiprivate.so.1(_ZN7Akonadi13AkonadiServer8instanceEv+0x4a)
[0x7fa25f0ca2ca]
[akonadiserver] 13: akonadiserver(main+0x3aa) [0x40615a]
[akonadiserver] 14: /lib/libc.so.6(__libc_start_main+0xfd) [0x7fa25dab8a3d]
[akonadiserver] 15: akonadiserver(_ZNSt8ios_base4InitD1Ev+0x39) [0x405cb9]
[akonadiserver] ]
[akonadiserver] "
ProcessControl: Application 'akonadiserver' returned with exit code 255 (Unknown error)
[akonadiserver] QSqlDatabasePrivate::removeDatabase: connection 'initConnection' is still in use,
all queries will cease to work.
[akonadiserver] Database "/home/xxxxx/.local/share/akonadi/akonadi.db" opened using driver
"QSQLITE"
[akonadiserver] DbInitializer::run()
[akonadiserver] checking table  "SchemaVersionTable"
[akonadiserver] checking table  "ResourceTable"
[akonadiserver] "Unable to add initial data to table 'ResourceTable'.
[akonadiserver] Query error: 'no such column: true Unable to execute statement'
[akonadiserver] Query was: INSERT INTO ResourceTable (name,isVirtual) VALUES
('akonadi_search_resource',true)"
[akonadiserver] Unable to initialize database.
[akonadiserver] "[
[akonadiserver] 0: akonadiserver(_Z11akBacktracev+0x39) [0x40af69]
[akonadiserver] 1: akonadiserver [0x40b4b2]
[akonadiserver] 2: /lib/libc.so.6 [0x7f1f2bbec100]
[akonadiserver] 3: /lib/libc.so.6(gsignal+0x35) [0x7f1f2bbec085]
[akonadiserver] 4: /lib/libc.so.6(abort+0x180) [0x7f1f2bbed4b0]
[akonadiserver] 5: /usr/lib64/qt4/libQtCore.so.4(_Z17qt_message_output9QtMsgTypePKc+0x74)
[0x7f1f2cd7d3a4]
[akonadiserver] 6: akonadiserver(_ZN15FileDebugStream9writeDataEPKcx+0xa8) [0x40c5b8]
[akonadiserver] 7: /usr/lib64/qt4/libQtCore.so.4(_ZN9QIODevice5writeEPKcx+0x78) [0x7f1f2ce0b348]
[akonadiserver] 8: /usr/lib64/qt4/libQtCore.so.4 [0x7f1f2ce1c699]
[akonadiserver] 9: /usr/lib64/qt4/libQtCore.so.4(_ZN11QTextStreamD1Ev+0x39) [0x7f1f2ce1d889]
[akonadiserver] 10: akonadiserver(_ZN6QDebugD1Ev+0x4d) [0x406b3d]
[akonadiserver] 11: /usr/lib64/libakonadiprivate.so.1(_ZN7Akonadi13AkonadiServerC1EP7QObject+0x5f4)
[0x7f1f2d1e9524]
[akonadiserver] 12: /usr/lib64/libakonadiprivate.so.1(_ZN7Akonadi13AkonadiServer8instanceEv+0x4a)
[0x7f1f2d1ea2ca]
[akonadiserver] 13: akonadiserver(main+0x3aa) [0x40615a]
[akonadiserver] 14: /lib/libc.so.6(__libc_start_main+0xfd) [0x7f1f2bbd8a3d]
[akonadiserver] 15: akonadiserver(_ZNSt8ios_base4InitD1Ev+0x39) [0x405cb9]
[akonadiserver] ]
[akonadiserver] "
ProcessControl: Application 'akonadiserver' returned with exit code 255 (Unknown error)
"akonadiserver" crashed too often and will not be restarted!

The db file is created, simply the INSERT statement fails, because true needs to be quoted. If you
connect manually using sqlite3 and issue the INSERT statement, the next akonadictl start command
succeeds and akonadi-server starts. So, the workaround is to simply quote the test value:

INSERT INTO ResourceTable (name,isVirtual) VALUES ('akonadi_search_resource', 'true')
Comment 1 Anatoly 2010-02-16 05:44:26 UTC
I have the same problem on a similar configuration (Gentoo, gcc 4.4.3, KDE 4.4.0).
Comment 2 Thomas McGuire 2010-02-21 14:15:37 UTC
> I know sqlite is not recommended for use by akonadi-server

"Not recommended" is an understatement. It will simply not work, the sqlite support is not even finished. You can't use it.

I don't know why Gentoo insists on enabling sqlite, it is wrong and will screw their users. Same story with disabling Nepomuk.
Comment 3 Vasileios P. Lourdas 2010-02-21 14:59:48 UTC
(In reply to comment #2)
> "Not recommended" is an understatement. It will simply not work, the sqlite
> support is not even finished. You can't use it.
> 
> I don't know why Gentoo insists on enabling sqlite, it is wrong and will screw
> their users. Same story with disabling Nepomuk.

Well, according to the KDE Techbase (http://techbase.kde.org/Projects/PIM/Akonadi#Why_not_use_sqlite.3F) it doesn't say that SQLite support is not finished, it implies that because of SQLite limitations its use is not encouraged/recommended. Anyway, I opened this bug in the first place just because I had problems with akonadi server starting in the first place, even with the mysql Gentoo USE flag enabled, so I fell back using sqlite. Even with a new user (no KDE settings), akonadi server could not start (I already have a MySQL instance always running, if I configure akonadi server to use this instead, will I have to do this for all users in my system?).
Comment 4 Thomas McGuire 2010-02-21 15:13:16 UTC
> Well, according to the KDE Techbase 
> (http://techbase.kde.org/Projects/PIM/Akonadi#Why_not_use_sqlite.3F) it 
> doesn't say that SQLite support is not finished, it implies that because of 
> SQLite limitations its use is not encouraged/recommended.

Ok, that could be worded a bit clearer maybe.

> I had problems with akonadi server starting in the first place, even with the 
> mysql Gentoo USE flag enabled

This could probably be a misconfiguration on the Gentoo side, but could of course also be a bug, like bug 225333.
Comment 5 Vasileios P. Lourdas 2010-02-21 15:52:39 UTC
(In reply to comment #4)
> Ok, that could be worded a bit clearer maybe.

Yes, I guess so.

> This could probably be a misconfiguration on the Gentoo side, but could of
> course also be a bug, like bug 225333.

No. I deleted all akonadi conf files, recompiled with mysql flag and akonadi server now starts fine. I see that it starts a private mysqld instance and all is good. It now works, who knows, I probably did something wrong initially.

In the same url I give in comment #3, it states that each user must have their own database instance. Maybe I'm not getting that right, but does using the global mysqld instance for all users (same schema) work? If it does, then I can save the extra mysqld instance.
Comment 6 Tobias Koenig 2010-03-16 13:08:32 UTC
You can configure Akonadi to use an already running MySQL database server, however that means you have to setup it manually. In akonadiserverrc you
have to setup all entries in the [QMYSQL] group to point to the external server.

I'll close this bug report now, since SQLite is really not supported.
Comment 7 Luke-Jr 2010-07-06 16:07:23 UTC
It should be supported, since requiring a huge database like MySQL on an end-user system (which in my case is a handheld with 2 GB total disk space and 128 MB RAM) is just insane, especially for a mere cache.