Import csv - Duplicate entry

I intend to import CSV File but there is errors An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘’ for key ‘PRIMARY’

and I don’t have duplicate key id in my csv file… what happen ?

thank for your help

I can’t modify ID in my entity

Hello @Belette64
We will look into it

That SQL error usually means the INSERT is sending an empty value to the ID/primary-key column, not that the CSV contains a duplicate ID. Since you can’t edit ID in the entity, check the import mapping: remove or skip any ID column, and make sure the import action is “create” rather than “update” by ID. If the ID is meant to be generated automatically, the entity’s ID field should be auto-increment/read-only. The import log or failing query should show which field is being written as blank.

@Belette64 Thank you for your patience. The error means that an empty value is being written to the ID field, not that your file contains duplicate IDs. First, please check whether a record with an empty ID was created during the failed import, and if so, delete it. Then, since the ID is generated automatically, remove the mapping of your CSV column to the ID field in the import feed and try the import again. If the issue persists, please send us a few lines of your file and a screenshot of the import feed configuration.

If you need your own identifier, you can create a separate field for it (for example, with the “Unique” option enabled) and use it to identify existing records when updating.