I am using CiviCRM(4.6.10) with Drupal (7.38) together with the civicrm_og_sync module. Until now everything worked fine:
Everytime a drupal user was created automatically a civi contact was also created. Then I deleted a user account on drupal and the corresponding contact in civi (full deletion!).
Now when I try to create a new user in drupal I get the following error:
Datenbank-Errorcode: Cannot add or update a child row: a foreign key constraint fails (
civi_db
.civicrm_log
, CONSTRAINTFK_civicrm_log_modified_id
FOREIGN KEY (modified_id
) REFERENCEScivicrm_contact
(id
) ON DELETE CASCADE), 1452 Zusätzliche Details: Array ( [callback] => Array ( [0] => CRM_Core_Error [1] => handle ) [code] => -3 [message] => DB Error: constraint violation [mode] => 16 [debug_info] => INSERT INTO civicrm_log (entity_table , entity_id , data , modified_id , modified_date ) VALUES ('civicrm_contact' , 381 , 'civicrm_contact,381' , 374 , 20160111141559 ) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (civi_db
.civicrm_log
, CONSTRAINTFK_civicrm_log_modified_id
FOREIGN KEY (modified_id
) REFERENCEScivicrm_contact
(id
) ON DELETE CASCADE)] [type] => DB_Error [user_info] => INSERT INTO civicrm_log (entity_table , entity_id , data , modified_id , modified_date ) VALUES ('civicrm_contact' , 381 , 'civicrm_contact,381' , 374 , 20160111141559 ) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (civi_db
.civicrm_log
, CONSTRAINTFK_civicrm_log_modified_id
FOREIGN KEY (modified_id
) REFERENCEScivicrm_contact
(id
) ON DELETE CASCADE)] [to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_log (entity_table , entity_id , data , modified_id , modified_date ) VALUES ('civicrm_contact' , 381 , 'civicrm_contact,381' , 374 , 20160111141559 ) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (civi_db
.civicrm_log
, CONSTRAINTFK_civicrm_log_modified_id
FOREIGN KEY (modified_id
) REFERENCEScivicrm_contact
(id
) ON DELETE CASCADE)]"] )
In the end the drupal user is created but not the civi contact. I looked into the tables 'civicrm_contact' and 'civicrm_log' but couldn't find anything supicious - an id or modified_id with number 381 did not exist. On the other hand I can still create a contact with the civi user-interface...
What can I do?