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 to 4.4.x fails
Pages: [1]

Author Topic: Upgrade to 4.4.x fails  (Read 1014 times)

jsimonis

  • I post frequently
  • ***
  • Posts: 316
  • Karma: 4
    • Forward Support, Inc.
  • CiviCRM version: 4.4-4.5
  • CMS version: Drupal 7
  • MySQL version: 5.5.37-cll
  • PHP version: 5.3.29
Upgrade to 4.4.x fails
February 11, 2014, 09:41:50 pm
I've been trying to upgrade our install of CiviCRM. It was using version 4.3.1. I tried going straight to 4.4.4 and that failed. I tried doing the incremental ones listed in the log, but it failed at 4.3.5. Then I tried doing each version. I was able to get up through 4.3.8 if I skipped 4.3.5. However, I can't upgrade to anything in the 4.4.x versions.

The log thus far for my install tries is at: http://nu-look.net/CiviCRM.log

I've also included screenshots of what it said when I tried to do the upgrade to 4.4.4.

Thanks for any help you can give me.

jsimonis

  • I post frequently
  • ***
  • Posts: 316
  • Karma: 4
    • Forward Support, Inc.
  • CiviCRM version: 4.4-4.5
  • CMS version: Drupal 7
  • MySQL version: 5.5.37-cll
  • PHP version: 5.3.29
Re: Upgrade to 4.4.x fails
February 18, 2014, 09:42:22 pm
Anything? I still can't find anything regarding this error and why we can't upgrade.

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 to 4.4.x fails
February 18, 2014, 10:04:18 pm
This is strange error, just a wild guess, try below sql and check if you get any result:

Quote
SELECT id FROM civicrm_activity WHERE source_contact_id NOT IN ( select id from civicrm_contact);

If you get any result, it might be orphan activities, so may be delete those activities and retry upgrade ..

HTh
Kurund
Found this reply helpful? Support CiviCRM

jsimonis

  • I post frequently
  • ***
  • Posts: 316
  • Karma: 4
    • Forward Support, Inc.
  • CiviCRM version: 4.4-4.5
  • CMS version: Drupal 7
  • MySQL version: 5.5.37-cll
  • PHP version: 5.3.29
Re: Upgrade to 4.4.x fails
February 18, 2014, 11:01:12 pm
Perfect, thanks. I will try that. Activities aren't near as important since we aren't really using them. So getting clearing out them wouldn't cause any issues.

jsimonis

  • I post frequently
  • ***
  • Posts: 316
  • Karma: 4
    • Forward Support, Inc.
  • CiviCRM version: 4.4-4.5
  • CMS version: Drupal 7
  • MySQL version: 5.5.37-cll
  • PHP version: 5.3.29
Re: Upgrade to 4.4.x fails
February 18, 2014, 11:05:36 pm
Ran that and I got 0 results.

jsimonis

  • I post frequently
  • ***
  • Posts: 316
  • Karma: 4
    • Forward Support, Inc.
  • CiviCRM version: 4.4-4.5
  • CMS version: Drupal 7
  • MySQL version: 5.5.37-cll
  • PHP version: 5.3.29
Re: Upgrade to 4.4.x fails
February 18, 2014, 11:07:01 pm
Would it be ok to just empty the activity table?

jsimonis

  • I post frequently
  • ***
  • Posts: 316
  • Karma: 4
    • Forward Support, Inc.
  • CiviCRM version: 4.4-4.5
  • CMS version: Drupal 7
  • MySQL version: 5.5.37-cll
  • PHP version: 5.3.29
Re: Upgrade to 4.4.x fails
February 18, 2014, 11:30:24 pm
Since this is just a copy of the live site that I'm working with, I tested emptying out the activity tables. Same issue of it failing during the upgrade to 4.4 alpha1

[Error: Consolidate activity contacts]
ERROR FIELD   ERROR VALUE
Type   DB_Error
Code   -1
Message   DB Error: unknown error
Mode   16
UserInfo   ALTER TABLE civicrm_activity DROP FOREIGN KEY FK_civicrm_activity_source_contact_id [nativecode=1025 ** Error on rename of './sandbox_crm/civicrm_activity' to './sandbox_crm/#sql2-4ad5-abf5' (errno: 152)]
DebugInfo   ALTER TABLE civicrm_activity DROP FOREIGN KEY FK_civicrm_activity_source_contact_id [nativecode=1025 ** Error on rename of './sandbox_crm/civicrm_activity' to './sandbox_crm/#sql2-4ad5-abf5' (errno: 152)]
« Last Edit: February 18, 2014, 11:53:29 pm by jsimonis »

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Re: Upgrade to 4.4.x fails
February 19, 2014, 12:58:15 am
Error: Unknown column 'civicrm_uf_group.description' in 'field list'

Query:

Code: [Select]
SELECT civicrm_uf_group.id, civicrm_uf_group.title, civicrm_uf_group.created_id, civicrm_uf_group.is_active, civicrm_uf_group.is_reserved, civicrm_uf_group.group_type, civicrm_uf_group.description
                        FROM civicrm_uf_group
                        LEFT JOIN civicrm_uf_join ON (civicrm_uf_group.id = uf_group_id) AND civicrm_uf_group.is_active = 1
                              WHERE civicrm_uf_join.module = 'User Account' ORDER BY civicrm_uf_join.weight, civicrm_uf_group.title

The above query is somewhere in your CiviCRM codebase, either as a .sql file or in PHP. But don't edit it - you'll end up hitting more issues down the track.

The best thing to do is to reload a "pristine" copy of the DB structure from the installer for your *current* version, then repeat the upgrader. I think there are instructions in the wiki to do this. We've had to massage one or two CiviCRM DBs through the upgrade process - if you have a large DB it can be a real challenge.

See -

* http://wiki.civicrm.org/confluence/display/CRMDOC/Ensuring+Schema+Integrity+on+Upgrades (this should fix your problem)
* http://wiki.civicrm.org/confluence/display/CRMDOC/Installation+and+Upgrades (general docs on upgrades)
@xurizaemon ● www.fuzion.co.nz

jsimonis

  • I post frequently
  • ***
  • Posts: 316
  • Karma: 4
    • Forward Support, Inc.
  • CiviCRM version: 4.4-4.5
  • CMS version: Drupal 7
  • MySQL version: 5.5.37-cll
  • PHP version: 5.3.29
Re: Upgrade to 4.4.x fails
February 19, 2014, 01:05:08 am
Thanks, I will try that next. Thankfully it is not a large database - the sql file is only a few MB.

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Re: Upgrade to 4.4.x fails
February 19, 2014, 01:06:08 am
Quote from: jsimonis on February 18, 2014, 11:30:24 pm
Since this is just a copy of the live site that I'm working with, I tested emptying out the activity tables. Same issue of it failing during the upgrade to 4.4 alpha1

[Error: Consolidate activity contacts]
ERROR FIELD   ERROR VALUE
Type   DB_Error
Code   -1
Message   DB Error: unknown error
Mode   16
UserInfo   ALTER TABLE civicrm_activity DROP FOREIGN KEY FK_civicrm_activity_source_contact_id [nativecode=1025 ** Error on rename of './sandbox_crm/civicrm_activity' to './sandbox_crm/#sql2-4ad5-abf5' (errno: 152)]
DebugInfo   ALTER TABLE civicrm_activity DROP FOREIGN KEY FK_civicrm_activity_source_contact_id [nativecode=1025 ** Error on rename of './sandbox_crm/civicrm_activity' to './sandbox_crm/#sql2-4ad5-abf5' (errno: 152)]

I think this is trying to tell you that it failed because the foreign key it tried to remove was already removed. Make sure you are fully reloading the DB each time you run the upgrade, or the partially upgraded DB will start giving you new and confusing error messages.

Unfortunately the parts of the upgrader which use SQL (instead of a more fault-tolerant language) are its more brittle parts. DROP FOREIGN KEY IF EXISTS might help here, but ... it doesn't exist.
@xurizaemon ● www.fuzion.co.nz

jsimonis

  • I post frequently
  • ***
  • Posts: 316
  • Karma: 4
    • Forward Support, Inc.
  • CiviCRM version: 4.4-4.5
  • CMS version: Drupal 7
  • MySQL version: 5.5.37-cll
  • PHP version: 5.3.29
Re: Upgrade to 4.4.x fails
February 19, 2014, 01:08:22 am
I'm completely deleting the database each time, waiting a little bit, recreating it, and then reloading it from my original backup that I saved from before I began upgrading.

jsimonis

  • I post frequently
  • ***
  • Posts: 316
  • Karma: 4
    • Forward Support, Inc.
  • CiviCRM version: 4.4-4.5
  • CMS version: Drupal 7
  • MySQL version: 5.5.37-cll
  • PHP version: 5.3.29
Re: Upgrade to 4.4.x fails
February 19, 2014, 01:55:48 am
Perfect. That did it. Now I just need to work with this upgraded version to make certain that everything works. Then I can prep everything to do it to the live site.

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Upgrade to 4.4.x fails
February 19, 2014, 10:31:48 am
It's possible to create an SQL function (or php) that does DROP FOREIGN KEY IF EXISTS - which would likely be a good thing
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

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Re: Upgrade to 4.4.x fails
February 19, 2014, 11:18:34 am
Yep - the hardest fails I've seen on upgrade have been to do with indexes, fkeys etc, which are assumed to be in the correct state.

It's possible to do this in SQL, but IMO better to move that logic out of the data storage layer to the application logic layer. That is a much bigger conversation though :D

(Is your flight delayed too Eileen?)
@xurizaemon ● www.fuzion.co.nz

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: Upgrade to 4.4.x fails
February 19, 2014, 07:05:20 pm
I bumped into this exact issue upgrading from 4.3.8 to 4.4.4.  Had to comment out the line that was trying to DROP foreign key that did not exist.  Then the upgrade seemed to proceed normally (until the next error about civicrm_word_replacements).  :)
Try CiviTeacher: the online video tutorial CiviCRM learning library.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Upgrade to 4.4.x fails

This forum was archived on 2017-11-26.