CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • Foreign Key Restraint Fails when creating event
Pages: [1]

Author Topic: Foreign Key Restraint Fails when creating event  (Read 1548 times)

bcobin

  • I post frequently
  • ***
  • Posts: 337
  • Karma: 9
    • InterCreative Media
  • CiviCRM version: 4.3.3
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.9
  • PHP version: 5.3
Foreign Key Restraint Fails when creating event
April 21, 2008, 11:40:52 am
I try to create an event and I get the error as listed below. I've also run into foreign key restraint errors in trying to migrate databases (which I've managed to bypass via turning it off an on again in the db itself, per a workaround suggested here) - this is very disturbing. I've gone through a lot to find a host that supports MySQL 5 (and had to find out myself about InnoDB), but things feel really unstable. I have to say I'm not feeling very confident with this software right now - any help would be greatly appreciated! Thanks in advance...

---error message---

Sorry. A non-recoverable error has occurred.

    Database Error Code: Cannot add or update a child row: a foreign key constraint fails (`borodkin_civicrm/civicrm_log`, CONSTRAINT `FK_civicrm_log_modified_id` FOREIGN KEY (`modified_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE), 1452

    Return to home page.

Error Details:

Array
(
    [callback] => Array
        (
           
  • => CRM_Core_Error
  • [1] => handle
            )

       
Code: [Select]
=> -1
    [message] => DB Error: unknown error
    [mode] => 16
    [debug_info] => INSERT INTO civicrm_log (entity_table , entity_id , modified_id , modified_date ) VALUES ('civicrm_event' ,  1 ,  102 ,  20080421 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`borodkin_civicrm/civicrm_log`, CONSTRAINT `FK_civicrm_log_modified_id` FOREIGN KEY (`modified_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]
    [type] => DB_Error
    [user_info] => INSERT INTO civicrm_log (entity_table , entity_id , modified_id , modified_date ) VALUES ('civicrm_event' ,  1 ,  102 ,  20080421 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`borodkin_civicrm/civicrm_log`, CONSTRAINT `FK_civicrm_log_modified_id` FOREIGN KEY (`modified_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]
    [to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_log (entity_table , entity_id , modified_id , modified_date ) VALUES ('civicrm_event' ,  1 ,  102 ,  20080421 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`borodkin_civicrm/civicrm_log`, CONSTRAINT `FK_civicrm_log_modified_id` FOREIGN KEY (`modified_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]"]
)


Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Foreign Key Restraint Fails when creating event
April 22, 2008, 01:34:34 am
Foreign key errors like this generally mean that you've stayed logged in to your CMS account while reloading or changing the state of your database. CiviCRM is trying to use the contact ID it has in the session for your user (102) - but that contact no longer exists. Logging out and back in should fix this error.
Protect your investment in CiviCRM by  becoming a Member!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • Foreign Key Restraint Fails when creating event

This forum was archived on 2017-11-26.