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

site breaks after cache refresh (1.62 fresh install with a 1.42 db)
 
mehmehmeh
Jr. Member
 
Total Posts:  12
Joined:  2010-03-28
 

Our initial install was 1.401, we upgraded to 1.42 earlier this week without issue.

Magento connect and ssh upgrades to 1.62 were unsuccessful. Eventuall tried a fresh install of 1.62 then edited the local.xml file to point to a copy of our 1.42 db.  Got the site loaded with default template. 

php shell/indexer.php reindexall
returns
Product Attributes index was rebuilt successfully
Product Prices index was rebuilt successfully
Catalog URL Rewrites index was rebuilt successfully
Product Flat Data index was rebuilt successfully
Category Flat Data index was rebuilt successfully
Category Products index was rebuilt successfully
Catalog Search Index index was rebuilt successfully
Stock Status index was rebuilt successfully
Tag Aggregation Data index was rebuilt successfully

so that all looks goods.

site breaks every time we try to refresh the cache. I am not sure if the mysql update completed, i still see
public_html/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php
when it breaks.

this is what shows up until we clear cache from ssh and run \"shell/indexer.php reindexall\”

PDOException Object
(
    
[message:protected] => SQLSTATE[HY000]General error1025 Error on rename of \'./xxxxx_magento2/#sql-7563_8b38\' to \'./xxxxx_magento2/sales_flat_order_item\' (errno150)
    
[string:private] => 
    
[code:protected] => HY000
    [file
:protected] => /home/xxxxx/public_html/lib/Zend/Db/Statement/Pdo.php
    [line
:protected] => 228
    [trace
:private] => Array
        (
            
[0] => Array
                (
                    
[file] => /home/xxxxx/public_html/lib/Zend/Db/Statement/Pdo.php
                    [line] 
=> 228
                    [function] 
=> execute
                    [class] 
=> PDOStatement
                    [type] 
=> ->
                    
[args] => Array
                        (
                            
[0] => Array
                                (
                                )

                        )

                )

            
[1] => Array
                (
                    
[file] => /home/xxxxx/public_html/lib/Varien/Db/Statement/Pdo/Mysql.php
                    [line] 
=> 110
                    [function] 
=> _execute
                    [class] 
=> Zend_Db_Statement_Pdo
                    [type] 
=> ->
                    
[args] => Array
                        (
                            
[0] => Array
                                (
                                )

                        )

                )

            
[2] => Array
                (
                    
[file] => /home/xxxxx/public_html/lib/Zend/Db/Statement.php
                    [line] 
=> 300
                    [function] 
=> _execute
                    [class] 
=> Varien_Db_Statement_Pdo_Mysql
                    [type] 
=> ->
                    
[args] => Array
                        (
                            
[0] => Array
                                (
                                )

                        )

                )

            
[3] => Array
                (
                    
[file] => /home/xxxxx/public_html/lib/Zend/Db/Adapter/Abstract.php
                    [line] 
=> 479
                    [function] 
=> execute
                    [class] 
=> Zend_Db_Statement
                    [type] 
=> ->
                    
[args] => Array
                        (
                            
[0] => Array
                                (
                                )

                        )

                )

            
[4] => Array
                (
                    
[file] => /home/xxxxx/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php
                    [line] 
=> 238
                    [function] 
=> query
                    [class] 
=> Zend_Db_Adapter_Abstract
                    [type] 
=> ->
                    
[args] => Array
                        (
                            
[0] => ALTER TABLE `sales_flat_order_itemDROP KEY `IDX_STORE_ID`
                            
[1] => Array
                                (
                                )

                        )

                )

            
[5] => Array
                (
                    
[file] => /home/xxxxx/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php
                    [line] 
=> 389
                    [function] 
=> query
                    [class] 
=> Zend_Db_Adapter_Pdo_Abstract
                    [type] 
=> ->
                    
[args] => Array
                        (
                            
[0] => ALTER TABLE `sales_flat_order_itemDROP KEY `IDX_STORE_ID`
                            
[1] => Array
                                (
                                )

                        )

                )

            
[6] => Array
                (
                    
[file] => /home/xxxxx/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php
                    [line] 
=> 327
                    [function] 
=> query
                    [class] 
=> Varien_Db_Adapter_Pdo_Mysql
                    [type] 
=> ->
                    
[args] => Array
                        (
                            
[0] => ALTER TABLE `sales_flat_order_itemDROP KEY `IDX_STORE_ID`
                        )

                )

            
[7] => Array
                (
                    
[file] => /home/xxxxx/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php
                    [line] 
=> 2503
                    [function] 
=> raw_query
                    [class] 
=> Varien_Db_Adapter_Pdo_Mysql
                    [type] 
=> ->
                    
[args] => Array
                        (
                            
[0] => ALTER TABLE `sales_flat_order_itemDROP KEY `IDX_STORE_ID`
                        )

                )

            
[8] => Array
                (
                    
[file] => /home/xxxxx/public_html/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php
                    [line] 
=> 756
                    [function] 
=> dropIndex
                    [class] 
=> Varien_Db_Adapter_Pdo_Mysql
                    [type] 
=> ->
                    
[args] => Array
                        (
                            
[0] => sales_flat_order_item
                            [1] 
=> IDX_STORE_ID
                        
)

                )

            
[9] => Array
                (
                    
[file] => /home/xxxxx/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php
                    [line] 
=> 624
                    [args] 
=> Array
                        (
                            
[0] => /home/xxxxx/public_html/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php
                        
)

                    
[function] => include
                )

            
[10] => Array
                (
                    
[file] => /home/xxxxx/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php
                    [line] 
=> 437
                    [function] 
=> _modifyResourceDb
                    [class] 
=> Mage_Core_Model_Resource_Setup
                    [type] 
=> ->
                    
[args] => Array
                        (
                            
[0] => upgrade
                            [1] 
=> 1.4.0.25
                            [2] 
=> 1.6.0.4
                        
)

                )

            
[11] => Array
                (
                    
[file] => /home/xxxxx/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php
                    [line] 
=> 320
                    [function] 
=> _upgradeResourceDb
                    [class] 
=> Mage_Core_Model_Resource_Setup
                    [type] 
=> ->
                    
[args] => Array
                        (
                            
[0] => 1.4.0.25
                            [1] 
=> 1.6.0.4
                        
)

                )

            
[12] => Array
                (
                    
[file] => /home/xxxxx/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php
                    [line] 
=> 235
                    [function] 
=> applyUpdates
                    [class] 
=> Mage_Core_Model_Resource_Setup
                    [type] 
=> ->
                    
[args] => Array
                        (
                        )

                )

            
[13] => Array
                (
                    
[file] => /home/xxxxx/public_html/app/code/core/Mage/Core/Model/App.php
                    [line] 
=> 412
                    [function] 
=> applyAllUpdates
                    [class] 
=> Mage_Core_Model_Resource_Setup
                    [type] 
=> ::
                    
[args] => Array
                        (
                        )

                )

            
[14] => Array
                (
                    
[file] => /home/xxxxx/public_html/app/code/core/Mage/Core/Model/App.php
                    [line] 
=> 338
                    [function] 
=> _initModules
                    [class] 
=> Mage_Core_Model_App
                    [type] 
=> ->
                    
[args] => Array
                        (
                        )

                )

            
[15] => Array
                (
                    
[file] => /home/xxxxx/public_html/app/Mage.php
                    [line] 
=> 640
                    [function] 
=> run
                    [class] 
=> Mage_Core_Model_App
                    [type] 
=> ->
                    
[args] => Array
                        (
                            
[0] => Array
                                (
                                    
[scope_code] => 
                                    
[scope_type] => store
                                    [options] 
=> Array
                                        (
                                        )

                                )

                        )

                )

            
[16] => Array
                (
                    
[file] => /home/xxxxx/public_html/index.php
                    [line] 
=> 80
                    [function] 
=> run
                    [class] 
=> Mage
                    [type] 
=> ::
                    
[args] => Array
                        (
                            
[0] => 
                            
[1] => store
                        
)

                )

        )

    
[errorInfo] => Array
        (
            
[0] => HY000
            [1] 
=> 1025
            [2] 
=> Error on rename of \'./xxxxx_magento2/#sql-7563_8b38\' to \'./xxxxx_magento2/sales_flat_order_item\' (errno150)
        )

)
 
Magento Community Magento Community
Magento Community
Magento Community
 
mehmehmeh
Jr. Member
 
Total Posts:  12
Joined:  2010-03-28
 

I think I have solved this, will have to do a bit more testing.

I did a fresh install of 1.51, pointed it at a backup of my 1.42 db and updated. Everything seemed to work but I only poked around for 20 minutes. Backed up the new updated 1.51 DB.
One thing I noticed is magento connect didn\’t think I had any packages installed. That area of the admin loaded without errors, but there was nothing under installed packages.

Fresh install of 1.62 pointed at newly updated 1.51 DB.
had to edit catalog_product_index_website in phpmyadmin (structure date->website_date) before
php shell/indexer.php reindexall
would run without errors. Upon refreshing cache through the admin backend I got a php error regarding catalog_product_index_website column date not found. Changed it back in phpmyadmin so the update script could run. then I encountered the same error as before

PDOException Object
(
    
[message:protected] => SQLSTATE[HY000]General error1025 Error on rename of \\\'./xxxxx_magento2/#sql-7563_8b38\\\' to \\\'./xxxxx_magento2/sales_flat_order_item\\\' (errno150)

Don\’t know why I had not tried this before I know I had looked at it earlier. I used code from this page in the wiki

the original code from the wiki was

ALTER TABLE sales_flat_order_item DROP INDEX IDX_ORDER ADD INDEX IDX_SALES_FLAT_ORDER_ITEM_ORDER_ID order_id ); 
ALTER TABLE sales_flat_order_item DROP INDEX IDX_STORE_ID ADD INDEX IDX_SALES_FLAT_ORDER_ITEM_STORE_ID store_id );
ALTER TABLE sales_flat_order_item DROP INDEX IDX_PRODUCT_ID;

this threw an error in phpmyadmin. Looking at the structure of the sales_flat_order_item table (didn\’t seem to have the index IDX_ORDER) I changed the code to

ALTER TABLE sales_flat_order_item  ADD INDEX IDX_SALES_FLAT_ORDER_ITEM_ORDER_ID order_id ); 
ALTER TABLE sales_flat_order_item DROP INDEX IDX_STORE_ID ADD INDEX IDX_SALES_FLAT_ORDER_ITEM_STORE_ID store_id );
ALTER TABLE sales_flat_order_item DROP INDEX IDX_PRODUCT_ID;

and then the next cache update initiated through the admin backend took a lot more time. But it seems to have worked. Also magento connect loads properly with all the packages showing.

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