Magento Forum

   
Urgent help please sales_order_entity is missing unable to complete orders??? 
 
Riftlord
Member
 
Total Posts:  36
Joined:  2010-03-08
 

Hi,
I’ve upgraded from 1.3 to 1.4 to 1.4.1 and i’m getting this error when I click on an order in Admin and Google Checkout and Paypal are getting the error in the callback data.

SELECT `e`.* FROM `sales_order_entity` AS `e` WHERE (e.entity_type_id = ‘26’) AND (e.parent_id = ‘3’)

Trace:
#0 /home/dirtrade/public_html/lib/Zend/Db/Statement.php(300): Zend_Db_Statement_Pdo->_execute(Array)
#1 /home/dirtrade/public_html/lib/Zend/Db/Adapter/Abstract.php(468): Zend_Db_Statement->execute(Array)
#2 /home/dirtrade/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query(’SELECT `e`.* FR...’, Array)
#3 /home/dirtrade/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(333): Zend_Db_Adapter_Pdo_Abstract->query(’SELECT `e`.* FR...’, Array)
#4 /home/dirtrade/public_html/lib/Zend/Db/Adapter/Abstract.php(706): Varien_Db_Adapter_Pdo_Mysql->query(Object(Varien_Db_Select), Array)
#5 /home/dirtrade/public_html/lib/Varien/Data/Collection/Db.php(713): Zend_Db_Adapter_Abstract->fetchAll(Object(Varien_Db_Select), Array)
#6 /home/dirtrade/public_html/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php(953): Varien_Data_Collection_Db->_fetchAll(Object(Varien_Db_Select))
#7 /home/dirtrade/public_html/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php(793): Mage_Eav_Model_Entity_Collection_Abstract->_loadEntities(false, false)
#8 /home/dirtrade/public_html/app/code/local/B4Before/Sales/Model/Order.php(86): Mage_Eav_Model_Entity_Collection_Abstract->load()
#9 /home/dirtrade/public_html/app/code/core/Mage/Core/Model/Abstract.php(226): B4Before_Sales_Model_Order->_afterLoad()
#10 /home/dirtrade/public_html/app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php(74): Mage_Core_Model_Abstract->load(’3’)
#11 /home/dirtrade/public_html/app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php(114): Mage_Adminhtml_Sales_OrderController->_initOrder()
#12 /home/dirtrade/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Adminhtml_Sales_OrderController->viewAction()
#13 /home/dirtrade/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch(’view’)
#14 /home/dirtrade/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(177): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#15 /home/dirtrade/public_html/app/code/core/Mage/Core/Model/App.php(304): Mage_Core_Controller_Varien_Front->dispatch()
#16 /home/dirtrade/public_html/app/Mage.php(596): Mage_Core_Model_App->run(Array)
#17 /home/dirtrade/public_html/index.php(65): Mage::run()
#18 {main}

I see talk about moving to EAV format does this mean that Magento have removed these tables because the code is now using something else. What is still referencing the sales_order_entity table. I’ve tried searching the code but can’t find it.

Orders are messing up really need a hand here please.

Thanks

Gary

 
Magento Community Magento Community
Magento Community
Magento Community
 
Riftlord
Member
 
Total Posts:  36
Joined:  2010-03-08
 

Problem sorted by restoring the tables.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Wiseguy Digital
Member
 
Avatar
Total Posts:  61
Joined:  2007-09-17
Bristol, UK
 

Hi there Gary,

Can you tell me how you restored the tables? Are you talking about doing this manually from the backed up database, or is there something that I am missing?

Thanks, Jim

 
Magento Community Magento Community
Magento Community
Magento Community
 
junomedia
Sr. Member
 
Avatar
Total Posts:  142
Joined:  2008-09-10
Nottingham, England
 

I also have the same error, how did you resolve?

Thanks,

Andy.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Wiseguy Digital
Member
 
Avatar
Total Posts:  61
Joined:  2007-09-17
Bristol, UK
 
slater9000 - 03 August 2010 12:35 PM

I also have the same error, how did you resolve?

Thanks,

Andy.

Hi Andy,

Before I migrated I also took a manual dump of the database. Then I simply added the old table to my new database , as some orders are still referencing this old table. This seems to have worked perfectly.

Hope that helps!

Jim

 
Magento Community Magento Community
Magento Community
Magento Community
 
golles
Sr. Member
 
Total Posts:  257
Joined:  2008-01-15
 

we had the issue beacuse of the sage pay extension before they released the latest version.

basically it is beacuse old orders are referencing tables / or data within those tables that nop longer exists in the new flat tables in 1.4.1.0 & 1.4.1.1 - it is probably an extension as most of the core functionality works.

the workaround mentioned above is how we got around it too on our dev environment.

 
Magento Community Magento Community
Magento Community
Magento Community
 
junomedia
Sr. Member
 
Avatar
Total Posts:  142
Joined:  2008-09-10
Nottingham, England
 

Any chance of posting the mysql structure for the missing table?

Thanks :o)

Andy.

 
Magento Community Magento Community
Magento Community
Magento Community
 
junomedia
Sr. Member
 
Avatar
Total Posts:  142
Joined:  2008-09-10
Nottingham, England
 

If anyones stuck here is the SQL:

-- phpMyAdmin SQL Dump
-- version 2.11.9
-- http://www.phpmyadmin.net
--
-- 
Hostlocalhost
-- Generation TimeAug 242010 at 09:02 AM
-- Server version4.1.20
-- PHP Version5.2.6

SET FOREIGN_KEY_CHECKS
=0;

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

--
-- 
Database: `zent_co_uk_system`
--

-- --------------------------------------------------------

--
-- 
Table structure for table `sales_order_entity`
--

CREATE TABLE `sales_order_entity` (
  `
entity_idint(10unsigned NOT NULL auto_increment,
  `
entity_type_idsmallint(8unsigned NOT NULL default '0',
  `
attribute_set_idsmallint(5unsigned NOT NULL default '0',
  `
increment_idvarchar(50NOT NULL default '',
  `
parent_idint(10unsigned NOT NULL default '0',
  `
store_idsmallint(5unsigned NOT NULL default '0',
  `
created_atdatetime NOT NULL default '0000-00-00 00:00:00',
  `
updated_atdatetime NOT NULL default '0000-00-00 00:00:00',
  `
is_activetinyint(1unsigned NOT NULL default '1',
  
PRIMARY KEY  (`entity_id`),
  
KEY `FK_sales_order_entity_type` (`entity_type_id`),
  
KEY `FK_sales_order_entity_store` (`store_id`)
ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=;

-- --------------------------------------------------------

--
-- 
Table structure for table `sales_order_entity_datetime`
--

CREATE TABLE `sales_order_entity_datetime` (
  `
value_idint(11NOT NULL auto_increment,
  `
entity_type_idsmallint(8unsigned NOT NULL default '0',
  `
attribute_idsmallint(5unsigned NOT NULL default '0',
  `
store_idsmallint(5unsigned NOT NULL default '0',
  `
entity_idint(10unsigned NOT NULL default '0',
  `
valuedatetime NOT NULL default '0000-00-00 00:00:00',
  
PRIMARY KEY  (`value_id`),
  
KEY `FK_sales_order_entity_datetime_entity_type` (`entity_type_id`),
  
KEY `FK_sales_order_entity_datetime_attribute` (`attribute_id`),
  
KEY `FK_sales_order_entity_datetime_store` (`store_id`),
  
KEY `FK_sales_order_entity_datetime` (`entity_id`)
ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=;

-- --------------------------------------------------------

--
-- 
Table structure for table `sales_order_entity_decimal`
--

CREATE TABLE `sales_order_entity_decimal` (
  `
value_idint(11NOT NULL auto_increment,
  `
entity_type_idsmallint(8unsigned NOT NULL default '0',
  `
attribute_idsmallint(5unsigned NOT NULL default '0',
  `
store_idsmallint(5unsigned NOT NULL default '0',
  `
entity_idint(10unsigned NOT NULL default '0',
  `
valuedecimal(12,4NOT NULL default '0.0000',
  
PRIMARY KEY  (`value_id`),
  
KEY `FK_sales_order_entity_decimal_entity_type` (`entity_type_id`),
  
KEY `FK_sales_order_entity_decimal_attribute` (`attribute_id`),
  
KEY `FK_sales_order_entity_decimal_store` (`store_id`),
  
KEY `FK_sales_order_entity_decimal` (`entity_id`)
ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=;

-- --------------------------------------------------------

--
-- 
Table structure for table `sales_order_entity_int`
--

CREATE TABLE `sales_order_entity_int` (
  `
value_idint(11NOT NULL auto_increment,
  `
entity_type_idsmallint(8unsigned NOT NULL default '0',
  `
attribute_idsmallint(5unsigned NOT NULL default '0',
  `
store_idsmallint(5unsigned NOT NULL default '0',
  `
entity_idint(10unsigned NOT NULL default '0',
  `
valueint(11NOT NULL default '0',
  
PRIMARY KEY  (`value_id`),
  
KEY `FK_sales_order_entity_int_entity_type` (`entity_type_id`),
  
KEY `FK_sales_order_entity_int_attribute` (`attribute_id`),
  
KEY `FK_sales_order_entity_int_store` (`store_id`),
  
KEY `FK_sales_order_entity_int` (`entity_id`)
ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=;

-- --------------------------------------------------------

--
-- 
Table structure for table `sales_order_entity_text`
--

CREATE TABLE `sales_order_entity_text` (
  `
value_idint(11NOT NULL auto_increment,
  `
entity_type_idsmallint(8unsigned NOT NULL default '0',
  `
attribute_idsmallint(5unsigned NOT NULL default '0',
  `
store_idsmallint(5unsigned NOT NULL default '0',
  `
entity_idint(10unsigned NOT NULL default '0',
  `
valuetext NOT NULL,
  
PRIMARY KEY  (`value_id`),
  
KEY `FK_sales_order_entity_text_entity_type` (`entity_type_id`),
  
KEY `FK_sales_order_entity_text_attribute` (`attribute_id`),
  
KEY `FK_sales_order_entity_text_store` (`store_id`),
  
KEY `FK_sales_order_entity_text` (`entity_id`)
ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=;

-- --------------------------------------------------------

--
-- 
Table structure for table `sales_order_entity_varchar`
--

CREATE TABLE `sales_order_entity_varchar` (
  `
value_idint(11NOT NULL auto_increment,
  `
entity_type_idsmallint(8unsigned NOT NULL default '0',
  `
attribute_idsmallint(5unsigned NOT NULL default '0',
  `
store_idsmallint(5unsigned NOT NULL default '0',
  `
entity_idint(10unsigned NOT NULL default '0',
  `
valuevarchar(255NOT NULL default '',
  
PRIMARY KEY  (`value_id`),
  
KEY `FK_sales_order_entity_varchar_entity_type` (`entity_type_id`),
  
KEY `FK_sales_order_entity_varchar_attribute` (`attribute_id`),
  
KEY `FK_sales_order_entity_varchar_store` (`store_id`),
  
KEY `FK_sales_order_entity_varchar` (`entity_id`)
ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=;

--
-- 
Constraints for dumped tables
--

--
-- 
Constraints for table `sales_order_entity`
--
ALTER TABLE `sales_order_entity`
  
ADD CONSTRAINT `FK_sales_order_entity_storeFOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  
ADD CONSTRAINT `FK_sales_order_entity_typeFOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- 
Constraints for table `sales_order_entity_datetime`
--
ALTER TABLE `sales_order_entity_datetime`
  
ADD CONSTRAINT `FK_sales_order_entity_datetimeFOREIGN KEY (`entity_id`) REFERENCES `sales_order_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  
ADD CONSTRAINT `FK_sales_order_entity_datetime_attributeFOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  
ADD CONSTRAINT `FK_sales_order_entity_datetime_entity_typeFOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  
ADD CONSTRAINT `FK_sales_order_entity_datetime_storeFOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- 
Constraints for table `sales_order_entity_decimal`
--
ALTER TABLE `sales_order_entity_decimal`
  
ADD CONSTRAINT `FK_sales_order_entity_decimalFOREIGN KEY (`entity_id`) REFERENCES `sales_order_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  
ADD CONSTRAINT `FK_sales_order_entity_decimal_attributeFOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  
ADD CONSTRAINT `FK_sales_order_entity_decimal_entity_typeFOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  
ADD CONSTRAINT `FK_sales_order_entity_decimal_storeFOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- 
Constraints for table `sales_order_entity_int`
--
ALTER TABLE `sales_order_entity_int`
  
ADD CONSTRAINT `FK_sales_order_entity_intFOREIGN KEY (`entity_id`) REFERENCES `sales_order_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  
ADD CONSTRAINT `FK_sales_order_entity_int_attributeFOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  
ADD CONSTRAINT `FK_sales_order_entity_int_entity_typeFOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  
ADD CONSTRAINT `FK_sales_order_entity_int_storeFOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- 
Constraints for table `sales_order_entity_text`
--
ALTER TABLE `sales_order_entity_text`
  
ADD CONSTRAINT `FK_sales_order_entity_textFOREIGN KEY (`entity_id`) REFERENCES `sales_order_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  
ADD CONSTRAINT `FK_sales_order_entity_text_attributeFOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  
ADD CONSTRAINT `FK_sales_order_entity_text_entity_typeFOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  
ADD CONSTRAINT `FK_sales_order_entity_text_storeFOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- 
Constraints for table `sales_order_entity_varchar`
--
ALTER TABLE `sales_order_entity_varchar`
  
ADD CONSTRAINT `FK_sales_order_entity_varcharFOREIGN KEY (`entity_id`) REFERENCES `sales_order_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  
ADD CONSTRAINT `FK_sales_order_entity_varchar_attributeFOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  
ADD CONSTRAINT `FK_sales_order_entity_varchar_entity_typeFOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  
ADD CONSTRAINT `FK_sales_order_entity_varchar_storeFOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;

SET FOREIGN_KEY_CHECKS=1;

 
Magento Community Magento Community
Magento Community
Magento Community
 
mtstover
Jr. Member
 
Total Posts:  26
Joined:  2009-07-02
 

Hey - somewhat similar issue, but slightly different.  I upgraded to 1.4.1, and have the sales_order_entity tables, but am getting errors on checkout with paypal pro (I have NO extensions installed anymore).

Here’s the error I receive by email:

-----------------
Payment transaction failed.

Reason
SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`newyorkc_mg496/sales_payment_transaction`, CONSTRAINT `FK_SALES_PAYMENT_TRANSACTION_ORDER` FOREIGN KEY (`order_id`) REFERENCES `sales_order` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE)
--------------------

The payment actually goes through—but the order fails.  Something is referencing the above order, and i can’t figure out what....!

 
Magento Community Magento Community
Magento Community
Magento Community
 
xpctechnology
Jr. Member
 
Total Posts:  1
Joined:  2010-02-23
 

slater9000 - thank you!

 
Magento Community Magento Community
Magento Community
Magento Community
 
nasha
Sr. Member
 
Avatar
Total Posts:  138
Joined:  2009-04-15
 

@slater9000 thanx

 
Magento Community Magento Community
Magento Community
Magento Community
 
blap
Jr. Member
 
Total Posts:  14
Joined:  2008-09-28
 

Thanks slater!

 
Magento Community Magento Community
Magento Community
Magento Community
 
shimoda
Jr. Member
 
Total Posts:  22
Joined:  2008-10-30
 

Just like to add my thanks!

Test server upgrade went smoothly, live server didn’t go quite so smoothly… ahh Magento, you do make life ‘interesting’

 
Magento Community Magento Community
Magento Community
Magento Community
 
nik00726
Jr. Member
 
Avatar
Total Posts:  24
Joined:  2011-02-16
surat
 

Hi junomedia
Thanks for your run into same error in magento 1.6 but your script solved that.

NIks

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