Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Integrity constraint violation when updating products
 
stopsatgreen
Jr. Member
 
Total Posts:  20
Joined:  2009-06-01
 

I’ve migrated my site to a production server and all seems to have gone well apart from one problem: I can’t save changes to products. When I do I get the following error:

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`folk_magento/catalogindex_minimal_price`, CONSTRAINT `FK_CATALOGINDEX_MINIMAL_PRICE_CUSTOMER_GROUP` FOREIGN KEY (`customer_group_id`) REFERENCES `customer_group` (`customer_group_id`) ON DELE)

I’ve searched the forum and found two suggestions, neither of which worked; first was to make sure my tables are InnoDB (they are), second to run a SQL query to find errors. The query is this:

SELECT FROM catalog_category_product_index
LEFT JOIN catalog_product_entity
ON catalog_category_product_index
.product_id catalog_product_entity.entity_id
WHERE catalog_product_entity
.entity_id IS NULL

I’ve run it as is, but I need to change it to match my particular problem; however, I don’t know what changes I need to make - or, indeed, if this is even the right solution.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Matt Bourne
Jr. Member
 
Total Posts:  4
Joined:  2007-09-08
 

plus one on this let me know if you find a fix

 
Magento Community Magento Community
Magento Community
Magento Community
 
LeeSaferite
Guru
 
Avatar
Total Posts:  322
Joined:  2007-08-31
Lake City, FL
 

See: http://www.magentocommerce.com/boards/viewthread/37390/#t161435

You probably have a broken SQL import.  Check the customer_group table, the ‘NOT LOGGED IN’ group should have the ID of 0.

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