update.php gives me lots of errors when trying to update version from 5.9 to version 6.3:

* user warning: Duplicate entry 'musimac-profile-0' for key 2 query: ALTER TABLE blocks CHANGE theme `theme` VARCHAR(64) NOT NULL DEFAULT '', ADD UNIQUE KEY tmd (theme, module, delta), ADD INDEX list (theme, status, region, weight, module) in /var/gabble/drupal6/includes/database.mysql-common.inc on line 520.

* user warning: Duplicate entry '2-php-0' for key 2 query: ALTER TABLE filters ADD UNIQUE KEY fmd (format, module, delta) in /var/gabble/drupal6/includes/database.mysql-common.inc on line 403.

* user warning: Duplicate entry '2237-0' for key 1 query: ALTER TABLE locales_target ADD PRIMARY KEY (language, lid, plural) in /var/gabble/drupal6/includes/database.mysql-common.inc on line 374.

* user warning: Duplicate entry '214-0-151.49.228.123' for key 1 query: ALTER TABLE poll_votes ADD PRIMARY KEY (nid, uid, hostname) in /var/gabble/drupal6/includes/database.mysql-common.inc on line 374.

* user warning: Duplicate entry '6-2' for key 1 query: ALTER TABLE profile_values ADD PRIMARY KEY (uid, fid) in /var/gabble/drupal6/includes/database.mysql-common.inc on line 374.

And short after:

Update #6043

* Failed: ALTER TABLE {blocks} CHANGE theme `theme` VARCHAR(64) NOT NULL DEFAULT '', ADD UNIQUE KEY tmd (theme, module, delta), ADD INDEX list (theme, status, region, weight, module)

* Failed: ALTER TABLE {filters} ADD UNIQUE KEY fmd (format, module, delta)

* Failed: ALTER TABLE {locales_target} ADD PRIMARY KEY (language, lid, plural)

* Failed: ALTER TABLE {poll_votes} ADD PRIMARY KEY (nid, uid, hostname)

* Failed: ALTER TABLE {profile_values} ADD PRIMARY KEY (uid, fid)

My drupal 5.9 works fine, and I have setup a 6.3 test site with no luck (no contrib modules restored to 6.3 yet, just my old theme directory).

Details:
Apache/2.2.9 (Debian) PHP/5.2.6-2 with Suhosin-Patch mod_perl/2.0.4 Perl/v5.10.0
MySQL 5.0.51a

Can anybody help me debug the issue?

Thanks a lot in advance.
Gabble

Comments

gabble’s picture

No ideas?
Do I have to make incremental upgrades?
5.9 -> 6.0 -> 6.1 -> 6.2 -> 6.3 ??

Mmh…

pasqualle’s picture

you do not need an incremental upgrade

did you modify the drupal core? maybe some contrib modules are handling the data incorrectly..

you should check these selects

SELECT theme, module, delta, COUNT(*) FROM blocks GROUP BY theme, module, delta HAVING COUNT(*) > 1;
SELECT format, module, delta, COUNT(*) FROM filters GROUP BY format, module, delta HAVING COUNT(*) > 1;
SELECT language, lid, plural, COUNT(*) FROM locales_target GROUP BY language, lid, plural HAVING COUNT(*) > 1;
SELECT nid, uid, hostname, COUNT(*) FROM poll_votes GROUP BY nid, uid, hostname HAVING COUNT(*) > 1;
SELECT uid, fid, COUNT(*) FROM profile_values GROUP BY uid, fid HAVING COUNT(*) > 1

they should not return any rows, not even in Drupal 5.9

you should delete the duplicates from the database, or on the corresponding drupal user interface..

gabble’s picture

Thank you, I'll check it out!

Anyway, I have lots of contrib modules in 5.9, but installed a fresh 6.3 with no contrib modules in place yet.
So I guess I have to run those queries against the 5.9 database before trying to upgrade, right?

pasqualle’s picture

yes, it have to be fixed before the upgrade in the 5.9 database

gabble’s picture

Thank you, I'll let you know!

manuel garcia’s picture

I'm seeing similar messages after runing update.php from 5.10 to 6.4

These are the two warnings we get after runing update.php:

 * user warning: Duplicate entry 'abacus-menu-menu-nice-menu-alumn' for key 2 query: ALTER TABLE blocks CHANGE theme `theme` VARCHAR(64) NOT NULL DEFAULT '', ADD UNIQUE KEY tmd (theme, module, delta), ADD INDEX list (theme, status, region, weight, module) in /var/data/drupal/includes/database.mysql-common.inc on line 520.

    * user warning: Duplicate entry '1-0' for key 1 query: ALTER TABLE locales_target ADD PRIMARY KEY (language, lid, plural) in /var/data/drupal/includes/database.mysql-common.inc on line 374.

And I find duplicate entries in both locales_target and blocks tables, only after the update. My guess is I should just remove those rows after the upgrade, correct?

ainigma32’s picture

Status: Active » Fixed

Judging from the track it looks like Manuel Garcia removed the duplicate rows. The other issue seems resolved as well so I'm setting this to fixed.

Feel free to reopen if you think that is wrong.

- Arie

manuel garcia’s picture

Yup, I did remove the items manualy, and we ported fully to d6 (sorry for lack of update on this), everything seems to be ok so far.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

deverman’s picture

Version: 6.3 » 6.8

I am having similar issues and I posted at this location:

http://drupal.org/node/333494#comment-1197885

gabble’s picture

Title: Unable to upgrade from 5.9 to 6.3!! » Unable to upgrade from 5.latest to 6.latest!!
Version: 6.8 » 6.10
Component: other » database system
Status: Closed (fixed) » Active

I am now at 5.16 trying to upgrade to 6.10, errors are the same, even with no contrib modules in place yet.

The queries you suggested:

SELECT theme, module, delta, COUNT(*) FROM blocks GROUP BY theme, module, delta HAVING COUNT(*) > 1;
SELECT format, module, delta, COUNT(*) FROM filters GROUP BY format, module, delta HAVING COUNT(*) > 1;
SELECT language, lid, plural, COUNT(*) FROM locales_target GROUP BY language, lid, plural HAVING COUNT(*) > 1;
SELECT nid, uid, hostname, COUNT(*) FROM poll_votes GROUP BY nid, uid, hostname HAVING COUNT(*) > 1;
SELECT uid, fid, COUNT(*) FROM profile_values GROUP BY uid, fid HAVING COUNT(*) > 1;

return dozens and dozens of duplicates.

I am no MySQL guru, and I cannot guess how to delete those duplicates.
I have spent many hours googling around, but I am still confused.

Could you please help me out and guide me through the necessary steps I have to take?

Thank you so much! :-(

dpearcefl’s picture

Status: Active » Postponed (maintainer needs more info)

Is this still an active issue?

dpearcefl’s picture

Status: Postponed (maintainer needs more info) » Active
kars-t’s picture

Status: Active » Fixed

Hi

I am closing this issue to clean up the issue queue. Feel free to reopen the issue if there is new information and the problem still resides. If not please make sure you close your issues that you don't need any more.

Maybe you can get support from the local user group. Please take a look at this list at groups.drupal.org.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.