Bug 179596 - Akonadi doesn't start because MySQL can't get a lock
Summary: Akonadi doesn't start because MySQL can't get a lock
Status: RESOLVED FIXED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: server (show other bugs)
Version: 4.2
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Volker Krause
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-04 13:27 UTC by Richard Bos
Modified: 2009-01-06 22:45 UTC (History)
1 user (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 Richard Bos 2009-01-04 13:27:22 UTC
Version:           4.1.87 (using Devel)
OS:                Linux
Installed from:    Compiled sources

can not view email in kmail, this happened suddenly.  All was fine kmail was working fine, but now I can't see the email body in kmail.  I can only see the email body when I double click the email, what opens the email in a new window.

This is for an regular imap account.
7
akonadiconsole shows the following output during startup:
#  akonadiconsole
akonadiconsole(4636)/libakonadi Akonadi::Control::Private::exec: Could not start/stop Akonadi!
 akonadiconsole

Akonadi Server Self-Test Report
===============================

Test 1:  SUCCESS
--------

Database driver found.
Details: The QtSQL driver 'QMYSQL' is required by your current Akonadi server configuration.
The following drivers are installed: QSQLITE, QMYSQL3, QMYSQL.
Make sure the required driver is installed.

File content of '/home/richard/.config/akonadi/akonadiserverrc':
[%General]
Driver=QMYSQL

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

[Debug]
Tracer=null


Test 2:  SUCCESS
--------

MySQL server found.
Details: You currently have configured Akonadi to use the MySQL server '/usr/sbin/mysqld'.
Make sure you have the MySQL server installed, set the correct path and ensure you have the necessary read and execution rights on the server executable. The server executable is typically called 'mysqld', its locations varies depending on the distribution.

Test 3:  SUCCESS
--------

MySQL server is executable.
Details: MySQL server found: /usr/sbin/mysqld  Ver 5.0.67 for suse-linux-gnu on i686 (SUSE MySQL RPM)


Test 4:  ERROR
--------

MySQL server log contains errors.
Details: The MySQL server error log file '<a href='/home/richard/.local/share/akonadi/db_data/mysql.err'>/home/richard/.local/share/akonadi/db_data/mysql.err</a>&apos; contains errors.

File content of '/home/richard/.local/share/akonadi/db_data/mysql.err':
InnoDB: Unable to lock ./ib_logfile1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Error in opening ./ib_logfile1
090104 13:08:50 [ERROR] Default storage engine (InnoDB) is not available
090104 13:08:50 [ERROR] Aborting

090104 13:08:50 [Note] /usr/sbin/mysqld: Shutdown complete


============
The file is there richard@med111:~/.local/share> ls -l ./akonadi/db_data/ib_logfile1
-rw-rw---- 1 richard users 67108864 2009-01-03 12:37 ./akonadi/db_data/ib_logfile1

What it help if I remove the file?
============

Test 5:  SUCCESS
--------

MySQL server default configuration found.
Details: The default configuration for the MySQL server was found and is readable at <a href='/etc/akonadi/mysql-global.conf'>/etc/akonadi/mysql-global.conf</a>.

File content of '/etc/akonadi/mysql-global.conf':
#
# Global Akonadi MySQL server settings,
# These settings can be adjusted using $HOME/.config/akonadi/mysql-local.conf
#
# Based on advice by Kris Köhntopp <kris@mysql.com>
#
[mysqld]
skip_grant_tables
skip_networking

# strict query parsing/interpretation
# TODO: make Akonadi work with those settings enabled
#sql_mode=strict_trans_tables,strict_all_tables,strict_error_for_division_by_zero,no_auto_create_user,no_auto_value_on_zero,no_engine_substitution,no_zero_date,no_zero_in_date,only_full_group_by,pipes_as_concat
#sql_mode=strict_trans_tables

# use InnoDB for transactions and better crash recovery
default_storage_engine=innodb
# case-insensitive table names, avoids trouble on windows
lower_case_table_names=1
character_set_server=latin1
collation_server=latin1_general_ci
table_cache=200
thread_cache_size=3
log_bin=mysql-bin
expire_logs_days=3
#sync_bin_log=0
# error log file name, relative to datadir
log_error=mysql.err
log_warnings=2
# log all queries, useful for debugging but generates an enormous amount of data
#log=mysql.full
# log queries slower than n seconds, log file name relative to datadir
log_slow_queries=mysql.slow
long_query_time=1
# log queries not using indices, debug only, disable for production use
log_queries_not_using_indexes=1
# maximum blob size
max_allowed_packet=32M
max_connections=256
# makes sense when having the same query multiple times
# makes no sense with prepared statements and/or transactions
query_cache_type=0
query_cache_size=0

innodb_file_per_table=1
innodb_log_buffer_size=1M
innodb_additional_mem_pool_size=1M
# messure database size and adjust
# SELECT sum(data_length) as bla, sum(index_length) as blub FROM information_schema.tables WHERE table_schema not in ("mysql", "information_schema");
innodb_buffer_pool_size=80M
# size of average write burst, keep Innob_log_waits small, keep Innodb_buffer_pool_wait_free small (see show global status like "inno%", show global variables)
innodb_log_file_size=64M
innodb_flush_log_at_trx_commit=2



Test 6:  SKIP
--------

MySQL server custom configuration not available.
Details: The custom configuration for the MySQL server was not found but is optional.

Test 7:  SUCCESS
--------

MySQL server configuration is usable.
Details: The MySQL server configuration was found at <a href='/home/richard/.local/share/akonadi/mysql.conf'>/home/richard/.local/share/akonadi/mysql.conf</a> and is readable.

File content of '/home/richard/.local/share/akonadi/mysql.conf':
#
# Global Akonadi MySQL server settings,
# These settings can be adjusted using $HOME/.config/akonadi/mysql-local.conf
#
# Based on advice by Kris Köhntopp <kris@mysql.com>
#
[mysqld]
skip_grant_tables
skip_networking

# strict query parsing/interpretation
# TODO: make Akonadi work with those settings enabled
#sql_mode=strict_trans_tables,strict_all_tables,strict_error_for_division_by_zero,no_auto_create_user,no_auto_value_on_zero,no_engine_substitution,no_zero_date,no_zero_in_date,only_full_group_by,pipes_as_concat
#sql_mode=strict_trans_tables

# use InnoDB for transactions and better crash recovery
default_storage_engine=innodb
# case-insensitive table names, avoids trouble on windows
lower_case_table_names=1
character_set_server=latin1
collation_server=latin1_general_ci
table_cache=200
thread_cache_size=3
log_bin=mysql-bin
expire_logs_days=3
#sync_bin_log=0
# error log file name, relative to datadir
log_error=mysql.err
log_warnings=2
# log all queries, useful for debugging but generates an enormous amount of data
#log=mysql.full
# log queries slower than n seconds, log file name relative to datadir
log_slow_queries=mysql.slow
long_query_time=1
# log queries not using indices, debug only, disable for production use
log_queries_not_using_indexes=1
# maximum blob size
max_allowed_packet=32M
max_connections=256
# makes sense when having the same query multiple times
# makes no sense with prepared statements and/or transactions
query_cache_type=0
query_cache_size=0

innodb_file_per_table=1
innodb_log_buffer_size=1M
innodb_additional_mem_pool_size=1M
# messure database size and adjust
# SELECT sum(data_length) as bla, sum(index_length) as blub FROM information_schema.tables WHERE table_schema not in ("mysql", "information_schema");
innodb_buffer_pool_size=80M
# size of average write burst, keep Innob_log_waits small, keep Innodb_buffer_pool_wait_free small (see show global status like "inno%", show global variables)
innodb_log_file_size=64M
innodb_flush_log_at_trx_commit=2



Test 8:  SUCCESS
--------

akonadictl found and usable
Details: The program '/usr/bin/akonadictl' to control the Akonadi server was found and could be executed successfully.
Result:
Akonadi Control: stopped
Akonadi Server: stopped


Test 9:  ERROR
--------

Akonadi control process not registered at D-Bus.
Details: The Akonadi control process is not registered at D-Bus which typically means it was not started or encountered a fatal error during startup.

Test 10:  ERROR
--------

Akonadi server process not registered at D-Bus.
Details: The Akonadi server process is not registered at D-Bus which typically means it was not started or encountered a fatal error during startup.

Test 11:  SKIP
--------

Protocol version check not possible.
Details: Without a connection to the server it is not possible to check if the protocol version meets the requirements.

Test 12:  ERROR
--------

No resource agents found.
Details: No resource agents have been found, Akonadi is not usable without at least one. This usually means that no resource agents are installed or that there is a setup problem. The following paths have been searched: '/usr/share/akonadi/agents'. The XDG_DATA_DIRS environment variable is set to '/usr/share:/etc/opt/kde3/share:/opt/kde3/share', make sure this includes all paths where Akonadi agents are installed to.

Directory listing of '/usr/share/akonadi/agents':
distlistresource.desktop
icalresource.desktop
imaplibresource.desktop
kabcresource.desktop
kcalresource.desktop
localbookmarksresource.desktop
maildirresource.desktop
mailthreaderagent.desktop
nepomukcontactfeeder.desktop
nepomukemailfeeder.desktop
nepomuktagresource.desktop
nntpresource.desktop
strigifeeder.desktop
vcarddirresource.desktop
vcardresource.desktop

Environment variable XDG_DATA_DIRS is set to '/usr/share:/etc/opt/kde3/share:/opt/kde3/share'

Test 13:  ERROR
--------

Current Akonadi server error log found.
Details: The Akonadi server did report error during startup into <a href='/home/richard/.local/share/akonadi/akonadiserver.error'>/home/richard/.local/share/akonadi/akonadiserver.error</a>.

File content of '/home/richard/.local/share/akonadi/akonadiserver.error':
"[
0: akonadiserver(_Z10kBacktracev+0x35) [0x804ad75]
1: akonadiserver [0x804b256]
2: [0xffffe400]
3: [0xffffe430]
4: /lib/libc.so.6(gsignal+0x50) [0xb775c990]
5: /lib/libc.so.6(abort+0x188) [0xb775e2c8]
6: /usr/lib/libQtCore.so.4(_Z17qt_message_output9QtMsgTypePKc+0x95) [0xb7a848d5]
7: akonadiserver(_ZN15FileDebugStream9writeDataEPKcx+0xc4) [0x804c584]
8: /usr/lib/libQtCore.so.4(_ZN9QIODevice5writeEPKcx+0x9e) [0xb7b11c6e]
9: /usr/lib/libQtCore.so.4 [0xb7b1ec2e]
10: /usr/lib/libQtCore.so.4(_ZN11QTextStreamD1Ev+0x68) [0xb7b1ef28]
11: /usr/lib/libakonadiprivate.so.1(_ZN6QDebugD1Ev+0x51) [0xb7e277f1]
12: /usr/lib/libakonadiprivate.so.1(_ZN7Akonadi13AkonadiServer20startDatabaseProcessEv+0x19be) [0xb7e2b91e]
13: /usr/lib/libakonadiprivate.so.1(_ZN7Akonadi13AkonadiServerC1EP7QObject+0x72) [0xb7e2d682]
14: /usr/lib/libakonadiprivate.so.1(_ZN7Akonadi13AkonadiServer8instanceEv+0x56) [0xb7e2e726]
15: akonadiserver(main+0x7b) [0x804a8fb]
16: /lib/libc.so.6(__libc_start_main+0xe5) [0xb7748705]
17: akonadiserver [0x804a7b1]
]
" 
....
skipped many many others
....
"[
0: akonadiserver(_Z10kBacktracev+0x35) [0x804ad75]
1: akonadiserver [0x804b256]
2: [0xffffe400]
3: [0xffffe430]
4: /lib/libc.so.6(gsignal+0x50) [0xb7729990]
5: /lib/libc.so.6(abort+0x188) [0xb772b2c8]
6: /usr/lib/libQtCore.so.4(_Z17qt_message_output9QtMsgTypePKc+0x95) [0xb7a518d5]
7: akonadiserver(_ZN15FileDebugStream9writeDataEPKcx+0xc4) [0x804c584]
8: /usr/lib/libQtCore.so.4(_ZN9QIODevice5writeEPKcx+0x9e) [0xb7adec6e]
9: /usr/lib/libQtCore.so.4 [0xb7aebc2e]
10: /usr/lib/libQtCore.so.4(_ZN11QTextStreamD1Ev+0x68) [0xb7aebf28]
11: /usr/lib/libakonadiprivate.so.1(_ZN6QDebugD1Ev+0x51) [0xb7df47f1]
12: /usr/lib/libakonadiprivate.so.1(_ZN7Akonadi13AkonadiServer20startDatabaseProcessEv+0x19be) [0xb7df891e]
13: /usr/lib/libakonadiprivate.so.1(_ZN7Akonadi13AkonadiServerC1EP7QObject+0x72) [0xb7dfa682]
14: /usr/lib/libakonadiprivate.so.1(_ZN7Akonadi13AkonadiServer8instanceEv+0x56) [0xb7dfb726]
15: akonadiserver(main+0x7b) [0x804a8fb]
16: /lib/libc.so.6(__libc_start_main+0xe5) [0xb7715705]
17: akonadiserver [0x804a7b1]
]
" 

"[
0: akonadiserver(_Z10kBacktracev+0x35) [0x804ad75]
1: akonadiserver [0x804b256]
2: [0xffffe400]
3: [0xffffe430]
4: /lib/libc.so.6(gsignal+0x50) [0xb7721990]
5: /lib/libc.so.6(abort+0x188) [0xb77232c8]
6: /usr/lib/libQtCore.so.4(_Z17qt_message_output9QtMsgTypePKc+0x95) [0xb7a498d5]
7: akonadiserver(_ZN15FileDebugStream9writeDataEPKcx+0xc4) [0x804c584]
8: /usr/lib/libQtCore.so.4(_ZN9QIODevice5writeEPKcx+0x9e) [0xb7ad6c6e]
9: /usr/lib/libQtCore.so.4 [0xb7ae3c2e]
10: /usr/lib/libQtCore.so.4(_ZN11QTextStreamD1Ev+0x68) [0xb7ae3f28]
11: /usr/lib/libakonadiprivate.so.1(_ZN6QDebugD1Ev+0x51) [0xb7dec7f1]
12: /usr/lib/libakonadiprivate.so.1(_ZN7Akonadi13AkonadiServer20startDatabaseProcessEv+0x19be) [0xb7df091e]
13: /usr/lib/libakonadiprivate.so.1(_ZN7Akonadi13AkonadiServerC1EP7QObject+0x72) [0xb7df2682]
14: /usr/lib/libakonadiprivate.so.1(_ZN7Akonadi13AkonadiServer8instanceEv+0x56) [0xb7df3726]
15: akonadiserver(main+0x7b) [0x804a8fb]
16: /lib/libc.so.6(__libc_start_main+0xe5) [0xb770d705]
17: akonadiserver [0x804a7b1]
]
" 
"[
0: akonadiserver(_Z10kBacktracev+0x35) [0x804ad75]
1: akonadiserver [0x804b256]
2: [0xffffe400]
3: [0xffffe430]
4: /lib/libc.so.6(gsignal+0x50) [0xb774d990]
5: /lib/libc.so.6(abort+0x188) [0xb774f2c8]
6: /usr/lib/libQtCore.so.4(_Z17qt_message_output9QtMsgTypePKc+0x95) [0xb7a758d5]
7: akonadiserver(_ZN15FileDebugStream9writeDataEPKcx+0xc4) [0x804c584]
8: /usr/lib/libQtCore.so.4(_ZN9QIODevice5writeEPKcx+0x9e) [0xb7b02c6e]
9: /usr/lib/libQtCore.so.4 [0xb7b0fc2e]
10: /usr/lib/libQtCore.so.4(_ZN11QTextStreamD1Ev+0x68) [0xb7b0ff28]
11: /usr/lib/libakonadiprivate.so.1(_ZN6QDebugD1Ev+0x51) [0xb7e187f1]
12: /usr/lib/libakonadiprivate.so.1(_ZN7Akonadi13AkonadiServer20startDatabaseProcessEv+0x19be) [0xb7e1c91e]
13: /usr/lib/libakonadiprivate.so.1(_ZN7Akonadi13AkonadiServerC1EP7QObject+0x72) [0xb7e1e682]
14: /usr/lib/libakonadiprivate.so.1(_ZN7Akonadi13AkonadiServer8instanceEv+0x56) [0xb7e1f726]
15: akonadiserver(main+0x7b) [0x804a8fb]
16: /lib/libc.so.6(__libc_start_main+0xe5) [0xb7739705]
17: akonadiserver [0x804a7b1]
]
" 
"[
0: akonadiserver(_Z10kBacktracev+0x35) [0x804ad75]
1: akonadiserver [0x804b256]
2: [0xffffe400]
3: [0xffffe430]
4: /lib/libc.so.6(gsignal+0x50) [0xb7809990]
5: /lib/libc.so.6(abort+0x188) [0xb780b2c8]
6: /usr/lib/libQtCore.so.4(_Z17qt_message_output9QtMsgTypePKc+0x95) [0xb7b318d5]
7: akonadiserver(_ZN15FileDebugStream9writeDataEPKcx+0xc4) [0x804c584]
8: /usr/lib/libQtCore.so.4(_ZN9QIODevice5writeEPKcx+0x9e) [0xb7bbec6e]
9: /usr/lib/libQtCore.so.4 [0xb7bcbc2e]
10: /usr/lib/libQtCore.so.4(_ZN11QTextStreamD1Ev+0x68) [0xb7bcbf28]
11: /usr/lib/libakonadiprivate.so.1(_ZN6QDebugD1Ev+0x51) [0xb7ed47f1]
12: /usr/lib/libakonadiprivate.so.1(_ZN7Akonadi13AkonadiServer20startDatabaseProcessEv+0x19be) [0xb7ed891e]
13: /usr/lib/libakonadiprivate.so.1(_ZN7Akonadi13AkonadiServerC1EP7QObject+0x72) [0xb7eda682]
14: /usr/lib/libakonadiprivate.so.1(_ZN7Akonadi13AkonadiServer8instanceEv+0x56) [0xb7edb726]
15: akonadiserver(main+0x7b) [0x804a8fb]
16: /lib/libc.so.6(__libc_start_main+0xe5) [0xb77f5705]
17: akonadiserver [0x804a7b1]
]
" 


Test 14:  SUCCESS
--------

No previous Akonadi server error log found.
Details: The Akonadi server did not report any errors during its previous startup.

Test 15:  SUCCESS
--------

No current Akonadi control error log found.
Details: The Akonadi control process did not report any errors during its current startup.

Test 16:  SUCCESS
--------

No previous Akonadi control error log found.
Details: The Akonadi control process did not report any errors during its previous startup.
Comment 1 Tom Albers 2009-01-04 13:29:56 UTC
KMail does not use Akonadi for mail. Therefore this report is invalid.
Comment 2 Richard Bos 2009-01-04 13:38:32 UTC
Come on Tom, this bug is very valid.  Perhaps I should not have stated that
the problem is related to kmail => change the title.

When I start akonadiconsole, it shows the above output.  Hence akonadi is not
working for me.

I have the following additional information:
If the file ~/.local/share/akonadi/ib_logfile1 is moved away, the
following error is reported in mysql.err:

~/.local/share/akonadi/db_data> cat mysql.err
InnoDB: Error: log file ./ib_logfile1 is of different size 0 0 bytes
InnoDB: than specified in the .cnf file 0 67108864 bytes!
090104 13:27:56 [ERROR] Default storage engine (InnoDB) is not available
090104 13:27:56 [ERROR] Aborting

090104 13:27:56 [Note] /usr/sbin/mysqld: Shutdown complete


(Re)moving the file ib_logfile1 is clearly not appreciated..


For some reason akonadi can not lock the ib_logfile1 file.  Why not and how
can akonadi be improved to deal with this situation?
Comment 3 Thomas McGuire 2009-01-04 13:54:05 UTC
Tom is right, KMail is not yet using Akonadi for mails, you're looking at the wrong place for your "can't see email body" bug.
Comment 4 Richard Bos 2009-01-04 14:02:26 UTC
Tom and Thomas,
perhaps I confused 2 bugs that I have at the moment.  But please change this
bug back to product akonadi.  I definately have a problem to start akonadi, as
you can determine from the information above.  Please change the title of
this bug report to "akonadi does not start".

BTW: when I start kmail from the command line I get:
richard@med111:~/.local/share/akonadi> kmail
richard@med111:~/.local/share/akonadi> kmail(5700)/libakonadi Akonadi::Control::Private::exec: Could not start/stop Akonadi!

The first bug that I have is kmail that does not show the email body
The 2nd one is that akonadi does not start.

This report contains information for the 2nd bug (akonadi does not start),
I may assume that the information in this report is not useful for the kmail
developers.

If you change the product and leave this bug open, I'll open another for the
kmail that does not show the email body.
Comment 5 Thomas McGuire 2009-01-04 15:05:13 UTC
> perhaps I confused 2 bugs that I have at the moment.  But please change this
bug back to product akonadi.

Ok, done.
Comment 6 Richard Bos 2009-01-04 21:13:27 UTC
Thanks for adjusting the title and the re-assigned to akonadi.

Is there a way to debug this situation?  Would it be possible to start
a mysql server manually?  Is it possible to recreate the whole config,
by for example removing the .local/share/akonadi directory?
Comment 7 Richard Bos 2009-01-06 22:45:13 UTC
Yesterday, after the power up my computer I as again able to read
the body part of emails with kmail _and_ akonadi starts again.
I don't what solved this problem, but it looks like that rebooting helps
in case (where have I heard that before :( ).

I'll put bug state to resolve.