I'm testing the creation of user accounts on the new website and I get a general database error after attempting to create an account. The error log shows:

Sep 14 09:06:01 test drupal_www_example_com: https://test.example.com|1505379961|php||https://test.example.com/user/register|https://test.example.com/user/register|0||PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'user-203409-0-0-und' for key 'PRIMARY': INSERT INTO {field_data_field_name_first} (entity_type, entity_id, revision_id, bundle, delta, language, field_name_first_value, field_name_first_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#012(#012
[:db_insert_placeholder_0] => user#012
[:db_insert_placeholder_1] => 203409#012
[:db_insert_placeholder_2] => 203409#012
[:db_insert_placeholder_3] => user#012
[:db_insert_placeholder_4] => 0#012 [:db_insert_placeholder_5] => und#012 [:db_insert_placeholder_6] => betachristia556#012 [:db_insert_placeholder_7] => #012)#012 in field_sql_storage_field_storage_write() (line 514 of /var/www/html/example/docroot/modules/field/modules/field_sql_storage/field_sql_storage.module).

I looked in the user table and there is no user for the ID 203409.

1 Answer 1


The field_data_field_name_first field had some data stored in it for that user ID, apparently because it was migrated in at a later time than the user table or because I didn't drop the database before I imported new data. As a result, the system couldn't write to the database user table and field_data_field_name_first table. The solution was to do a fresh import of the user table and the first and last name custom fields.

This was on a test site.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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