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 on upgrade from 4.08 to 4.10
Pages: [1]

Author Topic: Error on upgrade from 4.08 to 4.10  (Read 775 times)

williamgurumayum

  • I’m new here
  • *
  • Posts: 25
  • Karma: 0
  • CiviCRM version: 4.1.5.
  • CMS version: Joomla 2.5.6
  • MySQL version: 5.0.95
  • PHP version: 5.3
Error on upgrade from 4.08 to 4.10
December 06, 2012, 09:08:26 am
Hello,
I upgraded my Joomla version and then did an upgrade of Civi. I am able to upgrade till 4.08 . If i tried upgrading to a next higher version say 4.10, i got a database error as
Code: [Select]
Sorry. A non-recoverable error has occurred.
DB Error: unknown error
Error Details
Database Error Code: Error on rename of './db_name/civicrm_pcp_block' to './db_name/#sql2-768-3c4f6' (errno: 152), 1025
Additional Details:

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

    [code] => -1
    [message] => DB Error: unknown error
    [mode] => 16
    [debug_info] => ALTER TABLE civicrm_pcp_block
      DROP FOREIGN KEY FK_civicrm_pcp_block_entity_id,
      DROP INDEX FK_civicrm_pcp_block_entity_id [nativecode=1025 ** Error on rename of './db_name/civicrm_pcp_block' to './db_name/#sql2-768-3c4f6' (errno: 152)]
    [type] => DB_Error
    [user_info] => ALTER TABLE civicrm_pcp_block
      DROP FOREIGN KEY FK_civicrm_pcp_block_entity_id,
      DROP INDEX FK_civicrm_pcp_block_entity_id [nativecode=1025 ** Error on rename of './db_name/civicrm_pcp_block' to './db_name/#sql2-768-3c4f6' (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_pcp_block
      DROP FOREIGN KEY FK_civicrm_pcp_block_entity_id,
      DROP INDEX FK_civicrm_pcp_block_entity_id [nativecode=1025 ** Error on rename of './db_name/civicrm_pcp_block' to './db_name/#sql2-768-3c4f6' (errno: 152)]"]
)

Can anyone please guide me why am i getting this error? Please help..

Thanks!

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Error on upgrade from 4.08 to 4.10
December 06, 2012, 12:06:08 pm
I can't be sure, but I may be able to help. If you look very carefully at the SQL it's trying to run:

Code: [Select]
ALTER TABLE civicrm_pcp_block
      DROP FOREIGN KEY FK_civicrm_pcp_block_entity_id,
      DROP INDEX FK_civicrm_pcp_block_entity_id

it's trying to drop the FOREIGN KEY called FK_civicrm_pcp_block_entity_id and the INDEX called FK_civicrm_pcp_block_entity_id from the table civicrm_pcp_block.

What I would suggest is you examine this table in phpMyAdmin and examine the indexes and see if FK_civicrm_pcp_block_entity_id is indeed a FOREIGN KEY and FK_civicrm_pcp_block_entity_id from is an INDEX. Because maybe both are an INDEX or both are a FOREIGN KEY. I have seen such an issue before.

If that's it, we can fix it.
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.

williamgurumayum

  • I’m new here
  • *
  • Posts: 25
  • Karma: 0
  • CiviCRM version: 4.1.5.
  • CMS version: Joomla 2.5.6
  • MySQL version: 5.0.95
  • PHP version: 5.3
Re: Error on upgrade from 4.08 to 4.10
December 06, 2012, 01:53:33 pm
I followed this
http://forum.civicrm.org/index.php?topic=23920.0
and it worked out.. but will it have any trouble in future?
What i did was commented all the commands that has this
     ALTER TABLE civicrm_pcp_block
      DROP FOREIGN KEY FK_civicrm_pcp_block_entity_id,
      DROP INDEX FK_civicrm_pcp_block_entity_id   
in
CRM/Upgrade/Incremental/sql/4.1.alpha1.mysql.tpl
CRM/Upgrade/Incremental/sql/4.1.0.mysql.tpl:     

So Basically, i am now in 4.1, without any hiccups. I am concerned if i will have any problem in the future, maybe on my next upgrade to 4.2.

Thanks a lot/.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Error on upgrade from 4.08 to 4.10
December 08, 2012, 12:24:52 pm
Hi. What I wrote in that other thread was that you should drop those indexes manually.

To comment them out in the code and run the upgrade is correct and I think it's valid and I have done this to sites myself and I don't think it will cause any problems in the future.

However, you definitely should drop those two indexes manually.
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.

williamgurumayum

  • I’m new here
  • *
  • Posts: 25
  • Karma: 0
  • CiviCRM version: 4.1.5.
  • CMS version: Joomla 2.5.6
  • MySQL version: 5.0.95
  • PHP version: 5.3
Re: Error on upgrade from 4.08 to 4.10
December 08, 2012, 10:59:24 pm
Hello Hershel,
Thanks for the reply. Yes i removed the indexes manually from the two tables and then commented out in the code.. It did upgrade to 4.1.0 without any prob. All is working good. Thanks for that/.. :)

But now i am facing a new problem, seems like i am stuck in 4.1.6. I cannot seem to upgarde to 4.2 as i am getting some kind of DB error. Below is the error
Code: [Select]
Database Error Code: Unknown column 'civicrm_batch.title' in 'field list', 1054
Additional Details:

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

    [code] => -19
    [message] => DB Error: no such field
    [mode] => 16
    [debug_info] => SELECT  civicrm_contribution.id, contact_a.id as contact_id, contact_a.contact_type  as `contact_type`, contact_a.contact_sub_type  as `contact_sub_type`, contact_a.sort_name  as `sort_name`, contact_a.display_name  as `display_name`, civicrm_contribution.id as contribution_id, civicrm_contribution.currency as `currency`, civicrm_contribution.receive_date as `receive_date`, civicrm_contribution.non_deductible_amount as `non_deductible_amount`, civicrm_contribution.total_amount as `total_amount`, civicrm_contribution.fee_amount as `fee_amount`, civicrm_contribution.net_amount as `net_amount`, civicrm_contribution.trxn_id as `trxn_id`, civicrm_contribution.invoice_id as `invoice_id`, civicrm_contribution.cancel_date as `cancel_date`, civicrm_contribution.cancel_reason as `cancel_reason`, civicrm_contribution.receipt_date as `receipt_date`, civicrm_contribution.thankyou_date as `thankyou_date`, civicrm_contribution.source as `contribution_source`, civicrm_contribution.amount_level as `amount_level`, civicrm_contribution.is_test as `is_test`, civicrm_contribution.is_pay_later as `is_pay_later`, contribution_status.value as contribution_status_id, civicrm_contribution.check_number as `check_number`, civicrm_contribution.campaign_id as contribution_campaign_id, civicrm_contribution_type.id as contribution_type_id, civicrm_contribution_type.name as contribution_type, civicrm_contribution_type.accounting_code as `accounting_code`, payment_instrument.id as instrument_id, payment_instrument.label as `payment_instrument`, civicrm_product.id as product_id, civicrm_product.name as `product_name`, civicrm_product.sku as `sku`, civicrm_contribution_product.id as contribution_product_id, civicrm_contribution_product.product_option as `product_option`, civicrm_contribution_product.fulfilled_date as `fulfilled_date`, civicrm_contribution_product.start_date as `contribution_start_date`, civicrm_contribution_product.end_date as `contribution_end_date`, civicrm_contribution.contribution_recur_id as `contribution_recur_id`, civicrm_note.note as contribution_note, civicrm_batch.title as contribution_batch, contribution_status.label as contribution_status, payment_instrument.name as contribution_payment_instrument, civicrm_contribution.check_number as contribution_check_number  FROM civicrm_contact contact_a LEFT JOIN civicrm_contribution ON civicrm_contribution.contact_id = contact_a.id  INNER JOIN civicrm_contribution_type ON civicrm_contribution.contribution_type_id = civicrm_contribution_type.id  LEFT  JOIN civicrm_contribution_product ON civicrm_contribution_product.contribution_id = civicrm_contribution.id LEFT  JOIN civicrm_product ON civicrm_contribution_product.product_id =civicrm_product.id  LEFT JOIN civicrm_entity_batch ON ( civicrm_entity_batch.entity_table = 'civicrm_contribution' AND
          civicrm_contribution.id = civicrm_entity_batch.entity_id ) LEFT JOIN civicrm_batch ON civicrm_entity_batch.batch_id = civicrm_batch.id LEFT JOIN civicrm_note ON ( civicrm_note.entity_table = 'civicrm_contribution' AND
                                                    civicrm_contribution.id = civicrm_note.entity_id ) LEFT JOIN civicrm_option_group option_group_payment_instrument ON ( option_group_payment_instrument.name = 'payment_instrument') LEFT JOIN civicrm_option_value payment_instrument ON (civicrm_contribution.payment_instrument_id = payment_instrument.value
                               AND option_group_payment_instrument.id = payment_instrument.option_group_id )  LEFT JOIN civicrm_option_group option_group_contribution_status ON (option_group_contribution_status.name = 'contribution_status') LEFT JOIN civicrm_option_value contribution_status ON (civicrm_contribution.contribution_status_id = contribution_status.value
                               AND option_group_contribution_status.id = contribution_status.option_group_id )  WHERE  ( civicrm_contribution.is_test = 0 )  AND (contact_a.is_deleted = 0)   GROUP BY civicrm_contribution.id   ORDER BY receive_date desc, contact_a.id  LIMIT 0, 10  [nativecode=1054 ** Unknown column 'civicrm_batch.title' in 'field list']
    [type] => DB_Error
    [user_info] => SELECT  civicrm_contribution.id, contact_a.id as contact_id, contact_a.contact_type  as `contact_type`, contact_a.contact_sub_type  as `contact_sub_type`, contact_a.sort_name  as `sort_name`, contact_a.display_name  as `display_name`, civicrm_contribution.id as contribution_id, civicrm_contribution.currency as `currency`, civicrm_contribution.receive_date as `receive_date`, civicrm_contribution.non_deductible_amount as `non_deductible_amount`, civicrm_contribution.total_amount as `total_amount`, civicrm_contribution.fee_amount as `fee_amount`, civicrm_contribution.net_amount as `net_amount`, civicrm_contribution.trxn_id as `trxn_id`, civicrm_contribution.invoice_id as `invoice_id`, civicrm_contribution.cancel_date as `cancel_date`, civicrm_contribution.cancel_reason as `cancel_reason`, civicrm_contribution.receipt_date as `receipt_date`, civicrm_contribution.thankyou_date as `thankyou_date`, civicrm_contribution.source as `contribution_source`, civicrm_contribution.amount_level as `amount_level`, civicrm_contribution.is_test as `is_test`, civicrm_contribution.is_pay_later as `is_pay_later`, contribution_status.value as contribution_status_id, civicrm_contribution.check_number as `check_number`, civicrm_contribution.campaign_id as contribution_campaign_id, civicrm_contribution_type.id as contribution_type_id, civicrm_contribution_type.name as contribution_type, civicrm_contribution_type.accounting_code as `accounting_code`, payment_instrument.id as instrument_id, payment_instrument.label as `payment_instrument`, civicrm_product.id as product_id, civicrm_product.name as `product_name`, civicrm_product.sku as `sku`, civicrm_contribution_product.id as contribution_product_id, civicrm_contribution_product.product_option as `product_option`, civicrm_contribution_product.fulfilled_date as `fulfilled_date`, civicrm_contribution_product.start_date as `contribution_start_date`, civicrm_contribution_product.end_date as `contribution_end_date`, civicrm_contribution.contribution_recur_id as `contribution_recur_id`, civicrm_note.note as contribution_note, civicrm_batch.title as contribution_batch, contribution_status.label as contribution_status, payment_instrument.name as contribution_payment_instrument, civicrm_contribution.check_number as contribution_check_number  FROM civicrm_contact contact_a LEFT JOIN civicrm_contribution ON civicrm_contribution.contact_id = contact_a.id  INNER JOIN civicrm_contribution_type ON civicrm_contribution.contribution_type_id = civicrm_contribution_type.id  LEFT  JOIN civicrm_contribution_product ON civicrm_contribution_product.contribution_id = civicrm_contribution.id LEFT  JOIN civicrm_product ON civicrm_contribution_product.product_id =civicrm_product.id  LEFT JOIN civicrm_entity_batch ON ( civicrm_entity_batch.entity_table = 'civicrm_contribution' AND
          civicrm_contribution.id = civicrm_entity_batch.entity_id ) LEFT JOIN civicrm_batch ON civicrm_entity_batch.batch_id = civicrm_batch.id LEFT JOIN civicrm_note ON ( civicrm_note.entity_table = 'civicrm_contribution' AND
                                                    civicrm_contribution.id = civicrm_note.entity_id ) LEFT JOIN civicrm_option_group option_group_payment_instrument ON ( option_group_payment_instrument.name = 'payment_instrument') LEFT JOIN civicrm_option_value payment_instrument ON (civicrm_contribution.payment_instrument_id = payment_instrument.value
                               AND option_group_payment_instrument.id = payment_instrument.option_group_id )  LEFT JOIN civicrm_option_group option_group_contribution_status ON (option_group_contribution_status.name = 'contribution_status') LEFT JOIN civicrm_option_value contribution_status ON (civicrm_contribution.contribution_status_id = contribution_status.value
                               AND option_group_contribution_status.id = contribution_status.option_group_id )  WHERE  ( civicrm_contribution.is_test = 0 )  AND (contact_a.is_deleted = 0)   GROUP BY civicrm_contribution.id   ORDER BY receive_date desc, contact_a.id  LIMIT 0, 10  [nativecode=1054 ** Unknown column 'civicrm_batch.title' in 'field list']
    [to_string] => [db_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT  civicrm_contribution.id, contact_a.id as contact_id, contact_a.contact_type  as `contact_type`, contact_a.contact_sub_type  as `contact_sub_type`, contact_a.sort_name  as `sort_name`, contact_a.display_name  as `display_name`, civicrm_contribution.id as contribution_id, civicrm_contribution.currency as `currency`, civicrm_contribution.receive_date as `receive_date`, civicrm_contribution.non_deductible_amount as `non_deductible_amount`, civicrm_contribution.total_amount as `total_amount`, civicrm_contribution.fee_amount as `fee_amount`, civicrm_contribution.net_amount as `net_amount`, civicrm_contribution.trxn_id as `trxn_id`, civicrm_contribution.invoice_id as `invoice_id`, civicrm_contribution.cancel_date as `cancel_date`, civicrm_contribution.cancel_reason as `cancel_reason`, civicrm_contribution.receipt_date as `receipt_date`, civicrm_contribution.thankyou_date as `thankyou_date`, civicrm_contribution.source as `contribution_source`, civicrm_contribution.amount_level as `amount_level`, civicrm_contribution.is_test as `is_test`, civicrm_contribution.is_pay_later as `is_pay_later`, contribution_status.value as contribution_status_id, civicrm_contribution.check_number as `check_number`, civicrm_contribution.campaign_id as contribution_campaign_id, civicrm_contribution_type.id as contribution_type_id, civicrm_contribution_type.name as contribution_type, civicrm_contribution_type.accounting_code as `accounting_code`, payment_instrument.id as instrument_id, payment_instrument.label as `payment_instrument`, civicrm_product.id as product_id, civicrm_product.name as `product_name`, civicrm_product.sku as `sku`, civicrm_contribution_product.id as contribution_product_id, civicrm_contribution_product.product_option as `product_option`, civicrm_contribution_product.fulfilled_date as `fulfilled_date`, civicrm_contribution_product.start_date as `contribution_start_date`, civicrm_contribution_product.end_date as `contribution_end_date`, civicrm_contribution.contribution_recur_id as `contribution_recur_id`, civicrm_note.note as contribution_note, civicrm_batch.title as contribution_batch, contribution_status.label as contribution_status, payment_instrument.name as contribution_payment_instrument, civicrm_contribution.check_number as contribution_check_number  FROM civicrm_contact contact_a LEFT JOIN civicrm_contribution ON civicrm_contribution.contact_id = contact_a.id  INNER JOIN civicrm_contribution_type ON civicrm_contribution.contribution_type_id = civicrm_contribution_type.id  LEFT  JOIN civicrm_contribution_product ON civicrm_contribution_product.contribution_id = civicrm_contribution.id LEFT  JOIN civicrm_product ON civicrm_contribution_product.product_id =civicrm_product.id  LEFT JOIN civicrm_entity_batch ON ( civicrm_entity_batch.entity_table = 'civicrm_contribution' AND
          civicrm_contribution.id = civicrm_entity_batch.entity_id ) LEFT JOIN civicrm_batch ON civicrm_entity_batch.batch_id = civicrm_batch.id LEFT JOIN civicrm_note ON ( civicrm_note.entity_table = 'civicrm_contribution' AND
                                                    civicrm_contribution.id = civicrm_note.entity_id ) LEFT JOIN civicrm_option_group option_group_payment_instrument ON ( option_group_payment_instrument.name = 'payment_instrument') LEFT JOIN civicrm_option_value payment_instrument ON (civicrm_contribution.payment_instrument_id = payment_instrument.value
                               AND option_group_payment_instrument.id = payment_instrument.option_group_id )  LEFT JOIN civicrm_option_group option_group_contribution_status ON (option_group_contribution_status.name = 'contribution_status') LEFT JOIN civicrm_option_value contribution_status ON (civicrm_contribution.contribution_status_id = contribution_status.value
                               AND option_group_contribution_status.id = contribution_status.option_group_id )  WHERE  ( civicrm_contribution.is_test = 0 )  AND (contact_a.is_deleted = 0)   GROUP BY civicrm_contribution.id   ORDER BY receive_date desc, contact_a.id  LIMIT 0, 10  [nativecode=1054 ** Unknown column 'civicrm_batch.title' in 'field list']"]
)

This error appears when i am upgrading to 4.2. I cannot figure out why this is happening so?

Thanks for your help

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Error on upgrade from 4.08 to 4.10
December 09, 2012, 03:17:34 am
This error I do not know exactly what causes it. No one has ever reported before, AFAIK, Unknown column 'civicrm_batch.title'. It's hard to search for this also because title is a very common word.

All I might suggest is that you make a fresh install of 4.1 in a spare DB and find that field and add it to your 4.1 schema.
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.

williamgurumayum

  • I’m new here
  • *
  • Posts: 25
  • Karma: 0
  • CiviCRM version: 4.1.5.
  • CMS version: Joomla 2.5.6
  • MySQL version: 5.0.95
  • PHP version: 5.3
Re: Error on upgrade from 4.08 to 4.10
December 09, 2012, 04:51:58 am
ok i will do that and will update..

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Error on upgrade from 4.08 to 4.10

This forum was archived on 2017-11-26.