While saving new product in admin panel I am getting this error "Unique constraint violation found"

Exception Log of this error:

Unique constraint violation found {"exception":"[object] (Magento\Framework\Exception\AlreadyExistsException(code: 0): Unique constraint violation found at /chroot/home/hannahha/esto.co.uk/html/shop/vendor/magento/framework/EntityManager/Operation/Create.php:134, Magento\Framework\DB\Adapter\DuplicateException(code: 1062): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '4294967295' for key 'PRIMARY', query was: INSERT INTO catalog_product_entity (entity_id, attribute_set_id, type_id, sku, has_options, required_options, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?)


After a lot of debugging I found the issue, I had and custom module in which I was injecting some custom functionality on the observer "catalog_product save_commit_after", which have some bug and was crashing. Due to which this error was occurring.

To fix this, I removed the bug from my custom module and after this I opened the "catalog_product_entity" table in phpmyadmin and removed the the record with the key mentioned in the exception error.

This fixed my issue.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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