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 »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Can't delete contacts after upgrade to 2.0
Pages: [1]

Author Topic: Can't delete contacts after upgrade to 2.0  (Read 2048 times)

Matt2000

  • I post frequently
  • ***
  • Posts: 288
  • Karma: 27
    • http://www.ninjitsuweb.com
Can't delete contacts after upgrade to 2.0
April 16, 2008, 02:57:30 pm
After upgrading an installation to 2.0 a couple weeks ago, I've just noticed that a contact can not be deleted.

I get the follow error response. Any Help?:

unrecoverable error
    Sorry. A non-recoverable error has occurred.

    Database Error Code: Cannot delete or update a parent row: a foreign key constraint fails (`jhuEconPeopleCiviCRM/civicrm_acl_cache`, CONSTRAINT `FK_civicrm_acl_cache_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`)), 1451

    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] => DELETE FROM civicrm_contact  WHERE (  civicrm_contact.id = 174 )  [nativecode=1451 ** Cannot delete or update a parent row: a foreign key constraint fails (`jhuEconPeopleCiviCRM/civicrm_acl_cache`, CONSTRAINT `FK_civicrm_acl_cache_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`))]
    [type] => DB_Error
    [user_info] => DELETE FROM civicrm_contact  WHERE (  civicrm_contact.id = 174 )  [nativecode=1451 ** Cannot delete or update a parent row: a foreign key constraint fails (`jhuEconPeopleCiviCRM/civicrm_acl_cache`, CONSTRAINT `FK_civicrm_acl_cache_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`))]
    [to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::handle prefix="" info="DELETE FROM civicrm_contact  WHERE (  civicrm_contact.id = 174 )  [nativecode=1451 ** Cannot delete or update a parent row: a foreign key constraint fails (`jhuEconPeopleCiviCRM/civicrm_acl_cache`, CONSTRAINT `FK_civicrm_acl_cache_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`))]"]
)


backTrace

/Applications/MAMP/htdocs/drupal/sites/all/modules/civicrm/CRM/Core/Error.php, backtrace, 148
, handle,
/Applications/MAMP/htdocs/drupal/sites/all/modules/civicrm/packages/PEAR.php, call_user_func, 901
/Applications/MAMP/htdocs/drupal/sites/all/modules/civicrm/packages/DB.php, PEAR_Error, 888
/Applications/MAMP/htdocs/drupal/sites/all/modules/civicrm/packages/PEAR.php, DB_Error, 563
/Applications/MAMP/htdocs/drupal/sites/all/modules/civicrm/packages/DB/common.php, raiseError, 1849
/Applications/MAMP/htdocs/drupal/sites/all/modules/civicrm/packages/DB/mysql.php, raiseError, 894
/Applications/MAMP/htdocs/drupal/sites/all/modules/civicrm/packages/DB/mysql.php, mysqlRaiseError, 324
/Applications/MAMP/htdocs/drupal/sites/all/modules/civicrm/packages/DB/common.php, simpleQuery, 1162
/Applications/MAMP/htdocs/drupal/sites/all/modules/civicrm/packages/DB/DataObject.php, query, 2343
/Applications/MAMP/htdocs/drupal/sites/all/modules/civicrm/packages/DB/DataObject.php, _query, 1394
/Applications/MAMP/htdocs/drupal/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php, delete, 988
/Applications/MAMP/htdocs/drupal/sites/all/modules/civicrm/CRM/Contact/Form/Task/Delete.php, deleteContact, 114
/Applications/MAMP/htdocs/drupal/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Done.php, postProcess, 79
/Applications/MAMP/htdocs/drupal/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php, perform, 195
/Applications/MAMP/htdocs/drupal/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php, handle, 95
/Applications/MAMP/htdocs/drupal/sites/all/modules/civicrm/CRM/Core/Controller.php, handle, 223
/Applications/MAMP/htdocs/drupal/sites/all/modules/civicrm/CRM/Core/Invoke.php, run, 540
/Applications/MAMP/htdocs/drupal/sites/all/modules/civicrm/CRM/Core/Invoke.php, search, 435
/Applications/MAMP/htdocs/drupal/sites/all/modules/civicrm/CRM/Core/Invoke.php, contact, 98
/Applications/MAMP/htdocs/drupal/sites/all/modules/civicrm/drupal/civicrm.module, invoke, 321
, civicrm_invoke,
/Applications/MAMP/htdocs/drupal/includes/menu.inc, call_user_func_array, 418
/Applications/MAMP/htdocs/drupal/index.php, menu_execute_active_handler, 15
Drupal/CiviCRM micro-blogging http://twitter.com/matt2000

Ninjitsu Web Development http://www.NinjitsuWeb.com/

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Can't delete contacts after upgrade to 2.0
April 16, 2008, 10:03:19 pm

can you truncate your acl cache table (civicrm_acl_cache) and try to see if u can reproduce the error again. Being able to replicate it on demo would allow us to track and fix the issue

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Matt2000

  • I post frequently
  • ***
  • Posts: 288
  • Karma: 27
    • http://www.ninjitsuweb.com
Re: Can't delete contacts after upgrade to 2.0
April 16, 2008, 10:28:17 pm
Ah, I should have thought of that. It worked. :-)

Drupal/CiviCRM micro-blogging http://twitter.com/matt2000

Ninjitsu Web Development http://www.NinjitsuWeb.com/

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Can't delete contacts after upgrade to 2.0

This forum was archived on 2017-11-26.