I seem to be getting these errors when I do a fresh install and when I add a new content type.

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'application__file_styles_square_thumbnail__file_field_styles_fil' 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] => application__file_styles_square_thumbnail__file_field_styles_file_square_thumbnail [:db_insert_placeholder_1] => 0 [:db_insert_placeholder_2] => 1 [:db_insert_placeholder_3] => N; ) in drupal_write_record() (line 6884 of /home/quickstart/websites/test.dev/includes/common.inc).

Any help you can provide is appreciated. I'm running the latest 2.x-dev releases of media, file_entity, styles. This doesn't happen when the file_styles.module is disabled.

Comments

perarnet’s picture

Category: support » bug

I get the same error when enabling file_styles

drzraf’s picture

also happened to me.
what conclusion about this file view_mode handling after this error ?

DrupalDan’s picture

subscribe

SocialNicheGuru’s picture

i am getting this to and don't really know why.
is there a max length for the duplicate index?

is "application__file_styles_square_thumbnail__file_field_styles_fil" actually truncated version of a field_field_styles and that's why there is a conflict?

EDIT:
I had file_styles as a dependency for a feature. I had to remove it otherwise I'd get the pdo error that I could not get through.

I did try to delete the row in the file_display database but a new error would then pop up with another row in the file_display database

how can I debug this? any guidance would be helpful. Thank you!

denix’s picture

Issue summary: View changes

drush rr saved me after hours spent debugging. Obviously I did not find the source of the issue :(