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 While updating from civicrm 4.1.6 to 4.2.x
Pages: [1]

Author Topic: Error While updating from civicrm 4.1.6 to 4.2.x  (Read 2699 times)

shashikant

  • I post occasionally
  • **
  • Posts: 30
  • Karma: 0
  • CiviCRM version: civicrm 4.1.3
  • CMS version: Drupal 6.26
  • MySQL version: Mysql 5.1.56
  • PHP version: PHP Version 5.3.6
Error While updating from civicrm 4.1.6 to 4.2.x
February 18, 2013, 06:14:37 am
Hi
I am trying to upgrade the civicrm from 4.1.6 to 4.2.7
I am using drupal 6.25 and civicrm 4.1.2

I have successfully upgraded the civicrm from 4.1.2 to 4.1.6
For Upgrading civicrm from 4.1.6 to 4.2.x
I am following instruction from http://wiki.civicrm.org/confluence/display/CRMDOC42/Upgrade+Drupal+Sites+to+4.2+-+Drupal+6

But When I tried to upgrade from civicrm 4.1.6 to 4.2.7
I got following error.
I also Checked in DB. Table civicrm_price_field has no entry with id = 17.
After ID =15 it is having enrty ID=18

Code: [Select]
[Error: Upgrade DB to 4.2.alpha1: Price Sets]
Error Field Error Value
Type DB_Error
Code -19
Message DB Error: no such field
Mode 16
UserInfo SELECT title FROM civicrm_price_field where id =17 [nativecode=1054 ** Unknown column 'title' in 'field list']
DebugInfo SELECT title FROM civicrm_price_field where id =17 [nativecode=1054 ** Unknown column 'title' in 'field list']
PEAR_Exception: DB Error: no such field in unknown on line unknown
- DB_Error: DB Error: no such field in unknown on line unknown
Exception trace
# Function Location
0 CRM_Core_Error::exceptionHandler(Object(DB_Error)) unknown:unknown
1 call_user_func(Array, Object(DB_Error)) /var/www/html/testsite/sites/all/modules/civicrm/packages/PEAR.php:931
2 PEAR_Error->PEAR_Error('DB Error: no suc…', -19, 16, Array, 'SELECT title FRO…') /var/www/html/testsite/sites/all/modules/civicrm/packages/DB.php:968
3 DB_Error->DB_Error(-19, 16, Array, 'SELECT title FRO…') /var/www/html/testsite/sites/all/modules/civicrm/packages/PEAR.php:564
4 PEAR->raiseError(null, -19, null, null, 'SELECT title FRO…', 'DB_Error', true) /var/www/html/testsite/sites/all/modules/civicrm/packages/DB/common.php:1903
5 DB_common->raiseError(-19, null, null, null, '1054 ** Unknown …') /var/www/html/testsite/sites/all/modules/civicrm/packages/DB/mysql.php:898
6 DB_mysql->mysqlRaiseError() /var/www/html/testsite/sites/all/modules/civicrm/packages/DB/mysql.php:327
7 DB_mysql->simpleQuery('SELECT title FRO…') /var/www/html/testsite/sites/all/modules/civicrm/packages/DB/common.php:1216
8 DB_common->query('SELECT title FRO…') /var/www/html/testsite/sites/all/modules/civicrm/packages/DB/DataObject.php:2421
9 DB_DataObject->_query('SELECT title FRO…') /var/www/html/testsite/sites/all/modules/civicrm/packages/DB/DataObject.php:1613
10 DB_DataObject->query('SELECT title FRO…') /var/www/html/testsite/sites/all/modules/civicrm/CRM/Core/DAO.php:155
11 CRM_Core_DAO->query('SELECT title FRO…', true) /var/www/html/testsite/sites/all/modules/civicrm/CRM/Core/DAO.php:964
12 CRM_Core_DAO::singleValueQuery('SELECT title FRO…', Array) /var/www/html/testsite/sites/all/modules/civicrm/CRM/Upgrade/Incremental/php/FourTwo.php:364
13 CRM_Upgrade_Incremental_php_FourTwo::createPriceSet(Array, Array, Array) /var/www/html/testsite/sites/all/modules/civicrm/CRM/Upgrade/Incremental/php/FourTwo.php:261
14 CRM_Upgrade_Incremental_php_FourTwo::task_4_2_alpha1_createPriceSets(Object(CRM_Queue_TaskContext), '4.2.alpha1') unknown:unknown
15 call_user_func_array(Array, Array) /var/www/html/testsite/sites/all/modules/civicrm/CRM/Queue/Task.php:79
16 CRM_Queue_Task->run(Object(CRM_Queue_TaskContext)) /var/www/html/testsite/sites/all/modules/civicrm/CRM/Queue/Runner.php:186
17 CRM_Queue_Runner->runNext(true) /var/www/html/testsite/sites/all/modules/civicrm/CRM/Queue/Page/AJAX.php:44
18 {closure}() /var/www/html/testsite/sites/all/modules/civicrm/CRM/Queue/ErrorPolicy.php:80
19 CRM_Queue_ErrorPolicy->call(Object(Closure)) /var/www/html/testsite/sites/all/modules/civicrm/CRM/Queue/Page/AJAX.php:47
20 CRM_Queue_Page_AJAX::runNext(Array) unknown:unknown
21 call_user_func(Array, Array) /var/www/html/testsite/sites/all/modules/civicrm/CRM/Core/Invoke.php:186
22 CRM_Core_Invoke::invoke(Array) /var/www/html/testsite/sites/all/modules/civicrm/drupal/civicrm.module:382
23 civicrm_invoke('upgrade', 'queue', 'ajax', 'runNext') unknown:unknown
24 call_user_func_array('civicrm_invoke', Array) /var/www/html/testsite/includes/menu.inc:350
25 menu_execute_active_handler() /var/www/html/testsite/index.php:17
26 {main}


And When I am trying to upgrade from 4.1.6 to 4.2.0
i got error
Code: [Select]
[Error: Upgrade DB to 4.2.alpha1: Price Sets]
DB Error: already exists
and for this error i aplied the patch from http://forum.civicrm.org/index.php/topic,25718.msg108931.html#msg108931

and when i tried to upgrade again, i am getting following error. It looks like same error.

Code: [Select]
[Error: Upgrade DB to 4.2.alpha1: Price Sets]
DB Error: no such field
#0 [internal function]: CRM_Core_Error::exceptionHandler(Object(DB_Error))
#1 /var/www/html/testsite/sites/all/modules/civicrm/packages/PEAR.php(931): call_user_func(Array, Object(DB_Error))
#2 /var/www/html/testsite/sites/all/modules/civicrm/packages/DB.php(968): PEAR_Error->PEAR_Error('DB Error: no su...', -19, 16, Array, 'SELECT title FR...')
#3 /var/www/html/testsite/sites/all/modules/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-19, 16, Array, 'SELECT title FR...')
#4 /var/www/html/testsite/sites/all/modules/civicrm/packages/DB/common.php(1903): PEAR->raiseError(NULL, -19, NULL, NULL, 'SELECT title FR...', 'DB_Error', true)
#5 /var/www/html/testsite/sites/all/modules/civicrm/packages/DB/mysql.php(898): DB_common->raiseError(-19, NULL, NULL, NULL, '1054 ** Unknown...')
#6 /var/www/html/testsite/sites/all/modules/civicrm/packages/DB/mysql.php(327): DB_mysql->mysqlRaiseError()
#7 /var/www/html/testsite/sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysql->simpleQuery('SELECT title FR...')
#8 /var/www/html/testsite/sites/all/modules/civicrm/packages/DB/DataObject.php(2421): DB_common->query('SELECT title FR...')
#9 /var/www/html/testsite/sites/all/modules/civicrm/packages/DB/DataObject.php(1613): DB_DataObject->_query('SELECT title FR...')
#10 /var/www/html/testsite/sites/all/modules/civicrm/CRM/Core/DAO.php(155): DB_DataObject->query('SELECT title FR...')
#11 /var/www/html/testsite/sites/all/modules/civicrm/CRM/Core/DAO.php(930): CRM_Core_DAO->query('SELECT title FR...', true)
#12 /var/www/html/testsite/sites/all/modules/civicrm/CRM/Upgrade/Incremental/php/FourTwo.php(357): CRM_Core_DAO::singleValueQuery('SELECT title FR...', Array)
#13 /var/www/html/testsite/sites/all/modules/civicrm/CRM/Upgrade/Incremental/php/FourTwo.php(254): CRM_Upgrade_Incremental_php_FourTwo::createPriceSet(Array, Array, Array)
#14 [internal function]: CRM_Upgrade_Incremental_php_FourTwo::task_4_2_alpha1_createPriceSets(Object(CRM_Queue_TaskContext), '4.2.alpha1')
#15 /var/www/html/testsite/sites/all/modules/civicrm/CRM/Queue/Task.php(79): call_user_func_array(Array, Array)
#16 /var/www/html/testsite/sites/all/modules/civicrm/CRM/Queue/Runner.php(173): CRM_Queue_Task->run(Object(CRM_Queue_TaskContext))
#17 /var/www/html/testsite/sites/all/modules/civicrm/CRM/Queue/Page/AJAX.php(44): CRM_Queue_Runner->runNext(true)
#18 /var/www/html/testsite/sites/all/modules/civicrm/CRM/Queue/ErrorPolicy.php(80): {closure}()
#19 /var/www/html/testsite/sites/all/modules/civicrm/CRM/Queue/Page/AJAX.php(51): CRM_Queue_ErrorPolicy->call(Object(Closure))
#20 [internal function]: CRM_Queue_Page_AJAX::runNext(Array)
#21 /var/www/html/testsite/sites/all/modules/civicrm/CRM/Core/Invoke.php(186): call_user_func(Array, Array)
#22 /var/www/html/testsite/sites/all/modules/civicrm/drupal/civicrm.module(382): CRM_Core_Invoke::invoke(Array)
#23 [internal function]: civicrm_invoke('upgrade', 'queue', 'ajax', 'runNext')
#24 /var/www/html/testsite/includes/menu.inc(350): call_user_func_array('civicrm_invoke', Array)
#25 /var/www/html/testsite/index.php(17): menu_execute_active_handler()
#26 {main}

I also Tried to Upgrade the civicrm 4.1.6 to 4.2.1 But I am getting same error which i got while upgrading to 4.2.7 for drupal 6

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 While updating from civicrm 4.1.6 to 4.2.x
February 18, 2013, 08:48:10 am
When you ran the upgrade from 4.1.6 to 4.2.0, did you restore your DB to its state before the previous upgrade? You need to do that and you need to be sure that you drop ALL tables (or delete and then recreate the DB) before restoring because the upgrade processing often creates table which must be dropped to re-upgrade.
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.

shashikant

  • I post occasionally
  • **
  • Posts: 30
  • Karma: 0
  • CiviCRM version: civicrm 4.1.3
  • CMS version: Drupal 6.26
  • MySQL version: Mysql 5.1.56
  • PHP version: PHP Version 5.3.6
Re: Error While updating from civicrm 4.1.6 to 4.2.x
February 18, 2013, 08:30:22 pm
Hi Hershel,
Every Time Upgrading the civicrm from 4.1.6 to 4.2.x
I am deleting the DB from phpMyAdmin and importing the Civicrm 4.1.6 DB from backup for every new Upgrade.
But Still Getting the error.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Error While updating from civicrm 4.1.6 to 4.2.x
February 19, 2013, 02:54:26 am
I'm not sure what the problem is. After the patch, you are getting:

Code: [Select]
DB Error: no such field
which is not the same

Code: [Select]
DB Error: already exists
that you got before the patch. However what the issue still is, I'm afraid I don't know. Hopefully someone else can answer here, and if not, you may need to consider hiring a professional to debug this.
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.

shashikant

  • I post occasionally
  • **
  • Posts: 30
  • Karma: 0
  • CiviCRM version: civicrm 4.1.3
  • CMS version: Drupal 6.26
  • MySQL version: Mysql 5.1.56
  • PHP version: PHP Version 5.3.6
Re: Error While updating from civicrm 4.1.6 to 4.2.x
February 26, 2013, 12:23:01 am
Hi
I have found the problem

The error was getting generated from File civicrm/CRM/Upgrade/Incremental/php/FourTwo.php while upgrading the civicrm.

Code: [Select]
    // get all option group used for event and contribution page                                                                                             
    $query = "                                                                                                                                               
SELECT id, name                                                                                                                                             
FROM   civicrm_option_group                                                                                                                                 
WHERE  name LIKE '%.amount.%' ";
    $dao = CRM_Core_DAO::executeQuery($query);
    while ($dao->fetch()) {
      $addTo = explode('.', $dao->name);
      if (CRM_Utils_Array::value(2, $addTo)) {
        $options = array ('optionGroup' => $dao->name);
        self::createPriceSet($daoName, $addTo, $options);
      }
      CRM_Core_OptionGroup::deleteAssoc($dao->name);
    }

In the above query it is selecting name and id where name is like  '%.amount.%'
In my case i was having option group with name civicrm_price_field.amount.17
Which was also getting selected in the query.

Then the createPriceSet function was getting called.

Code: [Select]
  static function createPriceSet($daoName, $addTo,  $options = array()) {
    $query = "SELECT title FROM {$addTo[0]} where id =%1";
    $setParams['title']  = CRM_Core_DAO::singleValueQuery($query,
      array(1 => array($addTo[2], 'Integer'))
    );

This function was forming the query after reading values from $addTo variable.
Code: [Select]
SELECT title FROM civicrm_price_field where id =17
The Table civicrm_price_field dont have column "title" and id =17.
Hence i was getting the error
Code: [Select]
[Error: Upgrade DB to 4.2.alpha1: Price Sets]
Error Field Error Value
Type DB_Error
Code -19
Message DB Error: no such field
Mode 16
UserInfo SELECT title FROM civicrm_price_field where id =17 [nativecode=1054 ** Unknown column 'title' in 'field list']
DebugInfo SELECT title FROM civicrm_price_field where id =17 [nativecode=1054 ** Unknown column 'title' in 'field list']

After Deleting the entry for option group whose name is "civicrm_price_field.amount.17"
I was able to upgrade my civicrm successfully.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Error While updating from civicrm 4.1.6 to 4.2.x
February 26, 2013, 02:08:01 pm
It looks like that option_group row is unexpected - it should have been deleted during the 3.3 upgrade - which converted the option_value rows in those option groups (which were 'options' for price fields) into price_field_value rows. I've filed an issue to detect this prior to beginning a 4.2 upgrade and aborting with an explanatory message:

http://issues.civicrm.org/jira/browse/CRM-11980
Protect your investment in CiviCRM by  becoming a Member!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Error While updating from civicrm 4.1.6 to 4.2.x

This forum was archived on 2017-11-26.