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 »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Severely broken
Pages: [1]

Author Topic: Severely broken  (Read 1307 times)

sdstern

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 4.0.8
  • CMS version: Drupal 7
  • MySQL version: 5.1.47
  • PHP version: 5.3.5
Severely broken
January 25, 2012, 03:24:02 pm
Something's broken.  I had an admin messing around and I think she deleted something important.  On the site's home page, I get the DB Constraint error and this is in the log. I need a clue on how to fix this.

There are similar errors on the membership dashboard, so I suspect this has something to do with CiviMember.

Code: [Select]

Jan 25 17:22:31  [info] $Fatal Error Details = Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -3
    [message] => DB Error: constraint violation
    [mode] => 16
    [debug_info] => INSERT INTO civicrm_acl_cache (contact_id , acl_id ) VALUES ( 1 ,  2 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`ooga_civicrm`.`civicrm_acl_cache`, CONSTRAINT `FK_civicrm_acl_cache_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]
    [type] => DB_Error
    [user_info] => INSERT INTO civicrm_acl_cache (contact_id , acl_id ) VALUES ( 1 ,  2 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`ooga_civicrm`.`civicrm_acl_cache`, CONSTRAINT `FK_civicrm_acl_cache_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_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_acl_cache (contact_id , acl_id ) VALUES ( 1 ,  2 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`ooga_civicrm`.`civicrm_acl_cache`, CONSTRAINT `FK_civicrm_acl_cache_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]"]
)


Jan 25 17:22:31  [info] $backTrace = /var/www/ooga-crm/drupal/sites/all/modules/civicrm/CRM/Core/Error.php, backtrace, 205
, handle,
/var/www/ooga-crm/drupal/sites/all/modules/civicrm/packages/PEAR.php, call_user_func, 931
/var/www/ooga-crm/drupal/sites/all/modules/civicrm/packages/DB.php, PEAR_Error, 968
/var/www/ooga-crm/drupal/sites/all/modules/civicrm/packages/PEAR.php, DB_Error, 564
/var/www/ooga-crm/drupal/sites/all/modules/civicrm/packages/DB/common.php, raiseError, 1903
/var/www/ooga-crm/drupal/sites/all/modules/civicrm/packages/DB/mysql.php, raiseError, 898
/var/www/ooga-crm/drupal/sites/all/modules/civicrm/packages/DB/mysql.php, mysqlRaiseError, 327
/var/www/ooga-crm/drupal/sites/all/modules/civicrm/packages/DB/common.php, simpleQuery, 1216
/var/www/ooga-crm/drupal/sites/all/modules/civicrm/packages/DB/DataObject.php, query, 2424
/var/www/ooga-crm/drupal/sites/all/modules/civicrm/packages/DB/DataObject.php, _query, 1054
/var/www/ooga-crm/drupal/sites/all/modules/civicrm/CRM/Core/DAO.php, insert, 288
/var/www/ooga-crm/drupal/sites/all/modules/civicrm/CRM/ACL/BAO/Cache.php, save, 99
/var/www/ooga-crm/drupal/sites/all/modules/civicrm/CRM/ACL/BAO/Cache.php, store, 64
/var/www/ooga-crm/drupal/sites/all/modules/civicrm/CRM/ACL/BAO/ACL.php, build, 807
/var/www/ooga-crm/drupal/sites/all/modules/civicrm/CRM/ACL/API.php, group, 157
/var/www/ooga-crm/drupal/sites/all/modules/civicrm/CRM/Core/Permission.php, group, 253
/var/www/ooga-crm/drupal/sites/all/modules/civicrm/CRM/Event/BAO/Event.php, event, 789
/var/www/ooga-crm/drupal/sites/all/modules/civicrm/CRM/Core/Block.php, getCompleteInfo, 494
/var/www/ooga-crm/drupal/sites/all/modules/civicrm/CRM/Core/Block.php, setTemplateEventValues, 309
/var/www/ooga-crm/drupal/sites/all/modules/civicrm/CRM/Core/Block.php, setTemplateValues, 550
/var/www/ooga-crm/drupal/sites/all/modules/civicrm/drupal/civicrm.module, getContent, 208
, civicrm_block_view,
/var/www/ooga-crm/drupal/includes/module.inc, call_user_func_array, 794
/var/www/ooga-crm/drupal/modules/block/block.module, module_invoke, 834
/var/www/ooga-crm/drupal/modules/block/block.module, _block_render_blocks, 658
/var/www/ooga-crm/drupal/modules/block/block.module, block_list, 315
/var/www/ooga-crm/drupal/modules/block/block.module, block_get_blocks_by_region, 268
/var/www/ooga-crm/drupal/includes/common.inc, block_page_build, 5501
/var/www/ooga-crm/drupal/includes/common.inc, drupal_render_page, 2546
/var/www/ooga-crm/drupal/includes/common.inc, drupal_deliver_html_page, 2438
/var/www/ooga-crm/drupal/includes/menu.inc, drupal_deliver_page, 518
/var/www/ooga-crm/drupal/index.php, menu_execute_active_handler, 21

Jan 25 17:22:33  [info] $Fatal Error Details = Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -3
    [message] => DB Error: constraint violation
    [mode] => 16
    [debug_info] => INSERT INTO civicrm_acl_cache (contact_id , acl_id ) VALUES ( 1 ,  2 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`ooga_civicrm`.`civicrm_acl_cache`, CONSTRAINT `FK_civicrm_acl_cache_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]
    [type] => DB_Error
    [user_info] => INSERT INTO civicrm_acl_cache (contact_id , acl_id ) VALUES ( 1 ,  2 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`ooga_civicrm`.`civicrm_acl_cache`, CONSTRAINT `FK_civicrm_acl_cache_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_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_acl_cache (contact_id , acl_id ) VALUES ( 1 ,  2 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`ooga_civicrm`.`civicrm_acl_cache`, CONSTRAINT `FK_civicrm_acl_cache_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]"]
)


Jan 25 17:22:33  [info] $backTrace = /var/www/ooga-crm/drupal/sites/all/modules/civicrm/CRM/Core/Error.php, backtrace, 205
, handle,
/var/www/ooga-crm/drupal/sites/all/modules/civicrm/packages/PEAR.php, call_user_func, 931
/var/www/ooga-crm/drupal/sites/all/modules/civicrm/packages/DB.php, PEAR_Error, 968
/var/www/ooga-crm/drupal/sites/all/modules/civicrm/packages/PEAR.php, DB_Error, 564
/var/www/ooga-crm/drupal/sites/all/modules/civicrm/packages/DB/common.php, raiseError, 1903
/var/www/ooga-crm/drupal/sites/all/modules/civicrm/packages/DB/mysql.php, raiseError, 898
/var/www/ooga-crm/drupal/sites/all/modules/civicrm/packages/DB/mysql.php, mysqlRaiseError, 327
/var/www/ooga-crm/drupal/sites/all/modules/civicrm/packages/DB/common.php, simpleQuery, 1216
/var/www/ooga-crm/drupal/sites/all/modules/civicrm/packages/DB/DataObject.php, query, 2424
/var/www/ooga-crm/drupal/sites/all/modules/civicrm/packages/DB/DataObject.php, _query, 1054
/var/www/ooga-crm/drupal/sites/all/modules/civicrm/CRM/Core/DAO.php, insert, 288
/var/www/ooga-crm/drupal/sites/all/modules/civicrm/CRM/ACL/BAO/Cache.php, save, 99
/var/www/ooga-crm/drupal/sites/all/modules/civicrm/CRM/ACL/BAO/Cache.php, store, 64
/var/www/ooga-crm/drupal/sites/all/modules/civicrm/CRM/ACL/BAO/ACL.php, build, 807
/var/www/ooga-crm/drupal/sites/all/modules/civicrm/CRM/ACL/API.php, group, 157
/var/www/ooga-crm/drupal/sites/all/modules/civicrm/CRM/Core/Permission.php, group, 253
/var/www/ooga-crm/drupal/sites/all/modules/civicrm/CRM/Event/BAO/Event.php, event, 789
/var/www/ooga-crm/drupal/sites/all/modules/civicrm/CRM/Core/Block.php, getCompleteInfo, 494
/var/www/ooga-crm/drupal/sites/all/modules/civicrm/CRM/Core/Block.php, setTemplateEventValues, 309
/var/www/ooga-crm/drupal/sites/all/modules/civicrm/CRM/Core/Block.php, setTemplateValues, 550
/var/www/ooga-crm/drupal/sites/all/modules/civicrm/drupal/civicrm.module, getContent, 208
, civicrm_block_view,
/var/www/ooga-crm/drupal/includes/module.inc, call_user_func_array, 794
/var/www/ooga-crm/drupal/modules/block/block.module, module_invoke, 834
/var/www/ooga-crm/drupal/modules/block/block.module, _block_render_blocks, 658
/var/www/ooga-crm/drupal/modules/block/block.module, block_list, 315
/var/www/ooga-crm/drupal/modules/block/block.module, block_get_blocks_by_region, 268
/var/www/ooga-crm/drupal/includes/common.inc, block_page_build, 5501
/var/www/ooga-crm/drupal/includes/common.inc, drupal_render_page, 2503
/var/www/ooga-crm/drupal/includes/common.inc, drupal_deliver_html_page, 2438
/var/www/ooga-crm/drupal/includes/menu.inc, drupal_deliver_page, 518
/var/www/ooga-crm/drupal/index.php, menu_execute_active_handler, 21
« Last Edit: January 25, 2012, 03:28:29 pm by sdstern »

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Severely broken
January 26, 2012, 08:57:34 am
Seems you lost Contact ID #1. You may have to recreate that in the civicrm_contact table manually.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Severely broken
January 26, 2012, 09:02:25 am
You can try following:
- logout
- then empty all civicrm_*_cache tables

Kurund
Found this reply helpful? Support CiviCRM

sdstern

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 4.0.8
  • CMS version: Drupal 7
  • MySQL version: 5.1.47
  • PHP version: 5.3.5
Re: Severely broken
January 26, 2012, 12:36:14 pm
Thanks, Hershel. That was it. I created a dummy contact id=1 and then was able to get into Civi to clean it up.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Severely broken

This forum was archived on 2017-11-26.