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) »
  • Unable to configure Organization Address and Contact Information
Pages: [1]

Author Topic: Unable to configure Organization Address and Contact Information  (Read 4396 times)

Patricia43

  • I post occasionally
  • **
  • Posts: 50
  • Karma: 1
  • CiviCRM version: 4.0
  • CMS version: Drupal 7
  • MySQL version: 5.1
  • PHP version: 5.3
Unable to configure Organization Address and Contact Information
July 15, 2013, 08:19:12 am
I'm installing CiviCRM 4.3.alpha3 in a Drupal 7.22 website. I'm using a separate database for CiviCRM.
The error appears to be caused by a Foreign Key constraint. I have reinstalled several times and each time I get an error when I attempt to configure the Organization Address and Contact Information. (I've tried dropping the constraint and various other database modifications to no effect.)
Here is the info from the Drupal log

$Fatal Error Details = Array ( [callback] => Array (
  • => CRM_Core_Error [1] => handle )
    Code: [Select]
    => -3 [message] => DB Error: constraint violation [mode] => 16 [debug_info] => INSERT INTO civicrm_log (entity_table , entity_id , data , modified_id , modified_date ) VALUES ('civicrm_contact' , 1 , 'civicrm_contact,1' , 2 , 20130715111055 ) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`zerocarb_climateactnow_civicrm`.`civicrm_log`, CONSTRAINT `FK_civicrm_log_modified_id` FOREIGN KEY (`modified_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)] [type] => DB_Error [user_info] => INSERT INTO civicrm_log (entity_table , entity_id , data , modified_id , modified_date ) VALUES ('civicrm_contact' , 1 , 'civicrm_contact,1' , 2 , 20130715111055 ) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`zerocarb_climateactnow_civicrm`.`civicrm_log`, CONSTRAINT `FK_civicrm_log_modified_id` FOREIGN KEY (`modified_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_log (entity_table , entity_id , data , modified_id , modified_date ) VALUES ('civicrm_contact' , 1 , 'civicrm_contact,1' , 2 , 20130715111055 ) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`zerocarb_climateactnow_civicrm`.`civicrm_log`, CONSTRAINT `FK_civicrm_log_modified_id` FOREIGN KEY (`modified_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]"] )

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Unable to configure Organization Address and Contact Information
July 15, 2013, 08:41:04 am
Delete your database completely and try again.

Also, why are you using 4.3.alpha3? The latest stable version is 4.3.5 -- you should use that.
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.

Patricia43

  • I post occasionally
  • **
  • Posts: 50
  • Karma: 1
  • CiviCRM version: 4.0
  • CMS version: Drupal 7
  • MySQL version: 5.1
  • PHP version: 5.3
Re: Unable to configure Organization Address and Contact Information
July 15, 2013, 08:57:13 am
After I wrote that I realized I did not have the most recent version and am in the process of downloading it now. Thanks.

(p.s. I had deleted the database many times.)

Patricia43

  • I post occasionally
  • **
  • Posts: 50
  • Karma: 1
  • CiviCRM version: 4.0
  • CMS version: Drupal 7
  • MySQL version: 5.1
  • PHP version: 5.3
Re: Unable to configure Organization Address and Contact Information
July 15, 2013, 03:00:33 pm
I downloaded 4.3.5 and installed it ... after dropping all database tables. But it still fails with a similar error - different table this time civicrm_dashboard_contact:
$Fatal Error Details = Array ( [callback] => Array (
  • => CRM_Core_Error [1] => handle )
    Code: [Select]
    => -3 [message] => DB Error: constraint violation [mode] => 16 [debug_info] => INSERT INTO civicrm_dashboard_contact (dashboard_id, contact_id, column_no, is_active) VALUES (1, 2, 1, 1), (2, 2, 0, 0) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`zerocarb_climateactnow_civicrm`.`civicrm_dashboard_contact`, CONSTRAINT `FK_civicrm_dashboard_contact_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASC)] [type] => DB_Error [user_info] => INSERT INTO civicrm_dashboard_contact (dashboard_id, contact_id, column_no, is_active) VALUES (1, 2, 1, 1), (2, 2, 0, 0) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`zerocarb_climateactnow_civicrm`.`civicrm_dashboard_contact`, CONSTRAINT `FK_civicrm_dashboard_contact_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASC)] [to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_dashboard_contact (dashboard_id, contact_id, column_no, is_active) VALUES (1, 2, 1, 1), (2, 2, 0, 0) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`zerocarb_climateactnow_civicrm`.`civicrm_dashboard_contact`, CONSTRAINT `FK_civicrm_dashboard_contact_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASC)]"] )[/li][/list]
    Severity

Patricia43

  • I post occasionally
  • **
  • Posts: 50
  • Karma: 1
  • CiviCRM version: 4.0
  • CMS version: Drupal 7
  • MySQL version: 5.1
  • PHP version: 5.3
Re: Unable to configure Organization Address and Contact Information
July 20, 2013, 08:48:08 am
In case anyone else has this problem, after posting this is an issue, I was advise to logout and login again ... which I rarely do ... and that got rid of the error and I was able to continue configuring the site.

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Unable to configure Organization Address and Contact Information
January 08, 2014, 08:25:01 pm
Patricia - thanks for reporting back, finding this forum thread saved me a lot of frustration!
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

kmitz

  • I post occasionally
  • **
  • Posts: 74
  • Karma: 2
Re: Unable to configure Organization Address and Contact Information
September 20, 2014, 12:28:54 pm
Logging out and back in also worked for me for version 4.5

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Unable to configure Organization Address and Contact Information
November 29, 2014, 06:53:21 pm
This thread saved me again - I ran into an almost identical issue when copying a Civi database from one Wordpress instance to another (not a different copy of the same site, but a different site altogether).
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • Unable to configure Organization Address and Contact Information

This forum was archived on 2017-11-26.