PDO Integrity constraint [error] violation: 1062 Duplicate entry 'image__default__file_field_picture' for key 'PRIMARY'

Created on 7 January 2015, about 10 years ago
Updated 19 September 2023, over 1 year ago

Using Drush to update from 2.7 to 2.9:

Performed update: flexslider_picture_update_7001                     [ok]
WD php: PDOException: SQLSTATE[23000]: Integrity constraint          [error]
violation: 1062 Duplicate entry 'image__default__file_field_picture'
for key 'PRIMARY': INSERT INTO {file_display} (name, weight, status,
settings) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1,
:db_insert_placeholder_2, :db_insert_placeholder_3); Array
(
    [:db_insert_placeholder_0] => image__default__file_field_picture
    [:db_insert_placeholder_1] => 0
    [:db_insert_placeholder_2] => 1
    [:db_insert_placeholder_3] =>
a:4:{s:20:"fallback_image_style";s:0:"";s:10:"image_link";s:0:"";s:8:"colorbox";s:21:"***_mapping";s:15:"picture_mapping";s:21:"***_mapping";}
)
 in drupal_write_record() (line 7239 of
***/htdocs/includes/common.inc).

Note the **** are redactions.

So the actual 2.9 db change works, but then some other code tries to add the "image__default__file_field_picture" record and fails.

Because file_display table already has (and "name" field is the primary key):
name: image__default__file_field_picture
weight: -47
status: 0
settings: a:4:{s:15:"picture_mapping";s:21:"***_mapping";s:20:"fallback_image_style";s:5:"large";s:10:"image_link";s:0:"";s:8:"colorbox";s:21:"***_mapping";}

Thoughts?

πŸ› Bug report
Status

Closed: outdated

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States Todd Zebert Los Angeles, CA

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