1062 Duplicate entry on 'media_field__uuid__value'

Created on 4 January 2023, almost 2 years ago
Updated 21 February 2023, almost 2 years ago

Problem/Motivation

Drupal 9.5.0
Migrate tools 8.x-5.2
migrate plus 8.x-5.3
media migrate 8.x-1.x-dev

on running import upgrade_d7_file_entity_image_ get a few missing. file with ID XXXX then a lot

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '70db7e51-4f81-477a-bb9d-bed58193dfdf' for key 'media_field__uuid__value': INSERT INTO "media" ("vid", "bundle", "uuid", "langcode") VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3); Array
(
[:db_insert_placeholder_0] =>
[:db_insert_placeholder_1] => image
[:db_insert_placeholder_2] => 70db7e51-4f81-477a-bb9d-bed58193dfdf
[:db_insert_placeholder_3] => en
)
(/app/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php:815)

[notice] Processed 6150 items (2171 created, 0 updated, 3979 failed, 0 ignored) - done with 'upgrade_d7_file_entity_image_'

On Rollback media and media revision tables are not emptied. A manual empty of those tables results in the same.

this was previously brought up : https://www.drupal.org/project/media_migration/issues/3203980 πŸ’¬ Duplicate entry '[UUID]' for key 'media_field__uuid__value' Closed: cannot reproduce

config file:

uuid: d981f309-db30-4e5e-99a4-907b0e510441
langcode: en
status: true
dependencies: { }
id: upgrade_d7_file_entity_image_
class: Drupal\migrate\Plugin\Migration
field_plugin_method: null
cck_plugin_method: null
migration_tags:
- 'Drupal 7'
- Content
- 'Media Migration'
- 'Media Entity'
migration_group: migrate_drupal_7
label: 'File Entity migration (Image ())'
source:
plugin: d7_file_entity_item
type: image
scheme: ''
types: image
schemes: '::public'
destination_media_type_id: image
source_field_name: field_media_image
source_field_migration_id: 'd7_file_entity_source_field_config:image'
media_migration_original_id: 'd7_file_entity:image:'
process:
track_changes_uuid:
-
plugin: migration_lookup
source: fid
migration:
- upgrade_d7_file_entity_image_
- upgrade_d7_file_entity_image_public
- upgrade_d7_file_entity_default_public
- upgrade_d7_file_entity_video_oembed
- upgrade_d7_file_entity_document_public
no_stub: true
-
plugin: skip_on_empty
method: process
-
plugin: migmag_get_entity_property
entity_type_id: media
property: uuid
oracle_uuid:
-
plugin: media_migrate_uuid
source: fid
uuid:
-
plugin: null_coalesce
source:
- '@track_changes_uuid'
- '@oracle_uuid'
uid:
-
plugin: migration_lookup
migration: upgrade_d7_user
source: uid
-
plugin: default_value
default_value: 1
bundle:
-
plugin: get
source: bundle
name:
-
plugin: get
source: filename
created:
-
plugin: get
source: timestamp
status:
-
plugin: get
source: status
field_media_image/target_id:
-
plugin: get
source: fid
field_media_image/display:
-
plugin: get
source: display
field_media_image/description:
-
plugin: get
source: description
field_media_image/width:
-
plugin: get
source: width
field_media_image/height:
-
plugin: get
source: height
thumbnail/target_id:
-
plugin: get
source: fid
thumbnail/width:
-
plugin: get
source: width
thumbnail/height:
-
plugin: get
source: height
alt_from_media:
-
plugin: skip_on_empty
source: field_file_image_alt_text
method: process
-
plugin: extract
index:
- '0'
- value
default: ''
-
plugin: default_value
default_value: null
thumbnail/alt:
-
plugin: null_coalesce
source:
- alt
- '@alt_from_media'
default_value: null
field_media_image/alt:
-
plugin: null_coalesce
source:
- alt
- '@alt_from_media'
default_value: null
title_from_media:
-
plugin: skip_on_empty
source: field_file_image_title_text
method: process
-
plugin: extract
index:
- '0'
- value
default: ''
-
plugin: default_value
default_value: null
thumbnail/title:
-
plugin: null_coalesce
source:
- title
- '@title_from_media'
default_value: null
field_media_image/title:
-
plugin: null_coalesce
source:
- title
- '@title_from_media'
default_value: null
field_metatag:
-
plugin: d7_metatag_entities
source: pseudo_metatag_entities
destination:
plugin: 'entity:media'
migration_dependencies:
required:
- upgrade_d7_file_entity_type_image
- upgrade_d7_file_entity_source_field_config_image
optional:
- upgrade_d7_user

Steps to reproduce

Proposed resolution

Remaining tasks

API changes

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States jim.shreds

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024