Problem/Motivation

Migration error out with following message:

ResponseText: The website encountered an unexpected error. Try again later.Drupal\Core\Database\IntegrityConstraintViolationException: SQLSTATE[23000]: 
Integrity constraint violation: 1062 Duplicate entry '55746-131111-0-0-fr' for key 'PRIMARY': INSERT INTO "media_revision__acquia_dam_asset_id" 
("bundle", "deleted", "entity_id", "revision_id", "langcode", "delta", "acquia_dam_asset_id_asset_id")
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

chandu7929 created an issue. See original summary.

marcos_lima’s picture

Status: Active » Needs review
StatusFileSize
new753 bytes

We had the same problem here, with the migration failing on our multilingual installation, and came to the same solution as proposed in the MR, after a round o debugging. With the fetchAllAssoc(), the code aggregates results by language and in the second loop of the batch it breaks because it tries to process a record that was already processed, since the range will be off because of the aggregation. The proposed fix worked well for our use case.

I'll attach a patch if anyone else needs a quick fix via composer patches, like we did. I'll also me moving the issue to Needs Review, but for me it is +1 vote for RTBC.

  • japerry committed 58b67c05 on 2.x authored by chandu7929
    [#3549509] feat: Migration issue to Acquia DAM module for multilingual...
japerry’s picture

Status: Needs review » Fixed

Thanks Marcos! Merged into 2.x

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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