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) »
  • Domain Information: Non-recoverable error: Constraint violation
Pages: [1]

Author Topic: Domain Information: Non-recoverable error: Constraint violation  (Read 1264 times)

Simon147

  • I post occasionally
  • **
  • Posts: 96
  • Karma: 3
  • CiviCRM version: 4.4.6
  • CMS version: Drupal 7.30
  • MySQL version: 5.0.92
  • PHP version: 5.2.9
Domain Information: Non-recoverable error: Constraint violation
November 28, 2010, 06:26:05 am
Hello,

When trying to configure my CiviCRM/Drupal installation, I got the following message when trying to access the Domaine Information:

Code: [Select]
Domain Information
Sorry. A non-recoverable error has occurred.
DB Error: constraint violation
Error Details
Database Error Code: Cannot add or update a child row: a foreign key constraint fails (`asca_civicrm/civicrm_acl_cache`, CONSTRAINT `FK_civicrm_acl_cache_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE), 1452
Additional 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 (`asca_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 (`asca_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 (`asca_civicrm/civicrm_acl_cache`, CONSTRAINT `FK_civicrm_acl_cache_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]"]
)


Being not a MySQL specialst, is there anyone who can help me?

Simon[/code]
« Last Edit: November 28, 2010, 06:44:00 am by Simon147 »

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Domain Information: Non-recoverable error: Constraint violation
November 28, 2010, 07:03:13 am
It would actually appear that you managed to remove the ID #1 Contact from your database. Did you delete anyone? Usually it's not possible to delete that contact.
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.

Simon147

  • I post occasionally
  • **
  • Posts: 96
  • Karma: 3
  • CiviCRM version: 4.4.6
  • CMS version: Drupal 7.30
  • MySQL version: 5.0.92
  • PHP version: 5.2.9
Re: Domain Information: Non-recoverable error: Constraint violation
November 28, 2010, 07:16:30 am
Actually no, I didn't change or delete the ID #1 contact. However, I just realise that if I try to sync the users from my Drupal db with my CiviCRM, I get the following error message

Code: [Select]
Synchronize Users to Contacts
Sorry. A non-recoverable error has occurred.
DB Error: no such table
Error Details
Database Error Code: Table 'asca_drupal.users' doesn't exist, 1146
Additional Details:

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

    [code] => -18
    [message] => DB Error: no such table
    [mode] => 16
    [debug_info] => SELECT uid, mail, name FROM users where mail != '' [nativecode=1146 ** Table 'asca_drupal.users' doesn't exist]
    [type] => DB_Error
    [user_info] => SELECT uid, mail, name FROM users where mail != '' [nativecode=1146 ** Table 'asca_drupal.users' doesn't exist]
    [to_string] => [db_error: message="DB Error: no such table" code=-18 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT uid, mail, name FROM users where mail != '' [nativecode=1146 ** Table 'asca_drupal.users' doesn't exist]"]
)

Return to home page.


Now, the point is that in my Drupal DB I use a prefix. Instead of "asca_drupal.users", my user database table is "asca_drupal.drp_users".

Is there any elegant way to change this? 

Simon
[/code]

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Domain Information: Non-recoverable error: Constraint violation
November 28, 2010, 07:19:08 am
Administer -- Administration Console -- Global Settings -- Drupal Integration Settings

Fill in "Drupal Users Table Name" :)
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.

Simon147

  • I post occasionally
  • **
  • Posts: 96
  • Karma: 3
  • CiviCRM version: 4.4.6
  • CMS version: Drupal 7.30
  • MySQL version: 5.0.92
  • PHP version: 5.2.9
Re: Domain Information: Non-recoverable error: Constraint violation
November 28, 2010, 12:01:40 pm
Perfect. That did the trick. Thanks a lot.

Simon

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Domain Information: Non-recoverable error: Constraint violation
November 28, 2010, 12:02:57 pm
My pleasure.
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.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • Domain Information: Non-recoverable error: Constraint violation

This forum was archived on 2017-11-26.