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) »
  • HELP!! A non-recoverable error has occurred. DB Error: constraint violation
Pages: [1]

Author Topic: HELP!! A non-recoverable error has occurred. DB Error: constraint violation  (Read 2114 times)

dcolumbus

  • Guest
HELP!! A non-recoverable error has occurred. DB Error: constraint violation
April 28, 2010, 05:56:44 pm
I had to reinstall the CiviCRM plugin into the Drupal database because having it in it's own DB caused problems... and now when I try to access Views, I get this error:

Code: [Select]
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 ( 102 ,  2 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`dcolumbus_libertydrupal/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 ( 102 ,  2 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`dcolumbus_libertydrupal/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 ( 102 ,  2 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`dcolumbus_libertydrupal/civicrm_acl_cache`, CONSTRAINT `FK_civicrm_acl_cache_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]"]
)
[/code]

dcolumbus

  • Guest
Re: HELP!! A non-recoverable error has occurred. DB Error: constraint violation
April 28, 2010, 07:51:51 pm
Fixed. I just uninstalled everything and reinstalled CiviCRM within the Drupal database... works great now!

petienne

  • Guest
Re: HELP!! A non-recoverable error has occurred. DB Error: constraint violation
May 17, 2010, 10:40:49 am
Hi,

I am having exactly the same problem. Uninstalling and reinstalling on a separate database does not fix it. Did you come across any other fixes that don't involve merging the databases?

Kindly,
Paul

Alan

  • I’m new here
  • *
  • Posts: 1
  • Karma: 0
Re: HELP!! A non-recoverable error has occurred. DB Error: constraint violation
May 19, 2010, 07:55:59 am
Also saw this this morning as I've been road-testing CiviCRM (for a potentially load-testing nightmare multisite installation!).  It seems I managed to get to a state after installation where the civicrm_contacts table was completely empty and that seems to be causing the problem. 

I tried various things with creating a dummy record in civicrm_contact, with interesting results, but things ultimately seemed to fix themselves when I logged out and then back in.

Piotr Szotkowski

  • Moderator
  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: HELP!! A non-recoverable error has occurred. DB Error: constraint violation
May 20, 2010, 04:08:10 am
Quote from: Alan on May 19, 2010, 07:55:59 am
I tried various things with creating a dummy record in civicrm_contact, with interesting results, but things ultimately seemed to fix themselves when I logged out and then back in.

This problem usually means that the currently logged-in user somehow lost ‘their’ contact. If the above (log out and back in) doesn’t fix the issue let us know.
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • HELP!! A non-recoverable error has occurred. DB Error: constraint violation

This forum was archived on 2017-11-26.