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) »
  • upgrade 4.2.7 to 4.3.2 fails on 4.3.alpha1 due error on rename file
Pages: [1] 2 3

Author Topic: upgrade 4.2.7 to 4.3.2 fails on 4.3.alpha1 due error on rename file  (Read 4765 times)

majovdh

  • I post occasionally
  • **
  • Posts: 58
  • Karma: 2
    • Chautaara VZW
  • CiviCRM version: 4.2.6
  • CMS version: drupal 7.17
  • MySQL version: 5.1.56
  • PHP version: 5.2.17
upgrade 4.2.7 to 4.3.2 fails on 4.3.alpha1 due error on rename file
May 03, 2013, 07:36:45 am
My uprgade fails on the same issue each time. I tried to upgrade to 4.3.1 and 4.3.2.

Any ideas

Majo

Code: [Select]
CiviCRM Upgrade Tasks
[Error: Upgrade DB to 4.3.alpha1]
Error Field Error Value
Type DB_Error
Code -1
Message DB Error: unknown error
Mode 16
UserInfo ALTER TABLE civicrm_membership_type DROP FOREIGN KEY FK_civicrm_membership_autorenewal_msg_id [nativecode=1025 ** Error on rename of './chautaar_chautaardr7_crm/civicrm_membership_type' to './chautaar_chautaardr7_crm/#sql2-3003-27ab9ed' (errno: 152)]
DebugInfo ALTER TABLE civicrm_membership_type DROP FOREIGN KEY FK_civicrm_membership_autorenewal_msg_id [nativecode=1025 ** Error on rename of './chautaar_chautaardr7_crm/civicrm_membership_type' to './chautaar_chautaardr7_crm/#sql2-3003-27ab9ed' (errno: 152)]
PEAR_Exception: DB Error: unknown error in unknown on line unknown
- DB_Error: DB Error: unknown error 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)) /home/chautaar/public_html/sites/all/modules/civicrm/packages/PEAR.php:931
2 PEAR_Error->PEAR_Error('DB Error: unknow…', -1, 16, Array, 'ALTER TABLE civi…') /home/chautaar/public_html/sites/all/modules/civicrm/packages/DB.php:969
3 DB_Error->DB_Error(-1, 16, Array, 'ALTER TABLE civi…') /home/chautaar/public_html/sites/all/modules/civicrm/packages/PEAR.php:564
4 PEAR->raiseError(null, -1, null, null, 'ALTER TABLE civi…', 'DB_Error', true) /home/chautaar/public_html/sites/all/modules/civicrm/packages/DB/common.php:1905
5 DB_common->raiseError(-1, null, null, null, '1025 ** Error on…') /home/chautaar/public_html/sites/all/modules/civicrm/packages/DB/mysql.php:898
6 DB_mysql->mysqlRaiseError() /home/chautaar/public_html/sites/all/modules/civicrm/packages/DB/mysql.php:327
7 DB_mysql->simpleQuery('ALTER TABLE civi…') /home/chautaar/public_html/sites/all/modules/civicrm/packages/DB/common.php:1216
8 DB_common->query('ALTER TABLE civi…') /home/chautaar/public_html/sites/all/modules/civicrm/packages/DB/DataObject.php:2421
9 DB_DataObject->_query('ALTER TABLE civi…') /home/chautaar/public_html/sites/all/modules/civicrm/packages/DB/DataObject.php:1613
10 DB_DataObject->query('ALTER TABLE civi…') /home/chautaar/public_html/sites/all/modules/civicrm/CRM/Core/DAO.php:155
11 CRM_Core_DAO->query('ALTER TABLE civi…', false) /home/chautaar/public_html/sites/all/modules/civicrm/CRM/Core/DAO.php:917
12 CRM_Core_DAO::executeQuery('ALTER TABLE civi…', Array, true, null, false, false) /home/chautaar/public_html/sites/all/modules/civicrm/CRM/Upgrade/Incremental/php/FourThree.php:779
13 CRM_Upgrade_Incremental_php_FourThree->task_4_3_alpha1_checkDBConstraints() /home/chautaar/public_html/sites/all/modules/civicrm/CRM/Upgrade/Incremental/php/FourThree.php:193
14 CRM_Upgrade_Incremental_php_FourThree->upgrade_4_3_alpha1('4.3.alpha1') /home/chautaar/public_html/sites/all/modules/civicrm/CRM/Upgrade/Form.php:570
15 CRM_Upgrade_Form::doIncrementalUpgradeStep(Object(CRM_Queue_TaskContext), '4.3.alpha1', '4.2.7', '4.3.2', '/tmp/civicrm-pos…') unknown:unknown
16 call_user_func_array(Array, Array) /home/chautaar/public_html/sites/all/modules/civicrm/CRM/Queue/Task.php:79
17 CRM_Queue_Task->run(Object(CRM_Queue_TaskContext)) /home/chautaar/public_html/sites/all/modules/civicrm/CRM/Queue/Runner.php:186
18 CRM_Queue_Runner->runNext(true) /home/chautaar/public_html/sites/all/modules/civicrm/CRM/Queue/Page/AJAX.php:44
19 {closure}() /home/chautaar/public_html/sites/all/modules/civicrm/CRM/Queue/ErrorPolicy.php:80
20 CRM_Queue_ErrorPolicy->call(Object(Closure)) /home/chautaar/public_html/sites/all/modules/civicrm/CRM/Queue/Page/AJAX.php:47
21 CRM_Queue_Page_AJAX::runNext(Array) unknown:unknown
22 call_user_func(Array, Array) /home/chautaar/public_html/sites/all/modules/civicrm/CRM/Core/Invoke.php:258
23 CRM_Core_Invoke::runItem(Array) /home/chautaar/public_html/sites/all/modules/civicrm/CRM/Core/Invoke.php:70
24 CRM_Core_Invoke::_invoke(Array) /home/chautaar/public_html/sites/all/modules/civicrm/CRM/Core/Invoke.php:52
25 CRM_Core_Invoke::invoke(Array) /home/chautaar/public_html/sites/all/modules/civicrm/drupal/civicrm.module:436
26 civicrm_invoke('upgrade', 'queue', 'ajax', 'runNext') unknown:unknown
27 call_user_func_array('civicrm_invoke', Array) /home/chautaar/public_html/includes/menu.inc:517
28 menu_execute_active_handler() /home/chautaar/public_html/index.php:21

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: upgrade 4.2.7 to 4.3.2 fails on 4.3.alpha1 due error on rename file
May 04, 2013, 04:38:27 pm

We've seen the below errors when some FK constraints are not valid. I would manually check the FK constrains on the membership_type table and ensure that they are all valid (i.e. the other rows exists in the foreign tables)

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

majovdh

  • I post occasionally
  • **
  • Posts: 58
  • Karma: 2
    • Chautaara VZW
  • CiviCRM version: 4.2.6
  • CMS version: drupal 7.17
  • MySQL version: 5.1.56
  • PHP version: 5.2.17
Re: upgrade 4.2.7 to 4.3.2 fails on 4.3.alpha1 due error on rename file
May 07, 2013, 06:54:21 am
Lobo,

I never used any autorenewal templates and all values in the dbase are set to NULL, does it means i first have to make a template and then assign all memebershiptypes to this template? Even if i don't want to use the autorenewal function in the future?

I upload a screenshot of the dabase civicrm.membership.type table

Majo


helenbn

  • I post occasionally
  • **
  • Posts: 87
  • Karma: 2
    • Pretty Good Designs
  • CiviCRM version: 4.5.x
  • CMS version: Joomla 2.5.x, 3.x
  • MySQL version: 5.x.x
  • PHP version: 5.x.x
Re: upgrade 4.2.7 to 4.3.2 fails on 4.3.alpha1 due error on rename file
May 07, 2013, 08:30:31 am
I am having the same trouble and await a solution with baited breath!  :P
Pretty Good Designs | http://prettygooddesigns.com | Hey, that's pretty good!

helenbn

  • I post occasionally
  • **
  • Posts: 87
  • Karma: 2
    • Pretty Good Designs
  • CiviCRM version: 4.5.x
  • CMS version: Joomla 2.5.x, 3.x
  • MySQL version: 5.x.x
  • PHP version: 5.x.x
Re: upgrade 4.2.7 to 4.3.2 fails on 4.3.alpha1 due error on rename file
May 07, 2013, 11:22:42 am
I just duplicated my error and it seems it is with a different table but the rest is the same, EXCEPT mine is with Joomla  :o

ALTER TABLE civicrm_financial_trxn DROP FOREIGN KEY civicrm_financial_trxn_ibfk_2 [nativecode=1025 ** Error on rename of './my-site/civicrm_financial_trxn' to './my-site/#sql2-ae83-15a4' (errno: 152)]
Pretty Good Designs | http://prettygooddesigns.com | Hey, that's pretty good!

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: upgrade 4.2.7 to 4.3.2 fails on 4.3.alpha1 due error on rename file
May 07, 2013, 11:35:32 am
That was the error that triggered this ticket to be logged (I think it is different to the one that started the thread)

http://issues.civicrm.org/jira/browse/CRM-12477

http://forum.civicrm.org/index.php/topic,28453.45.html

« Last Edit: May 07, 2013, 11:37:21 am by Eileen »
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

helenbn

  • I post occasionally
  • **
  • Posts: 87
  • Karma: 2
    • Pretty Good Designs
  • CiviCRM version: 4.5.x
  • CMS version: Joomla 2.5.x, 3.x
  • MySQL version: 5.x.x
  • PHP version: 5.x.x
Re: upgrade 4.2.7 to 4.3.2 fails on 4.3.alpha1 due error on rename file
May 07, 2013, 11:40:15 am
I don't know what to think of that ticket Eileen.

However, I did find the nifty "skip" button, skipped it and got a green check mark.

Am I out of the woods??
Pretty Good Designs | http://prettygooddesigns.com | Hey, that's pretty good!

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: upgrade 4.2.7 to 4.3.2 fails on 4.3.alpha1 due error on rename file
May 07, 2013, 11:58:59 am
no:-(

My reading of the code (and my advice to the previous guy) is that if you have any foreign key constraints on civicrm_financial_trxn CiviCRM will use the incorrect key name when it tries to drop them. So, if you make sure you don't have any before you start the upgrade then it shouldn't fail.

However, the ticket was closed as a 'Could not reproduce' I think - so I don't know if my reading was correct.
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

helenbn

  • I post occasionally
  • **
  • Posts: 87
  • Karma: 2
    • Pretty Good Designs
  • CiviCRM version: 4.5.x
  • CMS version: Joomla 2.5.x, 3.x
  • MySQL version: 5.x.x
  • PHP version: 5.x.x
Re: upgrade 4.2.7 to 4.3.2 fails on 4.3.alpha1 due error on rename file
May 07, 2013, 01:02:07 pm
Lots of reading -- lots of head scratching

I looked at the db within TextWrangler and searched for civicrm_financial_trxn_ibfk_2 but it doesn't exist, just as in that other thread, http://forum.civicrm.org/index.php/topic,28453.45.html

Now I have quite a number of db backups, but none that are just the schema. But at quick check, I still do not have ibfk_2 anywhere so I am wondering....

When the next upgrade occurs, will I get the same error? I may have to wait and see.  :-\
Pretty Good Designs | http://prettygooddesigns.com | Hey, that's pretty good!

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: upgrade 4.2.7 to 4.3.2 fails on 4.3.alpha1 due error on rename file
May 07, 2013, 01:05:56 pm
If you look at the other thread you see in his show create table

 KEY `FK_civicrm_financial_trxn_from_account_id` (`from_account_id`),
 KEY `FK_civicrm_financial_trxn_to_account_id` (`to_account_id`)

So, the from_account_id & to_account_id have FKS on this. The upgrade code checks & since there are FKS it tries to drop them. But the name it tries to drop them using is hard-coded & incorrect in your set-up.

My theory is that is there are NO FKs on those fields then it will skip the duff Drop command

Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

helenbn

  • I post occasionally
  • **
  • Posts: 87
  • Karma: 2
    • Pretty Good Designs
  • CiviCRM version: 4.5.x
  • CMS version: Joomla 2.5.x, 3.x
  • MySQL version: 5.x.x
  • PHP version: 5.x.x
Re: upgrade 4.2.7 to 4.3.2 fails on 4.3.alpha1 due error on rename file
May 07, 2013, 01:27:57 pm
I just checked the db in the text editor and see this info so it looks like I do have FKs:

-- Create Table `civicrm_financial_trxn`
--

DROP TABLE IF EXISTS `civicrm_financial_trxn`;
CREATE TABLE `civicrm_financial_trxn` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Gift ID',
  `from_account_id` int(10) unsigned DEFAULT NULL COMMENT 'FK to financial_account table.',
  `to_account_id` int(10) unsigned DEFAULT NULL COMMENT 'FK to financial_account table.',
  `trxn_date` datetime NOT NULL,
  `trxn_type` enum('Debit','Credit') COLLATE utf8_unicode_ci NOT NULL,
  `total_amount` decimal(20,2) NOT NULL COMMENT 'amount of transaction',
  `fee_amount` decimal(20,2) DEFAULT NULL COMMENT 'actual processor fee if known - may be 0.',
  `net_amount` decimal(20,2) DEFAULT NULL COMMENT 'actual funds transfer amount. total less fees. if processor does not report actual fee during transaction, this is set to total_amount.',
  `currency` varchar(3) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '3 character string, value from config setting or input via user.',
  `payment_processor` varchar(64) COLLATE utf8_unicode_ci NOT NULL COMMENT 'derived from Processor setting in civicrm.settings.php.',
  `trxn_id` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'unique processor transaction id, bank id + trans id,... depending on payment_method',
  `trxn_result_code` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'processor result code',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UI_ft_trxn_id` (`trxn_id`),
  KEY `FK_civicrm_financial_trxn_from_account_id` (`from_account_id`),
  KEY `FK_civicrm_financial_trxn_to_account_id` (`to_account_id`),
  CONSTRAINT `FK_civicrm_financial_trxn_from_account_id` FOREIGN KEY (`from_account_id`) REFERENCES `civicrm_financial_account` (`id`),
  CONSTRAINT `FK_civicrm_financial_trxn_to_account_id` FOREIGN KEY (`to_account_id`) REFERENCES `civicrm_financial_account` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=128 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Data for Table `civicrm_financial_trxn`
Pretty Good Designs | http://prettygooddesigns.com | Hey, that's pretty good!

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: upgrade 4.2.7 to 4.3.2 fails on 4.3.alpha1 due error on rename file
May 07, 2013, 01:31:30 pm
Yep - so try reloading your db, dropping them & the re-running the upgrade
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

helenbn

  • I post occasionally
  • **
  • Posts: 87
  • Karma: 2
    • Pretty Good Designs
  • CiviCRM version: 4.5.x
  • CMS version: Joomla 2.5.x, 3.x
  • MySQL version: 5.x.x
  • PHP version: 5.x.x
Re: upgrade 4.2.7 to 4.3.2 fails on 4.3.alpha1 due error on rename file
May 07, 2013, 04:14:54 pm
Eileen, I am not quite getting this. I will looks at a bunch of backups to see if it clicks.
Pretty Good Designs | http://prettygooddesigns.com | Hey, that's pretty good!

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: upgrade 4.2.7 to 4.3.2 fails on 4.3.alpha1 due error on rename file
May 07, 2013, 04:18:53 pm
What I am suggesting is that the borked 'Drop Constraint ' routine won't run on that table if those keys don't have constraints on them
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

helenbn

  • I post occasionally
  • **
  • Posts: 87
  • Karma: 2
    • Pretty Good Designs
  • CiviCRM version: 4.5.x
  • CMS version: Joomla 2.5.x, 3.x
  • MySQL version: 5.x.x
  • PHP version: 5.x.x
Re: upgrade 4.2.7 to 4.3.2 fails on 4.3.alpha1 due error on rename file
May 08, 2013, 11:43:34 am
Thanks Eileen. This got me thinking and I was able to solve my problem which was multi-fold. My live site was fine but my localhost was messed up and in the process of correction due to outdated mysql. I had restored my local database with my live database backups but this didn't fix the problem. What I had to do was CLEAR the local database and THEN restore in order to clear out all the old garbage.

Can't have enough backups!!  :D
Pretty Good Designs | http://prettygooddesigns.com | Hey, that's pretty good!

Pages: [1] 2 3
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • upgrade 4.2.7 to 4.3.2 fails on 4.3.alpha1 due error on rename file

This forum was archived on 2017-11-26.