Bug #8254

Chamilo 1.10 cannot run on replicated DB servers

Added by Jan Derriks about 5 years ago. Updated about 5 years ago.

Database & API changes
Target version:
Start date:
Due date:
% Done:


Estimated time:
SCRUM pts - complexity:


Installing 1.10.4 on a system that has DB load balancing with replicated mysql databases will fail:

An exception occurred while executing 'INSERT INTO access_url_rel_user (user_id, access_url_id)\n VALUES ('2', '1') ':\n\nSQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`acc_chamilo_db`.`access_url_rel_user`, CONSTRAINT `FK_8557426373444FD5` FOREIGN KEY (`access_url_id`) REFERENCES `access_url` (`id`)), referer:

The reason is that you cannot expect an auto-increment value to start on 1 or even increment by 1 (

Is Chamilo1.10 not ready for professional production servers or has it not been tested on those?

If you want to reproduce, The auto-incement setting on the db was:
mysql> SHOW VARIABLES LIKE 'auto_inc%';
-------------------------------+ | Variable_name | Value |
-------------------------------+ | auto_increment_increment | 2 | | auto_increment_offset | 2 |
2 rows in set (0.00 sec)

Related issues

Related to Chamilo LMS - Bug #8201: Fatal error cut() and DB multiple hot masters replication issuesBug resolved15/04/2016




Updated by Jan Derriks about 5 years ago

Unfortunately I cannot reproduce the problem on xampp with auto_increment_incement=3 and increment_offset=30.
Even after dropping all tables, installation still fails op our production servers (Red hat with F5 load balanced Mysql servers).


Updated by Julio Montoya about 5 years ago

  • Priority changed from High to Normal

If by "professional production servers" you mean a master slave DB replication schema. I didn't test it. In our documentation, we don't show compatibility with any specific configuration. We just mention that chamilo needs MySQL or MariaDb.


Updated by Yannick Warnier about 5 years ago

  • Category set to Database & API changes
  • Status changed from New to Assigned
  • Assignee set to Yannick Warnier
  • Priority changed from Normal to Urgent
  • Target version set to 1.11.0

Hi Jan, I'll look into this for 1.11 (which should be out rather soon, like in 45 days or so)


Updated by Yannick Warnier about 5 years ago

  • Target version changed from 1.11.0 to 2.0

This is very related to #8201 which reports a similar issue (under another name). A solution is provided there. Meanwhile, I will postpone this to 2.0 because our deadline for 1.11 is very short, but we'll probably provide a patch for 1.10 and 1.11 as soon as we fix it in the development phase of 2.0.


Updated by Jan Derriks about 5 years ago

#8201 is the same issue in French indeed.
Disabling mysql nodes or changing the auto-increment settings is not an option I can choose so I'll wait for a patch.

edit august 2016: Couldn't wait longer. Installed on other server, dumped database on target server and using only 1 master mysql node works. Damn RedHat and fancy F5 loadbalancers with master-slave DB replication. It used to be so simple and cheap in the old days.

Also available in: Atom PDF