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? 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? 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 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 that you have read and understand our privacy policy and code of conduct.

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