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

Priority:Normal» Critical

Can someone reproduce this?

I have what appears to be the same issue.

The following updates are pending:
masquerade module :
  7000 -   Update masquerade block delta.
  7001 -   Update masquerade block caching.
Do you wish to run all pending updates? (y/n): y
7000SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'marinelli-masquerade-masquerade' for key 'tmd'                          [error]
Performed update: masquerade_update_7000                                                                                                       [ok]
Finished performing updates.

In case it helps, here are the relevant database table rows:

mysql> select * from drupal_block where module = 'masquerade';
+-----+------------+------------+---------------+--------+--------+---------------+--------+------------+-------+-------+-------+
| bid | module     | delta      | theme         | status | weight | region        | custom | visibility | pages | title | cache |
+-----+------------+------------+---------------+--------+--------+---------------+--------+------------+-------+-------+-------+
|  60 | masquerade | masquerade | acquia_marina |      1 |      0 | sidebar_first |      0 |          0 | blank |       |    -1 |
|  69 | masquerade | masquerade | nitobe        |      0 |    -21 |               |      0 |          0 | blank |       |    -1 |
|  88 | masquerade | masquerade | rubik         |      0 |     -5 |               |      0 |          0 | blank |       |    -1 |
| 112 | masquerade | masquerade | absynthe      |      0 |      0 |               |      0 |          0 | blank |       |    -1 |
| 125 | masquerade | masquerade | beach         |      0 |      0 |               |      0 |          0 | blank |       |    -1 |
| 149 | masquerade | masquerade | tma           |      0 |      0 |               |      0 |          0 | blank |       |    -1 |
| 173 | masquerade | masquerade | garland       |      0 |      0 |               |      0 |          0 | blank |       |    -1 |
| 344 | masquerade | masquerade | magazeen      |      0 |    -21 |               |      0 |          0 | blank |       |    -1 |
| 375 | masquerade | 0          | marinelli     |      0 |    -21 |               |      0 |          0 | blank |       |    -1 |
| 418 | masquerade | 0          | custom        |      0 |    -21 | sidebar_first |      0 |          0 | blank |       |    -1 |
| 679 | masquerade | masquerade | marinelli     |      0 |      0 | -1            |      0 |          0 |       |       |    -1 |
+-----+------------+------------+---------------+--------+--------+---------------+--------+------------+-------+-------+-------+

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:

mysql> select * from drupal_block where module = 'masquerade';
+-----+------------+------------+---------------+--------+--------+---------------+--------+------------+-------+-------+-------+
| bid | module     | delta      | theme         | status | weight | region        | custom | visibility | pages | title | cache |
+-----+------------+------------+---------------+--------+--------+---------------+--------+------------+-------+-------+-------+
|  60 | masquerade | masquerade | acquia_marina |      1 |      0 | sidebar_first |      0 |          0 | blank |       |    -1 |
|  69 | masquerade | masquerade | nitobe        |      0 |    -21 |               |      0 |          0 | blank |       |    -1 |
|  88 | masquerade | masquerade | rubik         |      0 |     -5 |               |      0 |          0 | blank |       |    -1 |
| 112 | masquerade | masquerade | absynthe      |      0 |      0 |               |      0 |          0 | blank |       |    -1 |
| 125 | masquerade | masquerade | beach         |      0 |      0 |               |      0 |          0 | blank |       |    -1 |
| 149 | masquerade | masquerade | tma           |      0 |      0 |               |      0 |          0 | blank |       |    -1 |
| 173 | masquerade | masquerade | garland       |      0 |      0 |               |      0 |          0 | blank |       |    -1 |
| 344 | masquerade | masquerade | magazeen      |      0 |    -21 |               |      0 |          0 | blank |       |    -1 |
| 375 | masquerade | masquerade | marinelli     |      0 |    -21 |               |      0 |          0 | blank |       |    -1 |
| 418 | masquerade | masquerade | custom        |      0 |    -21 | sidebar_first |      0 |          0 | blank |       |    -1 |
+-----+------------+------------+---------------+--------+--------+---------------+--------+------------+-------+-------+-------+

Hope that helps anyone else who might have this issue.

Also, I found this comment useful: http://drupal.org/node/1700662#comment-6302130