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 2.2.7 -> 3.0.4
Pages: [1] 2

Author Topic: error on upgrade 2.2.7 -> 3.0.4  (Read 5081 times)

nunodonato

  • Guest
error on upgrade 2.2.7 -> 3.0.4
February 04, 2010, 03:53:57 am
Hi there,
Been trying to upgrade for a few hours with no success.
After clicking the upgrade db button, i get this

Sorry. A non-recoverable error has occurred.
DB Error: a515ac9c2796ca0e23adbe92c68fc9fc

Database Error Code: Error on rename of './amurt_civicrm2/civicrm_group_organization' to './amurt_civicrm2/#sql2-b48-54a61' (errno: 152), 1025

Error Details:

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

       
Code: [Select]
=> a515ac9c2796ca0e23adbe92c68fc9fc
    [message] => DB Error: a515ac9c2796ca0e23adbe92c68fc9fc
    [mode] => 16
    [debug_info] => -- CRM-4610
    ALTER TABLE `civicrm_group_organization`
        DROP FOREIGN KEY `FK_civicrm_group_organization_group_id`,
        DROP FOREIGN KEY `FK_civicrm_group_organization_organization_id` [nativecode=1025 ** Error on rename of './amurt_civicrm2/civicrm_group_organization' to './amurt_civicrm2/#sql2-b48-54a61' (errno: 152)]
    [type] => DB_Error
    [user_info] => -- CRM-4610
    ALTER TABLE `civicrm_group_organization`
        DROP FOREIGN KEY `FK_civicrm_group_organization_group_id`,
        DROP FOREIGN KEY `FK_civicrm_group_organization_organization_id` [nativecode=1025 ** Error on rename of './amurt_civicrm2/civicrm_group_organization' to './amurt_civicrm2/#sql2-b48-54a61' (errno: 152)]
    [to_string] => [db_error: message="DB Error: a515ac9c2796ca0e23adbe92c68fc9fc" code=0 mode=callback callback=CRM_Core_Error::handle prefix="" info="-- CRM-4610
    ALTER TABLE `civicrm_group_organization`
        DROP FOREIGN KEY `FK_civicrm_group_organization_group_id`,
        DROP FOREIGN KEY `FK_civicrm_group_organization_organization_id` [nativecode=1025 ** Error on rename of './amurt_civicrm2/civicrm_group_organization' to './amurt_civicrm2/#sql2-b48-54a61' (errno: 152)]"]
)

Deepak Srivastava

  • Moderator
  • Ask me questions
  • *****
  • Posts: 677
  • Karma: 65
Re: error on upgrade 2.2.7 -> 3.0.4
February 04, 2010, 05:06:20 am
looks like FK_civicrm_group_organization_group_id constraint is missing.

In order to verify if thats the problem for all the constraints in your db, Can you paste the output of query:
Code: [Select]
show create table civicrm_group_organization;
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

nunodonato

  • Guest
Re: error on upgrade 2.2.7 -> 3.0.4
February 04, 2010, 05:11:54 am
here it goes

Code: [Select]
CREATE TABLE `civicrm_group_organization` (
 `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Relationship ID',
 `group_id` int(10) unsigned NOT NULL COMMENT 'ID of the group',
 `organization_id` int(10) unsigned NOT NULL COMMENT 'ID of the Organization Contact',
 PRIMARY KEY  (`id`),
 KEY `FK_civicrm_group_organization_group_id` (`group_id`),
 KEY `FK_civicrm_group_organization_organization_id` (`organization_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci

Deepak Srivastava

  • Moderator
  • Ask me questions
  • *****
  • Posts: 677
  • Karma: 65
Re: error on upgrade 2.2.7 -> 3.0.4
February 04, 2010, 07:47:43 am
ok, that confirms that constraints are missing (the presence of "key" in place of "constraint"). You sure your mysql uses innodb ?

If yes, one way is to fix structure, as instructed here - http://wiki.civicrm.org/confluence/display/CRMDOC/Ensuring+Schema+Integrity+on+Upgrades
and then go for upgrade.

Note: Before doing above step check if problem is same for civicrm_contact table, just to be 100% sure.
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

nunodonato

  • Guest
Re: error on upgrade 2.2.7 -> 3.0.4
February 04, 2010, 12:04:18 pm
Hi there,

I followed all the steps, but got an error while importing the data-only sql file.
Code: [Select]
SQL query:

-- -- Dumping data for table 'civicrm_activity' -- INSERT INTO civicrm_activity (id, source_contact_id, source_record_id, activity_type_id, subject, activity_date_time, due_date_time, duration, location, phone_id, phone_number, details, status_id, priority_id, parent_id, is_test, medium_id, is_auto, relationship_id, is_current_revision, original_id, is_deleted) VALUES (1, 1, NULL, 3, 'teste', '2009-07-10 15:47:00', NULL, NULL, NULL, NULL, NULL, 'Olá {contact.do_not_phone}{contact.home_URL}\r\nteste\r\n', 2, NULL, NULL, 0, NULL, 0, NULL, 1, NULL, 0), (2, 51, 1, 6, '€ 15.00', '2009-09-01 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, 2, NULL, NULL, 0, NULL, 0, NULL, 1, NULL, 0), (3, 45, 2, 6, '€ 12.00 - 1€ p mes', '2009-08-25 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, 2, NULL, NULL, 0, NULL, 0, NULL, 1, NULL, 0), (4, 51, 3, 6, '€ 15.00 - 1€ por mes', '2009-10-01 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, 2, NULL, NULL, 0, NULL, 0, NULL, 1, NULL, 0), (5, 60, 4, 6, '�[...]

MySQL said:

#1054 - Unknown column 'due_date_time' in 'field list'

nunodonato

  • Guest
Re: error on upgrade 2.2.7 -> 3.0.4
February 05, 2010, 05:09:36 am
help please, my CiviCRM is currently down  :(
will it help if I make an upgrade to 2.2.8 first or something like that?

Deepak Srivastava

  • Moderator
  • Ask me questions
  • *****
  • Posts: 677
  • Karma: 65
Re: error on upgrade 2.2.7 -> 3.0.4
February 05, 2010, 05:30:23 am
Due to some recent changes, the link i gave you looks to be incomplete/confusing and therefore can't ask you if you following the docs correctly.

While i correct that link, you could follow a previous version - http://wiki.civicrm.org/confluence/display/CRMDOC30/Ensuring+Schema+Integrity+on+Upgrades, which has correct information.
« Last Edit: February 05, 2010, 06:41:35 am by Deepak Srivastava »
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

nunodonato

  • Guest
Re: error on upgrade 2.2.7 -> 3.0.4
February 05, 2010, 06:22:43 am
hi, thanks again.

I guess the problem persists...
Code: [Select]
SQL query:

-- -- Dumping data for table `civicrm_activity` -- INSERT INTO `civicrm_activity`  etc....

MySQL said:

#1452 - Cannot add or update a child row: a foreign key constraint fails (`amurt_civicrm2/civicrm_activity`, CONSTRAINT `FK_civicrm_activity_source_contact_id` FOREIGN KEY (`source_contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)

Just to make sure I understand: I have currently 2.2.7. Should I use the 2.2.7 "virgin" sql file on step 4? that's what I did..

Deepak Srivastava

  • Moderator
  • Ask me questions
  • *****
  • Posts: 677
  • Karma: 65
Re: error on upgrade 2.2.7 -> 3.0.4
February 05, 2010, 06:40:23 am
That indicates that there are some orphaned entries in your data i.e civicrm_activity table pointing to non existing contact, causing that error (which IMO isn't a big concern).

Disabling foreign key checks while importing should work.
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

nunodonato

  • Guest
Re: error on upgrade 2.2.7 -> 3.0.4
February 05, 2010, 06:45:35 am
well I'm doing this through phpMyAdmin on a shared hosting account, how can I disable the foreign key checks?

nunodonato

  • Guest
Re: error on upgrade 2.2.7 -> 3.0.4
February 05, 2010, 06:52:29 am
ok I got that one.
edited my data-only sql file and added back the line which disabled the checks.
upgrade to 2.2.8 was ok. i'm trying 3.0.4 now

nunodonato

  • Guest
Re: error on upgrade 2.2.7 -> 3.0.4
February 05, 2010, 07:03:05 am
upgrading from 2.2.8 to 3.0.4 takes me back to step 0, same error as in my first post :(

Deepak Srivastava

  • Moderator
  • Ask me questions
  • *****
  • Posts: 677
  • Karma: 65
Re: error on upgrade 2.2.7 -> 3.0.4
February 05, 2010, 07:21:08 am
well if "show create table civicrm_group_organization;" doesn't show you the constraint in the format:
Code: [Select]
| civicrm_group_organization | CREATE TABLE `civicrm_group_organization` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Relationship ID',
  `group_id` int(10) unsigned NOT NULL COMMENT 'ID of the group',
  `organization_id` int(10) unsigned NOT NULL COMMENT 'ID of the Organization Contact',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UI_group_organization` (`group_id`,`organization_id`),
  KEY `FK_civicrm_group_organization_group_id` (`group_id`),
  KEY `FK_civicrm_group_organization_organization_id` (`organization_id`),
  CONSTRAINT `FK_civicrm_group_organization_group_id` FOREIGN KEY (`group_id`) REFERENCES `civicrm_group` (`id`) ON DELETE CASCADE,
  CONSTRAINT `FK_civicrm_group_organization_organization_id` FOREIGN KEY (`organization_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci |


means schema / structure is still the same and sth went wrong while following the instructions.

You might want to contact http://civicrm.org/professional for better help.
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

nunodonato

  • Guest
Re: error on upgrade 2.2.7 -> 3.0.4
February 05, 2010, 10:29:56 am
 :(
I did the upgrade to 2.2.9 also without problems. after that I tried following the steps again to ensure the db schema was ok.
and I got a different error while importing the data-only sql file

Code: [Select]
SQL query:

-- -- Dumping data for table 'civicrm_address' -- INSERT INTO civicrm_address (id, contact_id, location_type_id, is_primary, is_billing, street_address, street_number, street_number_suffix, street_number_predirectional, street_name, street_type, street_number_postdirectional, street_unit, supplemental_address_1, supplemental_address_2, supplemental_address_3, city, county_id, state_province_id, postal_code_suffix, postal_code, usps_adc, country_id, geo_code_1, geo_code_2, timezone, name) VALUES (1, NULL, 1, 0, 0, 'Rua Visconde de Santarém, 3º andar, Sala 1', 14, 'S', NULL, 'El Camino', 'Way', NULL, NULL, NULL, NULL, NULL, 'Lisboa', NULL, 4136, '286', '1000', NULL, 1173, NULL, NULL, NULL, NULL), (2, 35, 1, 1, 0, 'Av. Maria da Conceicao, 101 - 2º esq.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Carcavelos', NULL, 4136, NULL, '2775-605', NULL, 1173, NULL, NULL, NULL, NULL), (3, 36, 1, 1, 0, 'R. Ponte S. Lourenço, Casa das Ribas', NULL, NULL, NULL, NULL, NULL, NUL[...]

MySQL said:

#1452 - Cannot add or update a child row: a foreign key constraint fails (`amurt_civicrm2/civicrm_address`, CONSTRAINT `FK_civicrm_address_state_province_id` FOREIGN KEY (`state_province_id`) REFERENCES `civicrm_state_province` (`id`) ON DELETE SET NULL)

if the upgrade to 2.2.9 was ok, why does this error occur again?

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: error on upgrade 2.2.7 -> 3.0.4
February 05, 2010, 11:06:58 am

seems like thats more a mysql/innodb/shared hosting issue than a civicrm issue

as deepak suggested, your best bet would be to hire someone who can look at the error messages and make progress based on responses

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

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • error on upgrade 2.2.7 -> 3.0.4

This forum was archived on 2017-11-26.