Magento Forum

   
SQLSTATE[HY000]: General error: 1452 Cannot add or update a child row: a foreign key constraint fails
 
s_russell
Jr. Member
 
Total Posts:  1
Joined:  2011-05-07
 

I am getting a strange error while updating product info for my magento store.

Error is : SQLSTATE[HY000]: General error: 1452 Cannot add or update a child row: a foreign key constraint fails (`odesk_trainerprofile`.`catalog_category_product_index`, CONSTRAINT `FK_CATALOG_CATEGORY_PROD_IDX_CATEGORY_ENTITY` FOREIGN KEY (`category_id`) REFERENCES `catalog_category_entity` (`entity_id`)

I have several store view and in those stores I sevaral product some time I need to move the general product to some of the specific store. But when I tries to move the products to the another store view and change some product info especially when I change the Status of the product the it shows me the above error..

Can anyone please help me out of this scenario..  I have tried several approach to solve this issue but could not find any.

Image Attachments
magento-error.png
 
Magento Community Magento Community
Magento Community
Magento Community
 
bpapenbr
Jr. Member
 
Total Posts:  16
Joined:  2008-10-03
 

Same issue!  Anyone out there solve this?

 
Magento Community Magento Community
Magento Community
Magento Community
 
hxd
Sr. Member
 
Avatar
Total Posts:  224
Joined:  2011-02-03
 

You can find more information and a possible solution to this issue here:

How to fix the error “1452 - Cannot add or update a child row: a foreign key constraint fails” in Magento

 
Magento Community Magento Community
Magento Community
Magento Community
 
developerindia
Member
 
Total Posts:  57
Joined:  2009-06-25
 

When I try to create Duplicat product I go this error

SQLSTATE[HY000]: General error: 1452 Cannot add or update a child row: a foreign key constraint fails (`petsportsgear/catalog_product_entity_int`, CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_INT_STORE_ID_CORE_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASC)

Any idea how can I fix this?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top