I updated to more recient version of the module and this error presented during the database update. I am unable to sync my lists during cron. there are no errors but no new members either.

Update #7202
Failed: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'pixture_reloaded-mailchimp_lists-home_users' for key 'tmd': UPDATE {block} SET delta=:db_update_placeholder_0 WHERE (bid = :db_condition_placeholder_0) ; Array ( [:db_update_placeholder_0] => home_users [:db_condition_placeholder_0] => 148 ) in mailchimp_lists_update_7202() (line 250 of /sites/all/modules/mailchimp/modules/mailchimp_lists/mailchimp_lists.install)

Members fund testing for the Drupal project. Drupal Association Learn more


redrex’s picture

I get the error message too.

Beanjammin’s picture

Category: support » bug

I'm hitting a similar, but different, error with the same update 7202:

The following updates are pending:

mailchimp_lists module : 
  7202 -   Convert block deltas from ID numbers to machine names. 

Do you wish to run all pending updates? (y/n): y
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'delta' cannot be null                                                                          [error]
Performed update: mailchimp_lists_update_7202                                                                                                                [ok]
Finished performing updates.

Switching from support request to bug.

Beanjammin’s picture

In broad terms the update is making assumptions about the database that do not necessary hold up.

I was able to get past my own issue from #2 with the attached patch, however the issue from the op is different. It looks like chubbell has at least two blocks with the same name, so when the update tries to swap the block name for the delta it causes the integrity constraint violation on the tmd index. A test will need to be added to check for duplicate block names and to increment the name until it's unique before doing the block table update.

donwinchell’s picture

I am also getting the failure error of Integrity constraint violation: 1048 Column 'delta' cannot be null
I have attached a screenshot of my table condition.
I have tried the patch in #3 with following results.

patch mailchimp.install < mailchimp_lists-1775516-1.patch
patching file mailchimp.install
Hunk #1 FAILED at 240.
1 out of 1 hunk FAILED -- saving rejects to file mailchimp.install.rej
please see attachment, but basically I have 3 rows with null in the delta column .
Quick question, can I just delete these rows ?

levelos’s picture

Status: Active » Closed (fixed)
jaapjansma’s picture

Status: Closed (fixed) » Active

I did a Drupal update from 7.x tot 7.19 and updated the libraries module to 7.1.x to 7.2.x after that i updated the Mailchimp module to the latest version. And during the database update the update 7202 said delete 2 duplicated blocks. After that my subscription forms which were displayed in a block disappeared.

After hours and hours of trying to understand the problem I discovered that the updated deletes records from the block tabel. Inserting the deleted records from a backup did the trick.

levelos’s picture

Status: Active » Closed (fixed)
levelos’s picture

Issue summary: View changes

removed unnecessary path information