Bug 332781 - Akonadi server fails to start right after upgrading to 1.12.0
Summary: Akonadi server fails to start right after upgrading to 1.12.0
Status: RESOLVED NOT A BUG
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: server (show other bugs)
Version: 1.12.0
Platform: Archlinux Linux
: NOR grave (vote)
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-29 19:12 UTC by Aitor
Modified: 2014-04-17 08:22 UTC (History)
2 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 Aitor 2014-03-29 19:12:06 UTC
Right after upgrading to 1.12.0, akonadi fails to start.
I was using the internal MySQL (MariaDB) based setup. With this setup I received messages from akonadi than using the external DB configuration but mysqld complains about several instances running at the same time. Indeed, akonadi spawns many mysqld instances: 
------------------------------------------------BEGIN----------------------------------------------------------------------
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
-------------------------------------------------END---------------------------------------------------------------------
Changing it to a manually defined connection "akonadictl start" returns the following error:
-------------------------------------------------BEGIN---------------------------------------------------------------------
Connecting to deprecated signal aitor@Apidell ~/.local/share/akonadi/db_data $QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)                                                                            
search paths:  ("/opt/simili/tcl/bin", "/usr/lib/nx/bin", "/usr/local/sbin", "/usr/local/bin", "/usr/bin", "/opt/android-sdk/platform-tools", "/usr/share/java/gradle/bin", "/opt/java/bin", "/opt/java/db/bin", "/opt/java/jre/bin", "/usr/bin/vendor_perl", "/usr/bin/core_perl", "/home/aitor/bin", "/home/aitor/src/androidSDK/adt-bundle-linux-x86_64-20130522/sdk/platform-tools/", "/home/aitor/src/androidSDK/adt-bundle-linux-x86_64-20130522/sdk/tools/", "/usr/sbin", "/usr/local/sbin", "/usr/local/libexec", "/usr/libexec", "/opt/mysql/libexec", "/opt/local/lib/mysql5/bin", "/opt/mysql/sbin")                                                                          
QSqlDatabasePrivate::removeDatabase: connection 'initConnection' is still in use, all queries will cease to work.                                                                 
""                                                                                       
Unable to initialize database.                                                           
"[                                                                                       
0: akonadiserver(_Z11akBacktracev+0x37) [0x463047]                                       
1: akonadiserver() [0x46328d]
2: /usr/lib/libc.so.6(+0x35400) [0x7fe168d57400]
3: /usr/lib/libc.so.6(gsignal+0x39) [0x7fe168d57389]
4: /usr/lib/libc.so.6(abort+0x148) [0x7fe168d58788]
5: /usr/lib/libQtCore.so.4(_Z17qt_message_output9QtMsgTypePKc+0x5f) [0x7fe16a85d90f]
6: akonadiserver(_ZN15FileDebugStream9writeDataEPKcx+0x9d) [0x4651bd]
7: /usr/lib/libQtCore.so.4(_ZN9QIODevice5writeEPKcx+0xb0) [0x7fe16a8f8500]
8: /usr/lib/libQtCore.so.4(+0x1188fd) [0x7fe16a9058fd]
9: /usr/lib/libQtCore.so.4(_ZN11QTextStreamD1Ev+0x33) [0x7fe16a90e4e3]
10: akonadiserver(_ZN7Akonadi6Server13AkonadiServer4initEv+0x5fa) [0x467faa]
11: /usr/lib/libQtCore.so.4(_ZN7QObject5eventEP6QEvent+0x24e) [0x7fe16a97fefe]
12: /usr/lib/libQtCore.so.4(_ZN16QCoreApplication14notifyInternalEP7QObjectP6QEvent+0x6d) [0x7fe16a967ebd]
13: /usr/lib/libQtCore.so.4(_ZN23QCoreApplicationPrivate16sendPostedEventsEP7QObjectiP11QThreadData+0x1ef) [0x7fe16a96af0f]
14: /usr/lib/libQtCore.so.4(+0x1a8263) [0x7fe16a995263]
15: /usr/lib/libglib-2.0.so.0(g_main_context_dispatch+0x146) [0x7fe168433296]
16: /usr/lib/libglib-2.0.so.0(+0x485e8) [0x7fe1684335e8]
17: /usr/lib/libglib-2.0.so.0(g_main_context_iteration+0x2c) [0x7fe16843368c]
18: /usr/lib/libQtCore.so.4(_ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE+0x65) [0x7fe16a994b25]
19: /usr/lib/libQtCore.so.4(_ZN10QEventLoop13processEventsE6QFlagsINS_17ProcessEventsFlagEE+0x2f) [0x7fe16a966b1f]
20: /usr/lib/libQtCore.so.4(_ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE+0x175) [0x7fe16a966e15]
21: /usr/lib/libQtCore.so.4(_ZN16QCoreApplication4execEv+0x8b) [0x7fe16a96bf4b]
22: akonadiserver(main+0x1bf) [0x45ca9f]
23: /usr/lib/libc.so.6(__libc_start_main+0xf5) [0x7fe168d43b05]
24: akonadiserver() [0x45d1e8]
]
"
ProcessControl: Application 'akonadiserver' returned with exit code 255 (Unknown error)
------------------------------------------END----------------------------------------------------------------------------
I'm able to connect to mysqld instance from any other client without any problem.
This is my current akonadi DB schema (generated with MySQL workbench):
------------------------------------------BEGIN---------------------------------------------------------------------------
-- -----------------------------------------------------
-- Table `resourcetable`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `resourcetable` (
  `id` BIGINT(20) NOT NULL AUTO_INCREMENT,
  `name` VARBINARY(255) NOT NULL,
  `isVirtual` TINYINT(1) NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE INDEX `name` (`name` ASC))
ENGINE = InnoDB
AUTO_INCREMENT = 30
DEFAULT CHARACTER SET = utf8;
-- -----------------------------------------------------
-- Table `collectiontable`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `collectiontable` (
  `id` BIGINT(20) NOT NULL AUTO_INCREMENT,
  `remoteId` VARBINARY(255) NULL DEFAULT NULL,
  `remoteRevision` VARBINARY(255) NULL DEFAULT NULL,
  `name` VARBINARY(255) NOT NULL,
  `parentId` BIGINT(20) NULL DEFAULT NULL,
  `resourceId` BIGINT(20) NOT NULL,
  `subscribed` TINYINT(1) NOT NULL DEFAULT '1',
  `cachePolicyInherit` TINYINT(1) NOT NULL DEFAULT '1',
  `cachePolicyCheckInterval` INT(11) NOT NULL DEFAULT '-1',
  `cachePolicyCacheTimeout` INT(11) NOT NULL DEFAULT '-1',
  `cachePolicySyncOnDemand` TINYINT(1) NOT NULL DEFAULT '0',
  `cachePolicyLocalParts` VARBINARY(255) NULL DEFAULT NULL,
  `queryString` VARBINARY(32768) NULL DEFAULT NULL,
  `queryLanguage` VARBINARY(255) NULL DEFAULT NULL,
  `isVirtual` TINYINT(1) NULL DEFAULT '0',
  `queryAttributes` VARBINARY(255) NULL DEFAULT NULL,
  `queryCollections` VARBINARY(255) NULL DEFAULT NULL,
  PRIMARY KEY (`id`))
ENGINE = InnoDB
AUTO_INCREMENT = 1184
DEFAULT CHARACTER SET = utf8;
-- -----------------------------------------------------
-- Table `collectionattributetable`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `collectionattributetable` (
  `id` BIGINT(20) NOT NULL AUTO_INCREMENT,
  `collectionId` BIGINT(20) NOT NULL,
  `type` LONGBLOB NOT NULL,
  `value` LONGBLOB NULL DEFAULT NULL,
  PRIMARY KEY (`id`))
ENGINE = InnoDB
AUTO_INCREMENT = 6886
DEFAULT CHARACTER SET = utf8;
-- -----------------------------------------------------
-- Table `mimetypetable`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `mimetypetable` (
  `id` BIGINT(20) NOT NULL AUTO_INCREMENT,
  `name` VARBINARY(255) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE INDEX `name` (`name` ASC))
ENGINE = InnoDB
AUTO_INCREMENT = 20
DEFAULT CHARACTER SET = utf8;
-- -----------------------------------------------------
-- Table `collectionmimetyperelation`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `collectionmimetyperelation` (
  `Collection_id` BIGINT(20) NOT NULL,
  `MimeType_id` BIGINT(20) NOT NULL,
  PRIMARY KEY (`Collection_id`, `MimeType_id`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
-- -----------------------------------------------------
-- Table `pimitemtable`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `pimitemtable` (
  `id` BIGINT(20) NOT NULL AUTO_INCREMENT,
  `rev` INT(11) NOT NULL DEFAULT '0',
  `remoteId` VARBINARY(255) NULL DEFAULT NULL,
  `remoteRevision` VARBINARY(255) NULL DEFAULT NULL,
  `collectionId` BIGINT(20) NULL DEFAULT NULL,
  `mimeTypeId` BIGINT(20) NULL DEFAULT NULL,
  `datetime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `atime` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00',
  `dirty` TINYINT(1) NULL DEFAULT NULL,
  `size` BIGINT(20) NOT NULL DEFAULT '0',
  `gid` VARBINARY(255) NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  INDEX `PimItemTable_gidIndex` (`gid` ASC))
ENGINE = InnoDB
AUTO_INCREMENT = 701423
DEFAULT CHARACTER SET = utf8;
-- -----------------------------------------------------
-- Table `collectionpimitemrelation`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `collectionpimitemrelation` (
  `Collection_id` BIGINT(20) NOT NULL,
  `PimItem_id` BIGINT(20) NOT NULL,
  PRIMARY KEY (`Collection_id`, `PimItem_id`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
-- -----------------------------------------------------
-- Table `flagtable`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `flagtable` (
  `id` BIGINT(20) NOT NULL AUTO_INCREMENT,
  `name` VARBINARY(255) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE INDEX `name` (`name` ASC))
ENGINE = InnoDB
AUTO_INCREMENT = 33
DEFAULT CHARACTER SET = utf8;
-- -----------------------------------------------------
-- Table `parttable`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `parttable` (
  `id` BIGINT(20) NOT NULL AUTO_INCREMENT,
  `pimItemId` BIGINT(20) NOT NULL,
  `name` VARBINARY(255) NOT NULL,
  `data` LONGBLOB NULL DEFAULT NULL,
  `datasize` BIGINT(20) NOT NULL,
  `version` INT(11) NULL DEFAULT '0',
  `external` TINYINT(1) NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  INDEX `PartTable_pimItemNameIndex` (`name` ASC))
ENGINE = InnoDB
AUTO_INCREMENT = 1183423
DEFAULT CHARACTER SET = utf8;
-- -----------------------------------------------------
-- Table `parttypetable`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `parttypetable` (
  `id` BIGINT(20) NOT NULL AUTO_INCREMENT,
  `name` VARBINARY(255) NOT NULL,
  `ns` VARBINARY(255) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE INDEX `PartTypeTable_partTypeNameIndex` (`ns` ASC, `name` ASC))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
-- -----------------------------------------------------
-- Table `pimitemflagrelation`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `pimitemflagrelation` (
  `PimItem_id` BIGINT(20) NOT NULL,
  `Flag_id` BIGINT(20) NOT NULL,
  PRIMARY KEY (`PimItem_id`, `Flag_id`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
-- -----------------------------------------------------
-- Table `tagtable`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `tagtable` (
  `id` BIGINT(20) NOT NULL AUTO_INCREMENT,
  `gid` VARBINARY(255) NOT NULL,
  `parentId` BIGINT(20) NULL DEFAULT NULL,
  PRIMARY KEY (`id`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
-- -----------------------------------------------------
-- Table `pimitemtagrelation`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `pimitemtagrelation` (
  `PimItem_id` BIGINT(20) NOT NULL,
  `Tag_id` BIGINT(20) NOT NULL,
  PRIMARY KEY (`PimItem_id`, `Tag_id`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
-- -----------------------------------------------------
-- Table `schemaversiontable`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `schemaversiontable` (
  `version` INT(11) NOT NULL DEFAULT '0')
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
-- -----------------------------------------------------
-- Table `tagattributetable`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `tagattributetable` (
  `id` BIGINT(20) NOT NULL AUTO_INCREMENT,
  `tagId` BIGINT(20) NOT NULL,
  `type` LONGBLOB NOT NULL,
  `value` LONGBLOB NULL DEFAULT NULL,
  PRIMARY KEY (`id`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
-- -----------------------------------------------------
-- Table `tagremoteidresourcerelationtable`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `tagremoteidresourcerelationtable` (
  `tagId` BIGINT(20) NOT NULL,
  `resourceId` BIGINT(20) NOT NULL,
  `remoteId` VARBINARY(255) NOT NULL)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;



Reproducible: Always

Steps to Reproduce:
1. run "akonadictl start" using either internal or external DB configuration
2.
3.
Actual Results:  
using internal configuration akonadi spawns multiple mysqld instances but it fails to start in the same way as using the external configuration

Expected Results:  
Akonadi should start correctly

Distro: Archlinux
Kernel: 3.13.7-1-ARCH
KDE 4.12
Akonadi: 1.12.0
MariaDB: 5.5.34-MariaDB-31.1
Comment 1 Daniel Vrátil 2014-03-31 09:34:22 UTC
Can you please make sure that no MySQL instances are running and that there's no *.lock file in ~/.local/share/akonadi and then try starting Akonadi from console via akonadictl start? If it fails, please provide output from self-test dialog (you will get it by running KMail for example).
Comment 2 Aitor 2014-03-31 22:00:22 UTC
I might not expressed myself very clearly, sorry. I'll try to clarify what I did try.
Once I detected Akonadi was not able to start, I tried to find out what was going on. I was using the default internal MySQL based configuration. With this setup, when I tried to start Akonadi with "akonadictl start", Akonadi failed to boot and at the same time it automatically launched multiple mysqld instances (which might be another bug). At that moment I decided to check the MySQL's data integrity and I started MySQL manually, which did so without any problem. With MySQL booted manually, I decided to change Akonadi's configuration to point it to this manually started instance of MySQL. Akonadi's error message was the same as when it tried to use the default configuration. Mean while I tried with a new clean profile (different user) and I saw that Akonadi booted correctly. At this point, I decided to backup MySQL DB (ask me if you want me to check some data in this DB) and I've wiped the whole .local/share/akonadi folder. Since my data is backed by other servers I have no big problems doing so, but it might be an issue for other people.
My Akonadi DB was quite old, so I don't know if that might have been an issue. Unfortunatly, I forgot to backup old akonadiserver.error and akonadi_control.error files, sorry. The only portion of that files available is the one posted in the bug description.
Comment 3 Daniel Vrátil 2014-04-02 10:20:38 UTC
Closing, sounds like a problem with MySQL lock or PID not being properly cleaned up after previous shutdown. We cannot cope with that well yet, but there's another report about this somewhere.
Comment 4 Stephan Menzel 2014-04-17 08:22:46 UTC
I'm having the exact same problem here with both akonadi 1.12 and 1.12.1.
The only thing that helps is a downgrade to 1.11.

My problem description and stacktrace are the same. Also, I can connect to the MySQL server with other tools with no problems.