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) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 3.2 Release Testing »
  • upgrade issues
Pages: [1]

Author Topic: upgrade issues  (Read 2423 times)

kmarkley

  • I post frequently
  • ***
  • Posts: 178
  • Karma: 14
  • CiviCRM version: 4.4.3
  • CMS version: Drupal 7.24
  • MySQL version: 5.1.56
  • PHP version: 5.3.27
upgrade issues
July 12, 2010, 08:10:25 pm
Hello.  I'm having some difficulties installing 3.2b3 on my test server.

When I run the upgrade script, i get this db error:
Code: [Select]
Sorry. A non-recoverable error has occurred.
DB Error: a515ac9c2796ca0e23adbe92c68fc9fc

Database Error Code: Duplicate column name 'participant_count', 1060

Return to home page.

Error Details:

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

    [c0de] => a515ac9c2796ca0e23adbe92c68fc9fc
    [message] => DB Error: a515ac9c2796ca0e23adbe92c68fc9fc
    [mode] => 16
    [debug_info] => ALTER TABLE civicrm_line_item
   ADD `participant_count` int(10) unsigned default NULL COMMENT 'Number of Participants Per field.' [nativecode=1060 ** Duplicate column name 'participant_count']
    [type] => DB_Error
    [user_info] => ALTER TABLE civicrm_line_item
   ADD `participant_count` int(10) unsigned default NULL COMMENT 'Number of Participants Per field.' [nativecode=1060 ** Duplicate column name 'participant_count']
    [to_string] => [db_error: message="DB Error: a515ac9c2796ca0e23adbe92c68fc9fc" code=0 mode=callback callback=CRM_Core_Error::handle prefix="" info="ALTER TABLE civicrm_line_item
   ADD `participant_count` int(10) unsigned default NULL COMMENT 'Number of Participants Per field.' [nativecode=1060 ** Duplicate column name 'participant_count']"]
)
I have been running with the code for CRM-5724 and this is obviously related to that.  I have a lot of data in civicrm_line_item, is there a way I can preserve that data on upgrade?

Just for the purpose of getting 3.2 up and running, I dropped the column from my database and tried the upgrade again.  This time I get this error:
Code: [Select]
Sorry. A non-recoverable error has occurred.
DB Error: a515ac9c2796ca0e23adbe92c68fc9fc

Database Error Code: Error on rename of './catastrophic_crm/civicrm_entity_tag' to './catastrophic_crm/#sql2-74d8-16c' (errno: 152), 1025

Return to home page.

Error Details:

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

    [c0de] => a515ac9c2796ca0e23adbe92c68fc9fc
    [message] => DB Error: a515ac9c2796ca0e23adbe92c68fc9fc
    [mode] => 16
    [debug_info] => ALTER TABLE civicrm_entity_tag
    ADD entity_table varchar(64) NULL DEFAULT NULL COMMENT 'physical tablename for entity being joined to file, e.g. civicrm_contact' AFTER id,
    DROP FOREIGN KEY FK_civicrm_entity_tag_contact_id,
    DROP INDEX UI_contact_id_tag_id, CHANGE contact_id entity_id int unsigned NOT NULL COMMENT 'FK to entity table specified in entity_table column.',
    ADD INDEX index_entity (entity_table, entity_id) [nativecode=1025 ** Error on rename of './catastrophic_crm/civicrm_entity_tag' to './catastrophic_crm/#sql2-74d8-16c' (errno: 152)]
    [type] => DB_Error
    [user_info] => ALTER TABLE civicrm_entity_tag
    ADD entity_table varchar(64) NULL DEFAULT NULL COMMENT 'physical tablename for entity being joined to file, e.g. civicrm_contact' AFTER id,
    DROP FOREIGN KEY FK_civicrm_entity_tag_contact_id,
    DROP INDEX UI_contact_id_tag_id, CHANGE contact_id entity_id int unsigned NOT NULL COMMENT 'FK to entity table specified in entity_table column.',
    ADD INDEX index_entity (entity_table, entity_id) [nativecode=1025 ** Error on rename of './catastrophic_crm/civicrm_entity_tag' to './catastrophic_crm/#sql2-74d8-16c' (errno: 152)]
    [to_string] => [db_error: message="DB Error: a515ac9c2796ca0e23adbe92c68fc9fc" code=0 mode=callback callback=CRM_Core_Error::handle prefix="" info="ALTER TABLE civicrm_entity_tag
    ADD entity_table varchar(64) NULL DEFAULT NULL COMMENT 'physical tablename for entity being joined to file, e.g. civicrm_contact' AFTER id,
    DROP FOREIGN KEY FK_civicrm_entity_tag_contact_id,
    DROP INDEX UI_contact_id_tag_id, CHANGE contact_id entity_id int unsigned NOT NULL COMMENT 'FK to entity table specified in entity_table column.',
    ADD INDEX index_entity (entity_table, entity_id) [nativecode=1025 ** Error on rename of './catastrophic_crm/civicrm_entity_tag' to './catastrophic_crm/#sql2-74d8-16c' (errno: 152)]"]
)
Which frankly baffles me. 

Any suggestions?

Thanks.

Rahul Bile

  • I post occasionally
  • **
  • Posts: 112
  • Karma: 16
  • impossible says, I M Possible
    • I AM POSSIBLE
Re: upgrade issues
July 12, 2010, 11:39:23 pm
Hello kmarkley ,

As you already have the changes of CRM-5724 , you are getting the below error.

Code:

 
Code: [Select]
Sorry. A non-recoverable error has occurred.
DB Error: a515ac9c2796ca0e23adbe92c68fc9fc

Database Error Code: Duplicate column name 'participant_count', 1060


I suggest you to go through the below way which will help you to upgrade successfully and also preserve your existing event participants data.

Steps:

Step 1.   As you already have changes of CRM-5724, before upgrading to 3.2b3, make the below change in
CRM/Upgrade/Incremental/sql/3.1.alpha1.mysql.tpl

Code: [Select]
Index: CRM/Upgrade/Incremental/sql/3.2.alpha1.mysql.tpl
===================================================================
--- CRM/Upgrade/Incremental/sql/3.2.alpha1.mysql.tpl (revision 28676)
+++ CRM/Upgrade/Incremental/sql/3.2.alpha1.mysql.tpl (working copy)
@@ -80,12 +80,12 @@
 
 -- CRM-5724
 
-   ALTER TABLE civicrm_price_field
-   ADD `count` int(10) unsigned default NULL COMMENT 'Participant count for field.';
+--   ALTER TABLE civicrm_price_field
+--   ADD `count` int(10) unsigned default NULL COMMENT 'Participant count for field.';
+    ALTER TABLE `civicrm_price_field` CHANGE `participants` `count` INT( 11 ) NOT NULL COMMENT 'Participant count for field.';
+--   ALTER TABLE civicrm_line_item
+--   ADD `participant_count` int(10) unsigned default NULL COMMENT 'Number of Participants Per field.';
 
-   ALTER TABLE civicrm_line_item
-   ADD `participant_count` int(10) unsigned default NULL COMMENT 'Number of Participants Per field.';
-  
 -- CRM-5970
 -- civicrm_entity_financial_trxn
    CREATE TABLE `civicrm_entity_financial_trxn` (

In this we are commenting the database change, which already exists in your database while upgrade. Also in CiviCRM3.2, the column name 'count' (in table 'civicrm_price_field' ) is used to store the number of participants count, in your database it may be different ( i.e participants ), so we are altering the column name also.

Step 2.  Also you may not need custom_php , custom_templates files related to CRM-5724 in your installations.

Step 3. Custom Report related changes are not included in CRM-5724 , so you may need to keep those in custom_php and custom_templates.

Step 4. Also do change the column name 'participants' to 'count' (if used in query somewhere) in custom_php and custom_templates files for custom report changes.

Quote
Just for the purpose of getting 3.2 up and running, I dropped the column from my database and tried the upgrade again.  This time I get this error:
In this way you can upgrade to 3.2beta3 without dropping the existing column.  :)
Hope this helps you.

Rahul.
« Last Edit: July 12, 2010, 11:53:00 pm by rahulbile »
Consider donating to CiviCRM if you use it. http://civicrm.org/donate

kmarkley

  • I post frequently
  • ***
  • Posts: 178
  • Karma: 14
  • CiviCRM version: 4.4.3
  • CMS version: Drupal 7.24
  • MySQL version: 5.1.56
  • PHP version: 5.3.27
Re: upgrade issues
July 13, 2010, 06:55:29 am
Thank you very much. 

The patch got me past the first error (on civicrm_line_item), but the upgrade script is still getting hung up on the second error I reported (on civicrm_entity_tag), which I imagine to be unrelated to the whole participant count thing.  Any further help would be appreciated.

Rahul Bile

  • I post occasionally
  • **
  • Posts: 112
  • Karma: 16
  • impossible says, I M Possible
    • I AM POSSIBLE
Re: upgrade issues
July 13, 2010, 10:46:49 pm
May be your database is missing Foreign Key Constraints in the table civicrm_entity_tag. One of the reason could be change of storage engine (probably from MyISAM to InnoDB).

Try correcting the schema by following the steps documented here - http://wiki.civicrm.org/confluence/display/CRMDOC/Ensuring+Schema+Integrity+on+Upgrades and then go for upgrade.


Rahul.
Consider donating to CiviCRM if you use it. http://civicrm.org/donate

kmarkley

  • I post frequently
  • ***
  • Posts: 178
  • Karma: 14
  • CiviCRM version: 4.4.3
  • CMS version: Drupal 7.24
  • MySQL version: 5.1.56
  • PHP version: 5.3.27
Re: upgrade issues
July 14, 2010, 12:13:12 pm
Thank you again.  That didn't quite do it for me (I also needed to separately preserve the participant count data in civicrm_line_item and civicrm_price_field), but it did provide the guidance I needed to figure the rest out myself.  The (patched) 3.2 upgrade script completed successfully. 

I have a new problem that may or may not be related.  I get a SQL error whenever I try to access the contribution tab on a contact who has soft credits.  I am NOT able to reproduce the problem on the sandbox, so I suspect I may still have something wrong in my DB.  Any pointers would be appreciated.

Here is the error:
Code: [Select]
Sorry. A non-recoverable error has occurred.
DB Error: a515ac9c2796ca0e23adbe92c68fc9fc

Database Error Code: Column 'currency' in field list is ambiguous, 1052

Return to home page.

Error Details:

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

    [c0de] => a515ac9c2796ca0e23adbe92c68fc9fc
    [message] => DB Error: a515ac9c2796ca0e23adbe92c68fc9fc
    [mode] => 16
    [debug_info] => SELECT SUM(amount) as amount,
                         AVG(total_amount) as average,
                         currency
                  FROM civicrm_contribution_soft  ccs
                       LEFT JOIN civicrm_contribution cc
                              ON ccs.contribution_id = cc.id
                  WHERE cc.is_test = 0 AND
                        ccs.contact_id = 817
                  GROUP BY currency  [nativecode=1052 ** Column 'currency' in field list is ambiguous]
    [type] => DB_Error
    [user_info] => SELECT SUM(amount) as amount,
                         AVG(total_amount) as average,
                         currency
                  FROM civicrm_contribution_soft  ccs
                       LEFT JOIN civicrm_contribution cc
                              ON ccs.contribution_id = cc.id
                  WHERE cc.is_test = 0 AND
                        ccs.contact_id = 817
                  GROUP BY currency  [nativecode=1052 ** Column 'currency' in field list is ambiguous]
    [to_string] => [db_error: message="DB Error: a515ac9c2796ca0e23adbe92c68fc9fc" code=0 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT SUM(amount) as amount,
                         AVG(total_amount) as average,
                         currency
                  FROM civicrm_contribution_soft  ccs
                       LEFT JOIN civicrm_contribution cc
                              ON ccs.contribution_id = cc.id
                  WHERE cc.is_test = 0 AND
                        ccs.contact_id = 817
                  GROUP BY currency  [nativecode=1052 ** Column 'currency' in field list is ambiguous]"]
)

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: upgrade issues
July 14, 2010, 12:29:44 pm
Quote
I have a new problem that may or may not be related.  I get a SQL error whenever I try to access the contribution tab on a contact who has soft credits.  I am NOT able to reproduce the problem on the sandbox, so I suspect I may still have something wrong in my DB.

I think this problem is already fixed and will be part of next beta. You can get the fix from: http://fisheye2.atlassian.com/changelog/CiviCRM?cs=28651

Kurund
Found this reply helpful? Support CiviCRM

kmarkley

  • I post frequently
  • ***
  • Posts: 178
  • Karma: 14
  • CiviCRM version: 4.4.3
  • CMS version: Drupal 7.24
  • MySQL version: 5.1.56
  • PHP version: 5.3.27
Re: upgrade issues
July 14, 2010, 12:41:59 pm
Great, thanks.  Working fine now.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 3.2 Release Testing »
  • upgrade issues

This forum was archived on 2017-11-26.