Roundcube Community Forum

 

Problem with groups in 0.4beta

Started by bagu, April 24, 2010, 12:54:41 PM

Previous topic - Next topic

bagu

Helle, i can't create groups on this version, i receive this error in logs :

[24-Apr-2010 18:43:38 +0200]: DB Error: MDB2 Error: constraint violation Query: _doQuery: [Error message: Could not execute statement] [Last executed query: INSERT INTO contactgroups (user_id, changed, name) VALUES (20, now(), 'test')] [Native code: 1452] [Native message: Cannot add or update a child row: a foreign key constraint fails (`roundcubemail`.`contactgroups`, CONSTRAINT `user_id_fk_contactgroups` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE)]  in \roundcube\program\include\rcube_mdb2.php on line 658 (POST /webmail/?_task=addressbook&_action=group-create?_task=&_action=)

I use mysql 5.1.46, php 5.2.13 and apache 2.2.15

EDIT : there is a problem with the mysql files...Because, i make a backup of my database, i drop everything, then reload mysql.initial.sql and then some updates of  mysql.update.sql and everything work well now...

Paul

Quote from: bagu;27008EDIT : there is a problem with the mysql files...Because, i make a backup of my database, i drop everything, then reload mysql.initial.sql and then some updates of  mysql.update.sql and everything work well now...

I'm having the same problem. I did execute the SQL statements in mysql.update.sql.
My users and contacts tables are myISAM. It seems they changed the storage engine between 0.1.1 and 0.2 stable in the mysql.initial.sql file, but there's no 'alter table ... engine=innodb' in the mysql.update.sql files. So unless I'm missing something, there is a problem with the mysql files.

Nick Lock

I've just had this problem myself, and after opening a ticket (#1486794) alec pointed me in the right direction to solve it. If you're upgrading from an older version, your tables might be using the MyISAM engine - and RC requires InnoDB. Having tables using different engines causes all sorts of exciting problems!


This can be fixed by using:

ALTER TABLE {tablename} TYPE=InnoDB;

replacing {tablename} with each table in your RC database in turn to convert them all to InnoDB.

(do it on a copy of the DB first, just to be safe!)

aless

same problem, i have solved with:

ALTER TABLE `cache` ENGINE=InnoDB;
ALTER TABLE `session` ENGINE=InnoDB;
ALTER TABLE `messages` ENGINE=InnoDB;
ALTER TABLE `users` ENGINE=InnoDB;
ALTER TABLE `contacts` ENGINE=InnoDB;
ALTER TABLE `identities` ENGINE=InnoDB;