1

I am encountering the following issue after migrating the Magento 1.9.0.1 website to a new server.

I am using a php script that I run using ssh which fetches all the products from database and create a csv. it worked fine on the original site but it throws error on the new server. Below is the error trace printed by magento.

a:4:{i:0;s:1793636:"SELECT `t_d`.`entity_id`, `t_d`.`attribute_id`, `t_d`.`value` AS `default_value`, `t_s`.`value` AS `store_value`, IF(t_s.value_id IS NULL, t_d.value, t_s.value) AS `value` FROM `catalog_product_entity_int` AS `t_d`
     LEFT JOIN `catalog_product_entity_int` AS `t_s` ON t_s.attribute_id = t_d.attribute_id AND t_s.entity_id = t_d.entity_id AND t_s.store_id = 1 WHERE (t_d.entity_type_id = 4) AND (t_d.entity_id IN (1, 2, 3, 4, 5, 6, 7, 8, 9, 10 )) AND (t_d.attribute_id IN ('92', '145', '100', '131', '128', '81', '89', '123', '126', '127', '124', '96', '121', '102', '125')) AND (t_d.store_id = 0) UNION ALL SELECT `t_d`.`entity_id`, `t_d`.`attribute_id`, `t_d`.`value` AS `default_value`, `t_s`.`value` AS `store_value`, IF(t_s.value_id IS NULL, t_d.value, t_s.value) AS `value` FROM `catalog_product_entity_decimal` AS `t_d`
     LEFT JOIN `catalog_product_entity_decimal` AS `t_s` ON t_s.attribute_id = t_d.attribute_id AND t_s.entity_id = t_d.entity_id AND t_s.store_id = 1 WHERE (t_d.entity_type_id = 4) AND (t_d.entity_id IN (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)) AND (t_d.attribute_id IN ('79', '90', '99', '120', '75', '76', '91', '80')) AND (t_d.store_id = 0) UNION ALL SELECT `t_d`.`entity_id`, `t_d`.`attribute_id`, `t_d`.`value` AS `default_value`, `t_s`.`value` AS `store_value`, IF(t_s.value_id IS NULL, t_d.value, t_s.value) AS `value` FROM `catalog_product_entity_varchar` AS `t_d`
     LEFT JOIN `catalog_product_entity_varchar` AS `t_s` ON t_s.attribute_id = t_d.attribute_id AND t_s.entity_id = t_d.entity_id AND t_s.store_id = 1 WHERE (t_d.entity_type_id = 4) AND (t_d.entity_id IN (1, 2, 3, 4, 5, 6, 7, 8, 9, 10 )) AND (t_d.attribute_id IN ('117', '103', '133', '95', '122', '85', '112', '130', '88', '84', '82', '119', '118', '71', '109', '107', '137', '150', '149', '129', '86', '113', '138', '139', '140', '141', '142', '87', '114', '97', '98')) AND (t_d.store_id = 0) UNION ALL SELECT `t_d`.`entity_id`, `t_d`.`attribute_id`, `t_d`.`value` AS `default_value`, `t_s`.`value` AS `store_value`, IF(t_s.value_id IS NULL, t_d.value, t_s.value) AS `value` FROM `catalog_product_entity_datetime` AS `t_d`
     LEFT JOIN `catalog_product_entity_datetime` AS `t_s` ON t_s.attribute_id = t_d.attribute_id AND t_s.entity_id = t_d.entity_id AND t_s.store_id = 1 WHERE (t_d.entity_type_id = 4) AND (t_d.entity_id IN (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)) AND (t_d.attribute_id IN ('104', '105', '93', '94', '77', '78')) AND (t_d.store_id = 0) UNION ALL SELECT `t_d`.`entity_id`, `t_d`.`attribute_id`, `t_d`.`value` AS `default_value`, `t_s`.`value` AS `store_value`, IF(t_s.value_id IS NULL, t_d.value, t_s.value) AS `value` FROM `catalog_product_entity_text` AS `t_d`
     LEFT JOIN `catalog_product_entity_text` AS `t_s` ON t_s.attribute_id = t_d.attribute_id AND t_s.entity_id = t_d.entity_id AND t_s.store_id = 1 WHERE (t_d.entity_type_id = 4) AND (t_d.entity_id IN (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)) AND (t_d.attribute_id IN ('106', '72', '83', '146', '101', '135', '148', '73', '136', '134')) AND (t_d.store_id = 0)";i:1;s:1229:"

#0 /var/www/html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /var/www/html/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /var/www/html/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 /var/www/html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT `t_d`.`e...', Array)
#4 /var/www/html/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `t_d`.`e...', Array)
#5 /var/www/html/lib/Zend/Db/Adapter/Abstract.php(737): Varien_Db_Adapter_Pdo_Mysql->query('SELECT `t_d`.`e...', Array)
#6 /var/www/html/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php(1111): Zend_Db_Adapter_Abstract->fetchAll('SELECT `t_d`.`e...')
#7 /var/www/html/app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php(480): Mage_Eav_Model_Entity_Collection_Abstract->_loadAttributes(false, false)
#8 /var/www/html/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php(874): Mage_Catalog_Model_Resource_Product_Collection->_loadAttributes(false, false)
#9 /var/www/html/shell/exporter-new.php(70): Mage_Eav_Model_Entity_Collection_Abstract->load()
#10 {main}

The code that is throwing this error is this:

$products = Mage::getModel("catalog/product")
        ->getCollection()
        ->addAttributeToSort('created_at', 'DESC')
        ->addAttributeToSelect('*')
        ->load();

I couldn't figure out what the issue is. Any suggestions ?

4
  • Did you upgrade or migrate your existing site from one server to another server then upgrade? Commented Dec 9, 2015 at 17:09
  • @brentwpeterson no upgrade has been performed. The site is only moved from one server to the other as it is. Commented Dec 9, 2015 at 18:45
  • Have you confirmed that pdo_mysql is loaded? What is the name of the error that is throw? Commented Dec 9, 2015 at 19:12
  • @brentwpeterson I have updated the question with the whole output that I am getting. Commented Dec 11, 2015 at 8:07

1 Answer 1

0

I was using MariaDB 5.5, upgrading it to the latest version (10.1) sorted this issue. I am still not sure why the issue was caused but upgrade seemed to do the trick.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.