Dunc
Total Posts: 56
Joined: 2008-08-05
If anybody can help with this error it would be appreciated. I have updated to 1.2.1.1 after several attempts, during one of those attempts I followed the solution to overcome another database error which I think might now be causing this one. The installation all went ok but if I make any changes in the Inventory section of Configuration, this error appears…
SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`dpotter_esds/cataloginventory_stock_status`, CONSTRAINT `FK_CATALOGINVENTORY_STOCK_STATUS_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCA)
The table cataloginventory_stock_status is empty, is that correct? If this can’t be fixed is there a way to just show all products as available as I do not use stock levels, currently the site is showing all products as out of stock, any help would be appreciated.
Thanks
Duncan
Signature
http://www.electricshowersdirect.com
Posted: February 27 2009
| top
Dunc
Total Posts: 56
Joined: 2008-08-05
Is anybody able to reply to this? I’m fearing I’m going to have to re-enter all my products but I wondered if there was a query I could run on MySQL?
Signature
http://www.electricshowersdirect.com
Posted: March 2 2009
| top
| # 1
harry12bar
Total Posts: 168
Joined: 2008-01-07
Hi, Have same strange problem… can u let me know what you did in phpmyadmin… Thx
Posted: March 13 2009
| top
| # 3
tommmy
Total Posts: 6
Joined: 2008-08-13
I experience the same problem after updating to 1.1.3
Error in file : "C:\xampp\htdocs\app\code\core\Mage\CatalogInventory\sql\cataloginventory_setup\mysql4-upgrade-0.7.4-0.7.5.php" - SQLSTATE[HY000] : General error : 1452 Cannot add or update a child row : a foreign key constraint fails (` magento `.` cataloginventory_stock_status `, CONSTRAINT ` FK_CATALOGINVENTORY_STOCK_STATUS_PRODUCT ` FOREIGN KEY (` product_id `) REFERENCES ` catalog_product_entity ` (` entity_id `) ON DELETE CASCADE ) Trace : #0 C:\xampp\htdocs\app\code\core\Mage\Core\Model\Resource\Setup.php(292): Mage::exception('Mage_Core', 'Error in file: ...') #1 C:\xampp\htdocs\app\code\core\Mage\Core\Model\Resource\Setup.php(179): Mage_Core_Model_Resource_Setup->_modifyResourceDb('upgrade', '0.7.4', '0.7.5') #2 C:\xampp\htdocs\app\code\core\Mage\Core\Model\Resource\Setup.php(146): Mage_Core_Model_Resource_Setup->_upgradeResourceDb('0.7.4', '0.7.5') #3 C:\xampp\htdocs\app\code\core\Mage\Core\Model\Resource\Setup.php(121): Mage_Core_Model_Resource_Setup->applyUpdates() #4 C:\xampp\htdocs\app\code\core\Mage\Core\Model\Config.php(205): Mage_Core_Model_Resource_Setup::applyAllUpdates() #5 C:\xampp\htdocs\app\code\core\Mage\Core\Model\App.php(242): Mage_Core_Model_Config->init(Array) #6 C:\xampp\htdocs\app\Mage.php(432): Mage_Core_Model_App->init('', 'store', Array) #7 C:\xampp\htdocs\app\Mage.php(453): Mage::app('', 'store', Array) #8 C:\xampp\htdocs\index.php(52): Mage::run() #9 {main}
I followed the instructions of this post first:
drop table if exist
then I tried the innodb-fix
but no change. can anyone help me?
thanks
Posted: May 4 2009
| top
| # 4
envisionweb
Total Posts: 20
Joined: 2008-11-16
Orlando, FL
Once again, another problem out of the “BLUE” after cart has been working fine for some time, no doubt a result from the “upgrade” to most recent update. I am having the same problem and it occurs when I try to go into an order and edit it. I have successfully edited orders in the past. Not sure why all of a sudden this error is occurring. All the tables last poster names that he said he changed to InnoDB are already currently set correctly. Here is my error:
SQLSTATE[23000] : Integrity constraint violation : 1452 Cannot add or update a child row : a foreign key constraint fails (` mydatabase_mydatabase/sales_flat_quote_payment `, CONSTRAINT ` FK_SALES_QUOTE_PAYMENT_SALES_QUOTE ` FOREIGN KEY (` quote_id `) REFERENCES ` sales_flat_quote ` (` entity_id `) ON DELETE CASCADE ON UPDATE CASCA ) Trace : #0 /home/mydatabase/public_html/lib/Zend/Db/Statement.php(283): Zend_Db_Statement_Pdo->_execute(Array) #1 /home/mydatabase/public_html/lib/Zend/Db/Adapter/Abstract.php(457): Zend_Db_Statement->execute(Array) #2 /home/mydatabase/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(230): Zend_Db_Adapter_Abstract->query('INSERT INTO `sa...', Array) #3 /home/mydatabase/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(281): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `sa...', Array) #4 /home/mydatabase/public_html/lib/Zend/Db/Adapter/Abstract.php(535): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `sa...', Array) #5 /home/mydatabase/public_html/app/code/core/Mage/Core/Model/Mysql4/Abstract.php(369): Zend_Db_Adapter_Abstract->insert('sales_flat_quot...', Array) #6 /home/mydatabase/public_html/app/code/core/Mage/Core/Model/Abstract.php(251): Mage_Core_Model_Mysql4_Abstract->save(Object(Mage_Sales_Model_Quote_Payment)) #7 /home/mydatabase/public_html/app/code/core/Mage/Core/Model/Mysql4/Collection/Abstract.php(209): Mage_Core_Model_Abstract->save() #8 /home/mydatabase/public_html/app/code/core/Mage/Sales/Model/Quote.php(218): Mage_Core_Model_Mysql4_Collection_Abstract->save() #9 /home/mydatabase/public_html/app/code/core/Mage/Core/Model/Abstract.php(252): Mage_Sales_Model_Quote->_afterSave() #10 /home/mydatabase/public_html/app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php(231): Mage_Core_Model_Abstract->save() #11 /home/mydatabase/public_html/app/code/core/Mage/Adminhtml/controllers/Sales/Order/EditController.php(57): Mage_Adminhtml_Model_Sales_Order_Create->initFromOrder(Object(Mage_Sales_Model_Order)) #12 /home/mydatabase/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(376): Mage_Adminhtml_Sales_Order_EditController->startAction() #13 /home/mydatabase/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(248): Mage_Core_Controller_Varien_Action->dispatch('start') #14 /home/mydatabase/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(158): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http)) #15 /home/mydatabase/public_html/app/Mage.php(459): Mage_Core_Controller_Varien_Front->dispatch() #16 /home/mydatabase/public_html/index.php(90): Mage::run() #17 {main}
To be sure, I am using the very latest Magento release as: Magento ver. 1.3.2.1
I wish someone could PLEASE help with a solution!
Posted: June 26 2009
| top
| # 6
envisionweb
Total Posts: 20
Joined: 2008-11-16
Orlando, FL
Why does the heading say SOLVED!!! Its NOT solved!
Posted: June 26 2009
| top
| # 7
elfling
Total Posts: 821
Joined: 2008-10-21
Experiencing same problem now.. Whenever go to edit order.
Signature
creative media group - Magento modules by elfling
Nimbus Hosting UK - Magento Hosting - Fast, Reliable and Secure - Tell them elfling sent you
Posted: August 25 2009
| top
| # 8
rome2ng
Total Posts: 18
Joined: 2009-05-20
i think this is shit.
Magento lack of support is the greatest turn off of the ecommerce system
i just dun understand no one is helping
experience the problemt oo
SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`treoocom_gzRVKma/qkw5_sales_flat_quote_payment`, CONSTRAINT `FK_SALES_QUOTE_PAYMENT_SALES_QUOTE` FOREIGN KEY (`quote_id`) REFERENCES `qkw5_sales_flat_quote` (`entity_id`) ON DELETE CASCADE ON)
Posted: August 31 2009
| top
| # 9
PCProffitt
Total Posts: 4
Joined: 2009-07-10
Suwanee, GA, USA
Answer is in this post: http://www.magentocommerce.com/boards/viewthread/32194/
Posted: November 9 2009
| top
| # 10
hidonet
Total Posts: 50
Joined: 2008-03-25
Istanbul
I’ve solved this problem with removing table prefixes.
Signature
Hidayet Ok
---------------
Magento Turkce Ceviri Yoneticisi
mail :
msn :
magentosanalpos.com - Tüm bankalar tek modülde, 3d secure uyumlu, taksitli sanal pos modülü
grinet.com.tr - e-ticaret, web programlama, yerellestirme
oxio.net - Cpanel, Interworx, Plesk Web Hosting
----------------------------
Posted: January 8 2011
| top
| # 11
RickshawDriver
Total Posts: 6
Joined: 2010-12-29
Hi Hidayet,
Can you explain how to removing table prefixes as you suggest to fix the problem.
I have been looking for solution on this forum, but nothing seems to work for me !
Thanks a lot
Posted: January 31 2011
| top
| # 12
ladle
Total Posts: 175
Joined: 2009-06-11
Just rename your tables in phpMyAdmin to not have prefixes.
Posted: January 31 2011
| top
| # 13
affect
Total Posts: 2
Joined: 2011-09-01
I had the same issue after using my Sample Data Prefix script that modifies sample data dump and adds prefixes.
Turned out I forgot to add prefixes to REFERENCES statements.
If you are using prefixes in your Magento installation, dump your database and check every operation that has “REFERENCES” in it.
Most likely you lack table prefix in it, e.g. have
REFERENCES ` admin_role `
instead of
REFERENCES ` yourprefix_admin_role `
Adding all missing prefixes fixed my problem.
Posted: October 31 2011
| top
| # 14
muk_t
Total Posts: 205
Joined: 2012-07-24
I am getting the following message on error printing after submitting product review. Please help to resolve
SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails
(`Myproject`.`review`, CONSTRAINT `FK_REVIEW_ENTITY_ID_REVIEW_ENTITY_ENTITY_ID` FOREIGN KEY (`entity_id`)
REFERENCES `review_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE)
Under app/etc/local.xml I have
< db > < table_prefix ><! [CDATA[]] ></ table_prefix > </ db >
How to fix the issue.I do not have any data in the review tables.
Thanks
Posted: November 16 2012
| top
| # 15