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) »
  • Error when upgrading to Civi 2.0
Pages: [1]

Author Topic: Error when upgrading to Civi 2.0  (Read 868 times)

denverdataman

  • I post occasionally
  • **
  • Posts: 93
  • Karma: 2
    • Denver DataMan Website
  • CiviCRM version: Several
  • CMS version: Drupal 6/7
Error when upgrading to Civi 2.0
April 26, 2010, 12:17:26 pm
I am getting the following error when I try and upgrade. I have done all the schema imports and checking my data.


Code: [Select]
Error Details:

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

    [code] => -1
    [message] => DB Error: unknown error
    [mode] => 16
    [debug_info] =>
INSERT INTO custom_value_1_Volounteer_Tracking (domain_id,entity_id,_at_Activity_Planning)
SELECT 1, cv.entity_id, cv.int_data FROM civicrm_custom_value cv
WHERE cv.custom_field_id=8
ON DUPLICATE KEY UPDATE _at_Activity_Planning=cv.int_data [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`rainbow_civicrm_fix`.`custom_value_1_Volounteer_Tracking`, CONSTRAINT `FK_custom_value_1_Volounteer_Tracking_entity_id` FOREIGN KEY (`entity_id`) REFERENCES `civicrm_activity` (`id`) ON DELET)]
    [type] => DB_Error
    [user_info] =>
INSERT INTO custom_value_1_Volounteer_Tracking (domain_id,entity_id,_at_Activity_Planning)
SELECT 1, cv.entity_id, cv.int_data FROM civicrm_custom_value cv
WHERE cv.custom_field_id=8
ON DUPLICATE KEY UPDATE _at_Activity_Planning=cv.int_data [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`rainbow_civicrm_fix`.`custom_value_1_Volounteer_Tracking`, CONSTRAINT `FK_custom_value_1_Volounteer_Tracking_entity_id` FOREIGN KEY (`entity_id`) REFERENCES `civicrm_activity` (`id`) ON DELET)]
    [to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::handle prefix="" info="
INSERT INTO custom_value_1_Volounteer_Tracking (domain_id,entity_id,_at_Activity_Planning)
SELECT 1, cv.entity_id, cv.int_data FROM civicrm_custom_value cv
WHERE cv.custom_field_id=8
ON DUPLICATE KEY UPDATE _at_Activity_Planning=cv.int_data [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`rainbow_civicrm_fix`.`custom_value_1_Volounteer_Tracking`, CONSTRAINT `FK_custom_value_1_Volounteer_Tracking_entity_id` FOREIGN KEY (`entity_id`) REFERENCES `civicrm_activity` (`id`) ON DELET)]"]
)


I was running into an error with null values in civicrm_custom_field (http://forum.civicrm.org/index.php?action=profile;u=2048;sa=showPosts) and I gave these 'name' fields names per the instructions.

Any help is greatly appreciated.

Thanks,
Steve [/code]
Steve Kessler
Owner and Lead Consultant of Denver DataMan

Deepak Srivastava

  • Moderator
  • Ask me questions
  • *****
  • Posts: 677
  • Karma: 65
Re: Error when upgrading to Civi 2.0
April 29, 2010, 09:43:52 am
Seems like you have orphan records in your civicrm_custom_value table (pointing to non existing entity_id). You will have to manually remove/clean them before starting with upgrade.

Tools here could help point out all inconsistencies in your database - http://wiki.civicrm.org/confluence/display/CRMDOC/Database+Troubleshooting+Tools.

Note 2.0 is a fairly old version and is no longer actively supported. If you still stuck your best bet might be to hire someone from http://civicrm.org/professional/.
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Error when upgrading to Civi 2.0

This forum was archived on 2017-11-26.