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) »
  • Upgrading 1.9 to 2.0 - Error in Step 6
Pages: [1]

Author Topic: Upgrading 1.9 to 2.0 - Error in Step 6  (Read 1192 times)

jyotirmaya

  • Guest
Upgrading 1.9 to 2.0 - Error in Step 6
September 01, 2008, 04:25:14 pm
I am upgrading a 1.9 Drupal Database to version 2.0 and get the following error at the time I run step 6 - Miscellaneous Data
Quote
    Sorry. A non-recoverable error has occurred.
    DB Error: unknown error
    Database Error Code: Error on rename of './civicrm/civicrm_entity_tag' to './civicrm/#sql2-54ce-2165339' (errno: 152), 1025
    Return to home page.

Error Details:
Array
(
    [callback] => Array
        (
           
  • => CRM_Core_Error
  • [1] => handle
            )
        (code) => -1
       
[message] => DB Error: unknown error
    [mode] => 16
    [debug_info] => ALTER TABLE `civicrm_entity_tag`
    ADD `contact_id` int(10) unsigned NULL DEFAULT NULL AFTER id,
    DROP FOREIGN KEY `FK_civicrm_entity_tag_tag_id` [nativecode=1025 ** Error on rename of './civicrm/civicrm_entity_tag' to './civicrm/#sql2-54ce-2165339' (errno: 152)]
    [type] => DB_Error
    [user_info] => ALTER TABLE `civicrm_entity_tag`
    ADD `contact_id` int(10) unsigned NULL DEFAULT NULL AFTER id,
    DROP FOREIGN KEY `FK_civicrm_entity_tag_tag_id` [nativecode=1025 ** Error on rename of './civicrm/civicrm_entity_tag' to './civicrm/#sql2-54ce-2165339' (errno: 152)]
    [to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::handle prefix="" info="ALTER TABLE `civicrm_entity_tag`
    ADD `contact_id` int(10) unsigned NULL DEFAULT NULL AFTER id,
    DROP FOREIGN KEY `FK_civicrm_entity_tag_tag_id` [nativecode=1025 ** Error on rename of './civicrm/civicrm_entity_tag' to './civicrm/#sql2-54ce-2165339' (errno: 152)]"]
)

My .._entity_tag table only references contact_ID's that actually exist - have checked this (and no org id's)
I have dropped the table and manually recreated it without the offending FK before step 6 in order to ensure the data and table structure are good - no change.


Please help!
« Last Edit: September 01, 2008, 04:27:55 pm by jyotirmaya »

Deepak Srivastava

  • Moderator
  • Ask me questions
  • *****
  • Posts: 677
  • Karma: 65
Re: Upgrading 1.9 to 2.0 - Error in Step 6
September 01, 2008, 10:30:17 pm
The error could be either due to a different FK constraint-name (not exactly FK_civicrm_entity_tag_tag_id) or the constraint doesn't exist at all.

I would check if the constraint exists, if yes - drop it and recreate the constraint, if not - just recreate:
Code: [Select]
ALTER TABLE `civicrm_entity_tag`
  ADD CONSTRAINT `FK_civicrm_entity_tag_tag_id` FOREIGN KEY (`tag_id`) REFERENCES `civicrm_tag` (`id`) ON DELETE CASCADE;
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

jyotirmaya

  • Guest
Re: Upgrading 1.9 to 2.0 - Error in Step 6
September 03, 2008, 01:50:16 pm
Ok - I dropped the entire table and then recreated without the constraint.
Then I added the constraint using your script
Then The upgrade completed without problem!! (yay)

weird one - something was bizarre with the original constraint, because it wouldn't let me just drop it either. Go figure.

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

This forum was archived on 2017-11-26.