Bug 314514 - akonadi.collectiontable doesn't exist
Summary: akonadi.collectiontable doesn't exist
Status: RESOLVED NOT A BUG
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: server (show other bugs)
Version: 4.10
Platform: Ubuntu Linux
: NOR grave
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-06 13:46 UTC by karaluh
Modified: 2013-12-06 17:26 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
akonadictl start (3.03 KB, text/plain)
2013-03-11 07:34 UTC, karaluh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description karaluh 2013-02-06 13:46:32 UTC
After upgrading to 4.10 akonadi fails to start. The error from log file:

Sql error: Table 'akonadi.collectiontable' doesn't exist QMYSQL: Unable to execute query
Query: ALTER TABLE CollectionTable ADD COLUMN id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY" 
Unable to initialize database.


Reproducible: Always
Comment 1 karaluh 2013-03-07 10:32:39 UTC
Not fixed in 4.10.1
Comment 2 Christophe Marin 2013-03-08 21:03:03 UTC
please attach the output of 'akonadictl start' and 'akonadictl --version'
Comment 3 karaluh 2013-03-11 07:34:17 UTC
Created attachment 77938 [details]
akonadictl start

karol@ubuntu:~$ akonadictl --version
Akonadi 1.9.0
Comment 4 karaluh 2013-04-05 13:02:06 UTC
Still not fixed in 4.10.2
Comment 5 Chao Feng 2013-06-02 00:29:21 UTC
Which mysql did you use, internal or external?
Did you set case sensitivity manually? Have a look at bug 220007. 

And can you check the mysql table manually, if the table not exist or has different case?
Comment 6 karaluh 2013-06-03 12:02:51 UTC
(In reply to comment #5)
> Which mysql did you use, internal or external?

Internal.

> Did you set case sensitivity manually? Have a look at bug 220007. 

No, i did not. Also, the bug was fixed in 2009.

> And can you check the mysql table manually, if the table not exist or has
> different case?

How can I do that?
Comment 7 Chao Feng 2013-06-03 13:52:41 UTC
Run akonadiconsole, in tab "DB console" bottom edit box, Enter "show tables". Check if collectiontable table exist.

It seems your database is corrupted. Could you check if it works if you create a new KDE user? If it works. You can in DB console, run "show create table collectiontable;" command. It will generate a database creation command. 

Run the command to create the table. My table here is as below. But My akondi version is 1.9.2. So it maybe different with yours. 

"CREATE TABLE `collectiontable` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `remoteId` varbinary(255) DEFAULT NULL,
  `remoteRevision` varbinary(255) DEFAULT NULL,
  `name` varbinary(255) NOT NULL,
  `parentId` bigint(20) 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) DEFAULT NULL,
  `queryString` varbinary(32768) DEFAULT NULL,
  `queryLanguage` varbinary(255) DEFAULT NULL,
  `isVirtual` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `CollectionTable_parentAndNameIndex` (`parentId`,`name`),
  KEY `resourceId` (`resourceId`),
  CONSTRAINT `collectiontable_ibfk_1` FOREIGN KEY (`parentId`) REFERENCES `collectiontable` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `collectiontable_ibfk_2` FOREIGN KEY (`resourceId`) REFERENCES `resourcetable` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=127 DEFAULT CHARSET=utf8
Comment 8 karaluh 2013-06-04 06:27:15 UTC
(In reply to comment #7)
> Run akonadiconsole,

"Failed to connect to database: Can't connect to local MySQL server through socket '/home/kjedrzejczyk/.local/share/akonadi/socket-ubuntu/mysql.socket' (2) QMYSQL: Unable to connect"

The socket file I have is akonadiserver.socket.
Comment 9 Chao Feng 2013-06-04 13:34:02 UTC
Did you check the result of a newly created user?
Comment 10 karaluh 2013-06-05 07:33:27 UTC
(In reply to comment #9)
> Did you check the result of a newly created user?

Yes, it works, however I cannot recreate the table obviously.
Comment 11 karaluh 2013-09-06 13:33:58 UTC
Still not fixed in 4.11
Comment 12 Chao Feng 2013-09-08 06:59:18 UTC
Could you check if https://wiki.archlinux.org/index.php/KDE#Clean_akonadi_configuration_to_fix_kmail fix your problem. 

Your local database is corrupted during upgrading. Yes, it is indeed a bug. But if clean old configuration fix your problem, at least you could use it again.
Comment 13 Daniel Vrátil 2013-12-06 17:26:42 UTC
The CollectionTable has been indeed updated in 1.9.0, the updater should have taken care of it on first start, but it had probably failed, corrupting the table (for a reason we will never find out). Please follow the in the wiki link in comment #12 to reset your Akonadi database.

If you run into the corruption again, please reopen this bug.