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

Product Saving Error - Integrity constraint violation: 1452
 
salbertson
Jr. Member
 
Total Posts:  27
Joined:  2008-05-04
 

I am running version 1.0.19870.6 and had a solid install until importing a csv file to update prices. The csv has three columns; store, sku, and price. Now when adding products I get a “Product Saving Error” banner and stack trace output. Here is the output of my stack trace:

Cannot send headersheaders already sent in /usr/local/www/clients/magento/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.phpline 351
Trace
:
#0 /usr/local/www/clients/magento/lib/Zend/Controller/Response/Abstract.php(147): Zend_Controller_Response_Abstract->canSendHeaders(true)
#1 /usr/local/www/clients/magento/app/code/core/Mage/Adminhtml/Controller/Action.php(290): Zend_Controller_Response_Abstract->setRedirect('http://www.doll...')
#2 /usr/local/www/clients/magento/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php(361): Mage_Adminhtml_Controller_Action->_redirect('*/*/edit', Array)
#3 /usr/local/www/clients/magento/app/code/core/Mage/Core/Controller/Varien/Action.php(342): Mage_Adminhtml_Catalog_ProductController->saveAction()
#4 /usr/local/www/clients/magento/app/code/core/Mage/Core/Controller/Varien/Router/Admin.php(148): Mage_Core_Controller_Varien_Action->dispatch('save')
#5 /usr/local/www/clients/magento/app/code/core/Mage/Core/Controller/Varien/Front.php(146): Mage_Core_Controller_Varien_Router_Admin->match(Object(Mage_Core_Controller_Request_Http))
#6 /usr/local/www/clients/magento/app/Mage.php(427): Mage_Core_Controller_Varien_Front->dispatch()
#7 /usr/local/www/clients/magento/index.php(40): Mage::run()
#8 {main}

Here is the output the actual exception being thrown:

exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`magento_dollhouses/catalog_product_entity_varchar`, CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_VARCHAR_PRODUCT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity_orig` (`entity_i)' in /usr/local/www/clients/magento/lib/Zend/Db/Statement/Pdo.php:238

Any help is greatly appreciated, thanks.

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