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

mysql4-upgrade-1.5.9.9-1.6.0.0.php” - SQLSTATE[HY000]: General error: 1025 Error on rename of ‘./magento/catalog_product_flat_1’ to ‘./magento/#sql2-6
 
Shay1680
Jr. Member
 
Total Posts:  15
Joined:  2009-11-02
 

after upgrade the site is down, and i get the following error , as well as many others of the same nature.
my site has been down for a week due to these issues, which i dont know how to resolve.
reindexing didnt help

Error:
Error in file: “/var/www/ob/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php” - SQLSTATE[HY000]: General error: 1025 Error on rename of ‘./magento/catalog_product_flat_1’ to ‘./magento/#sql2-6256-7e’ (errno: 152)

Trace:
#0 /var/www/ob/app/code/core/Mage/Core/Model/Resource/Setup.php(645): Mage::exception(’Mage_Core’, ‘Error in file: ...’)
#1 /var/www/ob/app/code/core/Mage/Core/Model/Resource/Setup.php(437): Mage_Core_Model_Resource_Setup->_modifyResourceDb(’upgrade’, ‘1.4.0.0.44’, ‘1.6.0.0.5’)
#2 /var/www/ob/app/code/core/Mage/Core/Model/Resource/Setup.php(320): Mage_Core_Model_Resource_Setup->_upgradeResourceDb(’1.4.0.0.44’, ‘1.6.0.0.5’)
#3 /var/www/ob/app/code/core/Mage/Core/Model/Resource/Setup.php(235): Mage_Core_Model_Resource_Setup->applyUpdates()
#4 /var/www/ob/app/code/core/Mage/Core/Model/App.php(408): Mage_Core_Model_Resource_Setup::applyAllUpdates()
#5 /var/www/ob/app/code/core/Mage/Core/Model/App.php(336): Mage_Core_Model_App->_initModules()
#6 /var/www/ob/app/Mage.php(640): Mage_Core_Model_App->run(Array)
#7 /var/www/ob/index.php(80): Mage::run(’’, ‘store’)
#8 {main}

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brent W Peterson
Moderator
 
Avatar
Total Posts:  3217
Joined:  2009-02-26
Minneapolis MN
 

You can simply drop that table

catalog_product_flat_1
 
Magento Community Magento Community
Magento Community
Magento Community
 
Shay1680
Jr. Member
 
Total Posts:  15
Joined:  2009-11-02
 

Thanks much for the help
i dropped the table and restarted apache, the next error i get is :

Time: 2011-09-08 13:48:35 GMT
Error:
Error in file: “/var/www/ob/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php” - Column “date” does not exists on table “catalog_product_index_website”

Trace:
#0 /var/www/ob/app/code/core/Mage/Core/Model/Resource/Setup.php(645): Mage::exception(’Mage_Core’, ‘Error in file: ...’)
#1 /var/www/ob/app/code/core/Mage/Core/Model/Resource/Setup.php(437): Mage_Core_Model_Resource_Setup->_modifyResourceDb(’upgrade’, ‘1.4.0.0.44’, ‘1.6.0.0.5’)
#2 /var/www/ob/app/code/core/Mage/Core/Model/Resource/Setup.php(320): Mage_Core_Model_Resource_Setup->_upgradeResourceDb(’1.4.0.0.44’, ‘1.6.0.0.5’)
#3 /var/www/ob/app/code/core/Mage/Core/Model/Resource/Setup.php(235): Mage_Core_Model_Resource_Setup->applyUpdates()
#4 /var/www/ob/app/code/core/Mage/Core/Model/App.php(408): Mage_Core_Model_Resource_Setup::applyAllUpdates()
#5 /var/www/ob/app/code/core/Mage/Core/Model/App.php(336): Mage_Core_Model_App->_initModules()
#6 /var/www/ob/app/Mage.php(640): Mage_Core_Model_App->run(Array)
#7 /var/www/ob/index.php(80): Mage::run(’’, ‘store’)
#8 {main}

 
Magento Community Magento Community
Magento Community
Magento Community
 
dbabaev
Sr. Member
 
Total Posts:  83
Joined:  2008-03-29
 

I don’t think anyone has solved the “date” error. The Magento team “cannot reproduce the issue”. Meanwhile, it seems dozens of us are having the same problem :(

Brent, any ideas?

 
Magento Community Magento Community
Magento Community
Magento Community
 
dbabaev
Sr. Member
 
Total Posts:  83
Joined:  2008-03-29
 

It looks like clean 1.5.1.0 (fresh install, no orders or products) can be upgraded to 1.6.0.0 with no problems.

However, most “working” databases (no customizations, just lots of products and orders) cannot. The upgrade process throws the following SQL errors:

First:

Error in file: ?/var/www/ob/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php? - SQLSTATE[HY000]: General error: 1025 Error on rename of ?./magento/catalog_product_flat_1? to ?./magento/#sql2-6256-7e? (errno: 152)

Second:

Error in file: ?/var/www/ob/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php? - Column ?date? does not exists on table ?catalog_product_index_website?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Shay1680
Jr. Member
 
Total Posts:  15
Joined:  2009-11-02
 

Here is what i figured out so far.
after trying to upgrade

when you start your web server or access the site the upgrade script kicks in.

on large stores , mine is over 4k products, the process takes ages.

if you ran the site via ssh, or web there is a good chance that you timed out after a while , leaving the upgrade in an unsteady state.

Also if you got tired of waiting and tried to access the site a few times , you might have launched multiple instances of the update script , which causes locks in the db.To clear this state you have to restart apaches and mysql.

The above means that your script was executed but not fully, which means that when it runs again it will fail on the actions that were already performed at previous runs.

The best option now is to see where the script fails, and either comment that section drop a table or see how else to fix the error.

so for the date issue on product_index_website\’ you need to comment out :

#$installer->getConnection()->changeColumn(
# $installer->getTable(\’catalog/product_index_website\’),
# \’date\’,
# \’website_date\’,
# array(
# \’type\’ => Varien_Db_Ddl_Table::TYPE_DATE,
# \’comment\’ => \’Website Date\’
# )
#);

Hope this helps,
Shay

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brent W Peterson
Moderator
 
Avatar
Total Posts:  3217
Joined:  2009-02-26
Minneapolis MN
 

DON’T DROP ANY OLD TABLE!!

Sorry, I didn’t mean you could drop any table, only the temp tables.

Normally if your install stops Magento should pick up where it left off, the problem that sometimes it doesn’t complete a transaction and leave a created table that that was not supposed to be there.

Your safe bet is to stat the install over by first dropping the database and recreating a new one, then importing your old data into it.

If you want to go through all the error files you could add if exists to the SQL statement. This will essentially skip that process if the table is already there.

 
Magento Community Magento Community
Magento Community
Magento Community
 
mthsialkot
Member
 
Avatar
Total Posts:  31
Joined:  2010-11-08
Pakistan
 
dbabaev - 08 September 2011 05:53 AM


Second:

Error in file: ?/var/www/ob/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php? - Column ?date? does not exists on table ?catalog_product_index_website?

I have same problem?
what is its simple solution now

 
Magento Community Magento Community
Magento Community
Magento Community
 
Shay1680
Jr. Member
 
Total Posts:  15
Joined:  2009-11-02
 

mthsialkot,

that error is fine i believe (looks like the action was performed in a previous run?) , let the upgrade continue.

Also my upgrade on a site that has been running for a few years with 4k products took ages to complete.

i stopped the upgrade , cleared the logs “php -f shell/log.php clean” and restarted the upgrade ,after which it was done in no time.

My site is currently up and running, i will be checking orders and and other features today.

Cheers,
Shay

 
Magento Community Magento Community
Magento Community
Magento Community
 
swifty_
Jr. Member
 
Total Posts:  11
Joined:  2010-12-17
 

I had exactly the same problem, I was upgrading from 1.4.2.0.
What seemed to work for me in the end, was to get a vanilla install of 1.6.0.0 and point it to my 1.4.2.0 database.
After this, running ‘php index.php’ from my magento root directory.
I had a flashing cursor for about 5mins before it completed.

I suspect to upgrade can hang at this point and the timeout kicks in when loading in a browser window.

Please tell me if this works for anyone else. grin

 
Magento Community Magento Community
Magento Community
Magento Community
 
zlewozmywak85
Jr. Member
 
Total Posts:  1
Joined:  2011-09-28
 

After install magento I have an error:

Error in file: “/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.0-1.4.0.0.1.php” - Validate class not found from basename ‘StringLength’

Trace:
#0 /app/code/core/Mage/Core/Model/Resource/Setup.php(645): Mage::exception(’Mage_Core’, ‘Error in file: ...’)
#1 /app/code/core/Mage/Core/Model/Resource/Setup.php(437): Mage_Core_Model_Resource_Setup->_modifyResourceDb(’upgrade’, ‘1.4.0.0.0’, ‘1.6.0.0’)
#2 /app/code/core/Mage/Core/Model/Resource/Setup.php(320): Mage_Core_Model_Resource_Setup->_upgradeResourceDb(’1.4.0.0.0’, ‘1.6.0.0’)
#3 /app/code/core/Mage/Core/Model/Resource/Setup.php(235): Mage_Core_Model_Resource_Setup->applyUpdates()
#4 /app/code/core/Mage/Core/Model/App.php(408): Mage_Core_Model_Resource_Setup::applyAllUpdates()
#5 /app/code/core/Mage/Core/Model/App.php(336): Mage_Core_Model_App->_initModules()
#6 /app/Mage.php(640): Mage_Core_Model_App->run(Array)
#7 /index.php(80): Mage::run(’’, ‘store’)
#8 {main}

I don`t know what to do to proceed installation.

 
Magento Community Magento Community
Magento Community
Magento Community
 
amtonio
Jr. Member
 
Total Posts:  11
Joined:  2011-04-03
 

I got the same error, anybody can help me fix it?

Error in file: “/var/www/magento16/app/code/core/Mage/SalesRule/sql/salesrule_setup/upgrade-1.6.0.0-1.6.0.1.php” - SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for ‘period’

Trace:
#0 /var/www/magento16/app/code/core/Mage/Core/Model/Resource/Setup.php(645): Mage::exception(’Mage_Core’, ‘Error in file: ...’)
#1 /var/www/magento16/app/code/core/Mage/Core/Model/Resource/Setup.php(437): Mage_Core_Model_Resource_Setup->_modifyResourceDb(’upgrade’, ‘1.6.0.0’, ‘1.6.0.1’)
#2 /var/www/magento16/app/code/core/Mage/Core/Model/Resource/Setup.php(320): Mage_Core_Model_Resource_Setup->_upgradeResourceDb(’1.6.0.0’, ‘1.6.0.1’)
#3 /var/www/magento16/app/code/core/Mage/Core/Model/Resource/Setup.php(235): Mage_Core_Model_Resource_Setup->applyUpdates()
#4 /var/www/magento16/app/code/core/Mage/Core/Model/App.php(412): Mage_Core_Model_Resource_Setup::applyAllUpdates()
#5 /var/www/magento16/app/code/core/Mage/Core/Model/App.php(338): Mage_Core_Model_App->_initModules()
#6 /var/www/magento16/app/Mage.php(640): Mage_Core_Model_App->run(Array)
#7 /var/www/magento16/index.php(80): Mage::run(’’, ‘store’)
#8 {main}

 
Magento Community Magento Community
Magento Community
Magento Community
 
Alain Martini
Jr. Member
 
Total Posts:  5
Joined:  2008-08-20
 

Hello,
this is just a bug in the generation of an index that happens when you do a plain new install (not upgrade) of the 1.6.2.0

even if the error is apparently throwed by

app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php (625):

it is a consequence of a wrongly created index in the database which is defined by

app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.19-1.4.0.0.20.php

in that file find the line:

KEY `IDX_DATE` (`date`),

an substitute by

KEY `IDX_DATE` (`website_date`),

clean your db and remove your /app/etc/local.xml and restart the installation from the beginning.
Now the installation should work.

This solved the problem for me.

Hope this help someone smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
encurioGmbH
Jr. Member
 
Avatar
Total Posts:  2
Joined:  2009-03-19
 

have you cleared caches with “clear_var_caches.php” and set all folder rights to 0777?

That helped me.

 
Magento Community Magento Community
Magento Community
Magento Community
 
track-23
Member
 
Total Posts:  33
Joined:  2011-02-09
 
Shay1680 - 12 September 2011 03:44 AM

mthsialkot,

that error is fine i believe (looks like the action was performed in a previous run?) , let the upgrade continue.

Also my upgrade on a site that has been running for a few years with 4k products took ages to complete.

. . .

Cheers,
Shay

This was the case for me. I just had to wait a little longer for the upgrade process to finish and then the site loaded fine!

By the way, I was upgrading from 1.5.0.1 to 1.7.0.2.

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