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) »
  • I get an error when trying to sync my users with Drupal.
Pages: [1]

Author Topic: I get an error when trying to sync my users with Drupal.  (Read 4501 times)

xamox

  • Guest
I get an error when trying to sync my users with Drupal.
May 01, 2007, 08:50:03 am
I am using drupal v5.1.  I am trying sync my users and get the following 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_contact (domain_id , contact_type , sort_name , display_name , hash ) VALUES ( 0 , 'Individual' , 'email@proxous.com' , 'email@proxous.com' , 'ad721e4a12c208a678a9fe7e8f02fb98' )  [nativecode=1216 ** Cannot add or update a child row: a foreign key constraint fails]
    [type] => DB_Error
    [user_info] => INSERT INTO civicrm_contact (domain_id , contact_type , sort_name , display_name , hash ) VALUES ( 0 , 'Individual' , 'email@proxous.com' , 'email@proxous.com' , 'ad721e4a12c208a678a9fe7e8f02fb98' )  [nativecode=1216 ** Cannot add or update a child row: a foreign key constraint fails]
    [to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_contact (domain_id , contact_type , sort_name , display_name , hash ) VALUES ( 0 , 'Individual' , 'email@proxous.com' , 'email@proxous.com' , 'ad721e4a12c208a678a9fe7e8f02fb98' )  [nativecode=1216 ** Cannot add or update a child row: a foreign key constraint fails]"]
)


Any help would be appreciated.[/code]

Michał Mach

  • Ask me questions
  • ****
  • Posts: 748
  • Karma: 59
    • CiviCRM site
  • CiviCRM version: latest
  • CMS version: Drupal and Joomla latest
  • MySQL version: numerous
  • PHP version: 5.3 and 5.2
Re: I get an error when trying to sync my users with Drupal.
May 01, 2007, 09:02:51 am
Which version of CiviCRM and which version of mysql are you using?

Can you verify if you don't have contacts with the same email address set in your Drupal database and CiviCRM database? I'm not sure if this is the problem in your case, but would be good to eliminate such possibility.

michau
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

My absolute favourite: Wordpress Integration!.

Donate Now!

xamox

  • Guest
Re: I get an error when trying to sync my users with Drupal.
May 01, 2007, 09:10:40 am
CiviCRM -> 1.7.beta.9327
MySQL ->  4.1.21

I only have one user in my database at the moment, which is just the administrator.

When I try to create a new user it says I need to define a Location type. So then I go into admin and try to create one and get the following 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_location_type (domain_id , name , vcard_name , description , is_active , is_default ) VALUES ( 0 , 'House' , '' , '' ,  1 ,  0 )  [nativecode=1216 ** Cannot add or update a child row: a foreign key constraint fails]
    [type] => DB_Error
    [user_info] => INSERT INTO civicrm_location_type (domain_id , name , vcard_name , description , is_active , is_default ) VALUES ( 0 , 'House' , '' , '' ,  1 ,  0 )  [nativecode=1216 ** Cannot add or update a child row: a foreign key constraint fails]
    [to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_location_type (domain_id , name , vcard_name , description , is_active , is_default ) VALUES ( 0 , 'House' , '' , '' ,  1 ,  0 )  [nativecode=1216 ** Cannot add or update a child row: a foreign key constraint fails]"]
)
[/code]

Michał Mach

  • Ask me questions
  • ****
  • Posts: 748
  • Karma: 59
    • CiviCRM site
  • CiviCRM version: latest
  • CMS version: Drupal and Joomla latest
  • MySQL version: numerous
  • PHP version: 5.3 and 5.2
Re: I get an error when trying to sync my users with Drupal.
May 01, 2007, 09:18:58 am
When installing your CiviCRM instance, did you load civicrm_data.mysql into the database? It seems like you're missing some stuff which is provided in this file...

michau
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

My absolute favourite: Wordpress Integration!.

Donate Now!

xamox

  • Guest
Re: I get an error when trying to sync my users with Drupal.
May 01, 2007, 09:34:21 am
Yeah looking at the script and then looking at the DB the data seems to correspond.


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: I get an error when trying to sync my users with Drupal.
May 01, 2007, 10:21:34 am

Can u ensure u have the following line in your civicrm.setttings.php file

/**
 * Multi-site Support
 *
 * CiviCRM uses Domain ID keys to allow you to store separate data sets for multiple sites
 * using the same codebase.
 *
 * Refer to the 'Multi-site Support' section of the Installation Guide for more info.
 */
define('CIVICRM_DOMAIN_ID' , 1 );


In your error above, domain_id is 0 which is an invalid FK, hence the constraint error

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

xamox

  • Guest
Re: I get an error when trying to sync my users with Drupal.
May 01, 2007, 10:33:03 am
That fixed my problem, Thanks!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • I get an error when trying to sync my users with Drupal.

This forum was archived on 2017-11-26.