Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I received this error after running update.php...
The following updates returned messages
masquerade module
Update #7000
Failed: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'bob-masquerade-masquerade' for key 2: UPDATE {block} SET delta=:db_update_placeholder_0 WHERE (module = :db_condition_placeholder_0) AND (delta = :db_condition_placeholder_1) ; Array ( [:db_update_placeholder_0] => masquerade [:db_condition_placeholder_0] => masquerade [:db_condition_placeholder_1] => 0 ) in masquerade_update_7000() (line 171 of /home/public_html/sites/all/modules/masquerade/masquerade.install).
Comments
Comment #1
andypostCan someone reproduce this?
Comment #2
shark CreditAttribution: shark commentedI have what appears to be the same issue.
In case it helps, here are the relevant database table rows:
Note that the blocks with IDs 375 and 679 have the same theme ("marinelli") and module ("masquerade") in the table results.
Quick Fix: I was able to get the update to run by removing the almost-duplicate row (679 in this example).
The other thing that may be unique about my situation I should note is that this happened during a Drupal upgrade (using drush site-upgrade from 6 to 7), where Marinelli theme was downloaded and upgraded (and drush had incorrectly downloaded it to the modules directory so I had to move it and enable it manually).
After masquerade_update_7000() ran without errors, my table looked as it should:
Hope that helps anyone else who might have this issue.
Comment #3
shark CreditAttribution: shark commentedAlso, I found this comment useful: http://drupal.org/node/1700662#comment-6302130
Comment #4
Jim Bacon CreditAttribution: Jim Bacon commentedUpgrading from Masquerade 6.x-1.9 to 7.x-1.0-rc7 received the error
Contents of blocks table (minus a couple of columns) as follows
Deleted block with bid=67, ran update.php again and all seems well.
Comment #5
macman CreditAttribution: macman commentedThanks kruser. Worked a treat
Comment #6
tinker CreditAttribution: tinker commentedWell this is a weird one. This module's update code (7000 and 7001) both looks fine and should not cause this problem. I too experienced this doing a D6 -> D7 upgrade. I was using drush for the upgrade. My D6 DB has the following (similar column values omitted for brevity):
But the D7 DB has:
I have no idea where bid '508' came from and bid '293' should have delta 'masquerade'. This looks to be caused by another module?
Comment #7
rossb89 CreditAttribution: rossb89 commentedCan confirm this issue as well from a Drupal 6 -> 7 site upgrade.
Haven't got time to step through exactly and see why there are 'duplicate' blocks being inserted into the database *with* the masquerade delta, thus causing masquerade_update_7000 to fail.
Confirmed that the quick fix is to delete the duplicate entries in the {block} table, maybe one day if I have more time can try and see at what point in the site upgrade process this issue occurs and can work a fix :)
Comment #8
geekinpink CreditAttribution: geekinpink commented#2 works for me ...Thanks