system_update_7007() failed, it didn't finish. drush updatedb is constantly spawning the thing until it gives up, the most important part of the error: "Integrity constraint violation: 1062 Duplicate entry"
After inspection I found out a permission was occurring twice in the D6 permission table.
I'm not sure if this can happen a lot, but I don't recall doing anything weird on this D6 site.
It seems to help to add array_unique() as such:
foreach (array_unique(explode(', ', $role->perm)) as $perm) {
If these double permissions are more common it could be nice to patch this - especially as more people will want to upgrade their D6 to D7.
Comments
Comment #1
okokokok commentedWorking on another site and encountering the exact same issue, with the exact same fix.
Here's the thing as a patch:
Comment #2
moskito commentedSolution #1 solve it.
Comment #3
webchickWe need a real patch so we can run it through testbot. There are instructions for creating those at http://drupal.org/node/707484. We should also add duplicate permission to the upgrade test DB dumps to show this error occurring, and to show that the proposed fix fixes it.
Comment #4
iamEAP commentedI actually just ran into this myself on a very large upgrade.
Attaching #1 as a patch to see what testbot thinks of it. I will simultaneously be re-running my upgrade to see if it fixes it for me.
Comment #5
iamEAP commentedCan confirm this worked on my personal upgrade as well. Never written a test before, but willing to give it a shot.
Comment #6
okokokok commentedSame thing happening on another upgrade from 6 to 7.
The patch fixed it again.
Comment #7
aspilicious commentedI don't see anything wrong with this patch and if it helps people upgrading I'm not against it...
Comment #8
webchickHm. IMO we should have some test coverage for this condition, unless there's a really compelling reason not to.
Comment #9
iamEAP commentedPatch with test only should fail. Patch with both test and the array_unique() fix should pass.
Comment #10
iamEAP commentedTagging D7 upgrade path for wider visibility.
Comment #11
iamEAP commentedEdit: double-post.
Comment #12
okokokok commentedI keep on losing time on this. The very descriptive error I got doing drush updatedb was this:
"SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '3-opt-in or out of tracking' for key 'PRIMARY'"
Finally gave this patch a try and... it worked.
Please apply the patch.
Comment #13
rsbecker commentedI hate to revive this, but why has the patch not been included in 7.16?
Comment #14
iamEAP commented#9: d7-system_update_7007-1475342-9.patch queued for re-testing.
Comment #15
leo pitt commentedRan into this problem upgrading to 7.20 - and the patch in #1 seems to have solved it. Please apply
Comment #16
David_Rothstein commentedComment #17
iamEAP commented#9: d7-system_update_7007-1475342-9.patch queued for re-testing.
Comment #18
pandaski commentedFixed my issue while upgrade from 6.x to 7.20
Comment #19
iamEAP commentedI'm counting 4 thumbs up on this. Marking RTBC in hopes of getting it in to the next bugfix release.
Comment #20
David_Rothstein commentedYup, looks good. Committed to 7.x - thanks! http://drupalcode.org/project/drupal.git/commit/851bcf1