When I post a comment, I get the following error on Drupal 7:

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'comment-28-0-0-und' for key 'PRIMARY': INSERT INTO {field_data_comment_body} (entity_type, entity_id, revision_id, bundle, delta, language, comment_body_value, comment_body_format) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7); Array ( [:db_insert_placeholder_0] => comment [:db_insert_placeholder_1] => 28 [:db_insert_placeholder_2] => 28 [:db_insert_placeholder_3] => comment_node_multi_discussion_theme [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => und [:db_insert_placeholder_6] => test [:db_insert_placeholder_7] => ) in field_sql_storage_field_storage_write() (line 451 of /ftphome/dev_itf_events/modules/field/modules/field_sql_storage/field_sql_storage.module).

What could be the cause?

  • 1
    Have you manually deleted any database rows or truncated any tables? Have you recently copied over any development environment databases to your production site or vice versa? – jdu May 2 '14 at 15:57

Hi you have to remove the row from field_data_comment_body table where entity id is 28 ..

Not the answer you're looking for? Browse other questions tagged or ask your own question.