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) »
  • DB error on 3.4.5 to 4.1.1 upgrade (drupal6)
Pages: [1] 2

Author Topic: DB error on 3.4.5 to 4.1.1 upgrade (drupal6)  (Read 3560 times)

jeffw

  • I post occasionally
  • **
  • Posts: 32
  • Karma: 1
  • CiviCRM version: 4.1.1
  • CMS version: Drupal 6.20
  • MySQL version: 5.0.77
  • PHP version: 5.3.3
DB error on 3.4.5 to 4.1.1 upgrade (drupal6)
March 13, 2012, 01:53:00 am
Didn't see this one anywhere.  The upgrade fails with:

Cannot execute ALTER TABLE civicrm_pcp_block DROP FOREIGN KEY FK_civicrm_pcp_block_entity_id, DROP INDEX FK_civicrm_pcp_block_entity_id: DB Error: a515ac9c2796ca0e23adbe92c68fc9fc

Not sure where to look.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: DB error on 3.4.5 to 4.1.1 upgrade (drupal6)
March 13, 2012, 07:28:08 am
Looks like it may be a small corruption in your DB. I would ask your host if they can assist.
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.

jeffw

  • I post occasionally
  • **
  • Posts: 32
  • Karma: 1
  • CiviCRM version: 4.1.1
  • CMS version: Drupal 6.20
  • MySQL version: 5.0.77
  • PHP version: 5.3.3
Re: DB error on 3.4.5 to 4.1.1 upgrade (drupal6)
March 13, 2012, 05:15:36 pm
Hmm, mysqlcheck reports no errors, although this is of course the backup of the actual database that was run against.  Guess I'll just try it again.

Could this be caused by somebody actually using the database at the time?

jeffw

  • I post occasionally
  • **
  • Posts: 32
  • Karma: 1
  • CiviCRM version: 4.1.1
  • CMS version: Drupal 6.20
  • MySQL version: 5.0.77
  • PHP version: 5.3.3
Re: DB error on 3.4.5 to 4.1.1 upgrade (drupal6)
March 14, 2012, 02:06:41 am
Tried it again, same error:
Cannot execute ALTER TABLE civicrm_pcp_block DROP FOREIGN KEY FK_civicrm_pcp_block_entity_id, DROP INDEX FK_civicrm_pcp_block_entity_id: DB Error: a515ac9c2796ca0e23adbe92c68fc9fc

Ran mysqlcheck on the db after I got the error and it didn't find any problems.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: DB error on 3.4.5 to 4.1.1 upgrade (drupal6)
March 14, 2012, 02:09:06 am
I would ask your host or sysadmin if they can assist, as this is an error generated from executing an SQL query,, which appears to be a valid query.
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.

jeffw

  • I post occasionally
  • **
  • Posts: 32
  • Karma: 1
  • CiviCRM version: 4.1.1
  • CMS version: Drupal 6.20
  • MySQL version: 5.0.77
  • PHP version: 5.3.3
Re: DB error on 3.4.5 to 4.1.1 upgrade (drupal6)
March 15, 2012, 10:31:57 pm
I am the sysadmin.  Shouldn't mysqlcheck tell me if there's something wrong with the database?  Mysqld log has no errors.

Looks like somebody had a similar issue in 2010, guess I'll try what they did, even though nobody reported success or failure:


http://forum.civicrm.org/index.php?topic=15627.0

jeffw

  • I post occasionally
  • **
  • Posts: 32
  • Karma: 1
  • CiviCRM version: 4.1.1
  • CMS version: Drupal 6.20
  • MySQL version: 5.0.77
  • PHP version: 5.3.3
Re: DB error on 3.4.5 to 4.1.1 upgrade (drupal6)
March 16, 2012, 02:29:42 am
Ok, I completely rebuilt my database using civicrm/sql/civicrm.mysql and mysqldump.  Still getting Cannot execute ALTER TABLE civicrm_pcp_block DROP FOREIGN KEY FK_civicrm_pcp_block_entity_id, DROP INDEX FK_civicrm_pcp_block_entity_id: DB Error: a515ac9c2796ca0e23adbe92c68fc9fc

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: DB error on 3.4.5 to 4.1.1 upgrade (drupal6)
March 16, 2012, 09:38:20 am

1. Can you ensure that your are restoring a 3.4.5 dump

2. Can you go into mysql shell and do a "show create table civicrm_pcp_block" and see if the constraint is present?

it is present in a clean schema install for 3.4.x

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

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: DB error on 3.4.5 to 4.1.1 upgrade (drupal6)
March 18, 2012, 12:26:43 pm
Another report of the same error: http://forum.civicrm.org/index.php/topic,23920.0.html ....
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.

jeffw

  • I post occasionally
  • **
  • Posts: 32
  • Karma: 1
  • CiviCRM version: 4.1.1
  • CMS version: Drupal 6.20
  • MySQL version: 5.0.77
  • PHP version: 5.3.3
Re: DB error on 3.4.5 to 4.1.1 upgrade (drupal6)
March 18, 2012, 11:01:36 pm
I used the civicrm/sql/civicrm.mysql from the existing code, and the dump from the existing database.  Powered by CiviCRM 3.4.5 at bottom of page.

Here are the table specs, looks like the FK is there before the upgrade runs:

mysql> show create table civicrm_pcp_block;
+-------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table             | Create Table                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
+-------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| civicrm_pcp_block | CREATE TABLE `civicrm_pcp_block` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'PCP block Id',
  `entity_table` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
  `entity_id` int(10) unsigned NOT NULL COMMENT 'FK to civicrm_contribution_page.id',
  `supporter_profile_id` int(10) unsigned DEFAULT NULL COMMENT 'FK to civicrm_uf_group.id. Does Personal Campaign Page require manual activation by administrator? (is inactive by default after setup)?',
  `is_approval_needed` tinyint(4) DEFAULT NULL COMMENT 'Does Personal Campaign Page require manual activation by administrator? (is inactive by default after setup)?',
  `is_tellfriend_enabled` tinyint(4) DEFAULT NULL COMMENT 'Does Personal Campaign Page allow using tell a friend?',
  `tellfriend_limit` int(10) unsigned DEFAULT NULL COMMENT 'Maximum recipient fields allowed in tell a friend',
  `link_text` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Link text for PCP.',
  `is_active` tinyint(4) DEFAULT '1' COMMENT 'Is Personal Campaign Page Block enabled/active?',
  `notify_email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'If set, notification is automatically emailed to this email-address on create/update Personal Campaign Page',
  PRIMARY KEY (`id`),
  KEY `FK_civicrm_pcp_block_entity_id` (`entity_id`),
  KEY `FK_civicrm_pcp_block_supporter_profile_id` (`supporter_profile_id`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci |
+-------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.03 sec)

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: DB error on 3.4.5 to 4.1.1 upgrade (drupal6)
March 19, 2012, 05:50:56 am
As a test, can you run just the ALTER TABLE command in mysql, directly against the DB?
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.

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: DB error on 3.4.5 to 4.1.1 upgrade (drupal6)
March 19, 2012, 10:49:09 am

the FK is typically represented as a constraint in mysql. Seems like the KEY is there but not the FK

was there a conversion of this DB from Inno -> MyISAM -> Inno?

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

jeffw

  • I post occasionally
  • **
  • Posts: 32
  • Karma: 1
  • CiviCRM version: 4.1.1
  • CMS version: Drupal 6.20
  • MySQL version: 5.0.77
  • PHP version: 5.3.3
Re: DB error on 3.4.5 to 4.1.1 upgrade (drupal6)
March 19, 2012, 04:20:04 pm
I know that YEARS ago  there was some issue with foreign keys and it was dealt with by somebody else, so perhaps that has to do with it, though I've done several upgrades since.  What I don't understand is why the constraint wouldn't be there when I built the db from scratch.

We were contemplating going ahead with the drupal upgrade and trying it again after that, but that doesn't really help us here, does it?  I can also add the constraint and retry the upgrade in test.

jeffw

  • I post occasionally
  • **
  • Posts: 32
  • Karma: 1
  • CiviCRM version: 4.1.1
  • CMS version: Drupal 6.20
  • MySQL version: 5.0.77
  • PHP version: 5.3.3
Re: DB error on 3.4.5 to 4.1.1 upgrade (drupal6)
March 20, 2012, 01:00:29 am
Looks like the problem was a result of using phpmyadmin to copy around the database; you are apparently supposed to check a box that says "add constraints" or it gets rid of them.  However, if you DO check "add constraints," it bombs.  So apparently phpmyadmin is useless for this purpose.

Seems like the default behavior should be to preserve constraints that are already there.  In any case, sorry for wasting people's time.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: DB error on 3.4.5 to 4.1.1 upgrade (drupal6)
March 20, 2012, 03:52:01 am
Quote from: jeffw on March 20, 2012, 01:00:29 am
Looks like the problem was a result of using phpmyadmin to copy around the database; you are apparently supposed to check a box that says "add constraints" or it gets rid of them.  However, if you DO check "add constraints," it bombs.  So apparently phpmyadmin is useless for this purpose.

I don't know that it's useless for this--I have copied and migrated and updated many sites using phpMyAdmin. Perhaps it depends on your version.

Quote from: jeffw on March 20, 2012, 01:00:29 am
Seems like the default behavior should be to preserve constraints that are already there.  In any case, sorry for wasting people's time.

Not a waste of time--if someone else has this same problem, this thread will be very helpful in debugging--perhaps some versions of phpMyAdmin do have a bug...
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.

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • DB error on 3.4.5 to 4.1.1 upgrade (drupal6)

This forum was archived on 2017-11-26.