1

Something went wrong while saving the category.SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (mydb.catalog_category_product, CONSTRAINT CAT_CTGR_PRD_PRD_ID_SEQUENCE_PRD_SEQUENCE_VAL FOREIGN KEY (product_id) REFERENCES sequence_product (sequence_value) ON DELETE CA), query was: INSERT INTO catalog_category_product (category_id,product_id,position) VALUES (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?)

Getting this error when trying to add any product to category.

I have already try with re-indexing, url regenerate, but still not working.

3
  • let me know magento 2 version? Commented Nov 21, 2018 at 12:25
  • have you installed (or) override any custom modules related to products or categories? did you do any customization related to products/ categories? Commented Nov 21, 2018 at 12:26
  • Magento ver. 2.1.14, I haven't don't any customization. Ihave also try to disable all custom modules, but still not working Commented Nov 21, 2018 at 14:03

1 Answer 1

0

You need to delete the product and create it again.

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.