Site icon AWS: © LimitlessV, Software Development Solutions.

Integrity Constraint Violation: 1062 Duplicate Entry ‘4-Images’ For Key – Magento 2

Do you try to upgrade from 2.x.x to 2.x.y?
Do you have Database Issue due to magento cli?

sudo bin/magento setup:upgrade

Return during the process:

Integrity constraint violation: 1062 Duplicate entry ‘4-Images’ for key ‘EAV_ATTRIBUTE_GROUP_ATTRIBUTE_SET_ID_ATTRIBUTE_GROUP_NAME’, query was: UPDATE `eav_attribute_group` SET `attribute_group_name` = ? WHERE (`attribute_group_id`=10)

This particular error presented itself while upgrading from Magento or in some cases, installing some olds themes and stops the upgrade process.
It’s related to old data from the previous Magento 1.9.x installation.

To resolve this error, you’ll need to delete a row from the database.

Run the following MySQL query to find and delete the offending attribute.
delete from eav_attribute_group WHERE attribute_group_name = 'Images';

After that, then you can attempt to rerun the upgrade command, and the issue should be resolved.

sudo bin/magento setup:upgrade

If you’re faced with a similar issue and stuck between an upgrade, feel free to contact us to assist with your problem.

Reference:

Exit mobile version