Magento Forum

   
Page 1 of 2
ERROR:  Base table or view already exists: 1050 Table ‘catalogrule_affected_product’ already exists
 
markf
Sr. Member
 
Total Posts:  145
Joined:  2007-09-20
 

This is the full text of the error I get when i try and load my homepage after a “successful” upgrade of 1.1.7 (from 1.1.6) through magento connect:

Error in file: “/home/markf/domains/allstatesign.com/public_html/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.4-0.7.5.php” - SQLSTATE[42S01]: Base table or view already exists: 1050 Table ‘catalogrule_affected_product’ already exists
Trace:
#0 /home/markf/domains/allstatesign.com/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(286): Mage::exception(’Mage_Core’, ‘Error in file: ...’)
#1 /home/markf/domains/allstatesign.com/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(178): Mage_Core_Model_Resource_Setup->_modifyResourceDb(’upgrade’, ‘0.7.3’, ‘0.7.5’)
#2 /home/markf/domains/allstatesign.com/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(145): Mage_Core_Model_Resource_Setup->_upgradeResourceDb(’0.7.3’, ‘0.7.5’)
#3 /home/markf/domains/allstatesign.com/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(120): Mage_Core_Model_Resource_Setup->applyUpdates()
#4 /home/markf/domains/allstatesign.com/public_html/app/code/core/Mage/Core/Model/Config.php(215): Mage_Core_Model_Resource_Setup::applyAllUpdates()
#5 /home/markf/domains/allstatesign.com/public_html/app/code/core/Mage/Core/Model/App.php(243): Mage_Core_Model_Config->init(Array)
#6 /home/markf/domains/allstatesign.com/public_html/app/Mage.php(424): Mage_Core_Model_App->init(’’, ‘store’, Array)
#7 /home/markf/domains/allstatesign.com/public_html/app/Mage.php(443): Mage::app(’’, ‘store’, Array)
#8 /home/markf/domains/allstatesign.com/public_html/index.php(52): Mage::run()
#9 {main}

Does anyone know what might be causing this error?  Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
sgalloo
Jr. Member
 
Total Posts:  11
Joined:  2008-09-21
 

I’ve got the same error the upgrade successfull and this trace and this erroron the home page and :

Error in file: “G:\Webmaster\wamp\www\app\code\core\Mage\CatalogRule\sql\catalogrule_setup\mysql4-upgrade-0.7.4-0.7.5.php” - SQLSTATE[42S01]: Base table or view already exists: 1050 Table ‘magento_catalogrule_affected_product’ already exists
Trace:
#0 G:\Webmaster\wamp\www\app\code\core\Mage\Core\Model\Resource\Setup.php(286): Mage::exception(’Mage_Core’, ‘Error in file: ...’)
#1 G:\Webmaster\wamp\www\app\code\core\Mage\Core\Model\Resource\Setup.php(178): Mage_Core_Model_Resource_Setup->_modifyResourceDb(’upgrade’, ‘0.7.3’, ‘0.7.5’)
#2 G:\Webmaster\wamp\www\app\code\core\Mage\Core\Model\Resource\Setup.php(145): Mage_Core_Model_Resource_Setup->_upgradeResourceDb(’0.7.3’, ‘0.7.5’)
#3 G:\Webmaster\wamp\www\app\code\core\Mage\Core\Model\Resource\Setup.php(120): Mage_Core_Model_Resource_Setup->applyUpdates()
#4 G:\Webmaster\wamp\www\app\code\core\Mage\Core\Model\Config.php(215): Mage_Core_Model_Resource_Setup::applyAllUpdates()
#5 G:\Webmaster\wamp\www\app\code\core\Mage\Core\Model\App.php(243): Mage_Core_Model_Config->init(Array)
#6 G:\Webmaster\wamp\www\app\Mage.php(424): Mage_Core_Model_App->init(’’, ‘store’, Array)
#7 G:\Webmaster\wamp\www\app\Mage.php(443): Mage::app(’’, ‘store’, Array)
#8 G:\Webmaster\wamp\www\index.php(52): Mage::run()
#9 {main}

AND THIS ERROR IN THE MAGENTO DOWNLOADER CONSOLE WINDOW WHEN I TRY TO UPGRADE MY COMMUNITY MODULES:

PDOException Object
(
[message:protected] => SQLSTATE[42S01]: Base table or view already exists: 1050 Table ‘magento_catalogrule_affected_product’ already exists
[string:private] =>
[code:protected] => 42S01
[file:protected] => G:\Webmaster\wamp\www\lib\Varien\Db\Adapter\Pdo\Mysql.php
[line:protected] => 187
[trace:private] => Array
(
[0] => Array
(
[file] => G:\Webmaster\wamp\www\lib\Varien\Db\Adapter\Pdo\Mysql.php
[line] => 187
[function] => query
[class] => PDO
[type] => ->
[args] => Array
(
[0] => CREATE TABLE magento_catalogrule_affected_product (
`product_id` int(10) unsigned NOT NULL,
KEY `IDX_PRODUCT` (`product_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
)

)

[1] => Array
(
[file] => G:\Webmaster\wamp\www\lib\Varien\Db\Adapter\Pdo\Mysql.php
[line] => 249
[function] => raw_query
[class] => Varien_Db_Adapter_Pdo_Mysql
[type] => ->
[args] => Array
(
[0] => CREATE TABLE magento_catalogrule_affected_product (
`product_id` int(10) unsigned NOT NULL,
KEY `IDX_PRODUCT` (`product_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
)

)

[2] => Array
(
[file] => G:\Webmaster\wamp\www\app\code\core\Mage\Core\Model\Resource\Setup.php
[line] => 493
[function] => multi_query
[class] => Varien_Db_Adapter_Pdo_Mysql
[type] => ->
[args] => Array
(
[0] =>
CREATE TABLE magento_catalogrule_affected_product (
`product_id` int(10) unsigned NOT NULL,
KEY `IDX_PRODUCT` (`product_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

)

)

[3] => Array
(
[file] => G:\Webmaster\wamp\www\app\code\core\Mage\CatalogRule\sql\catalogrule_setup\mysql4-upgrade-0.7.4-0.7.5.php
[line] => 37
[function] => run
[class] => Mage_Core_Model_Resource_Setup
[type] => ->
[args] => Array
(
[0] =>
CREATE TABLE magento_catalogrule_affected_product (
`product_id` int(10) unsigned NOT NULL,
KEY `IDX_PRODUCT` (`product_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

)

)

[4] => Array
(
[file] => G:\Webmaster\wamp\www\app\code\core\Mage\Core\Model\Resource\Setup.php
[line] => 268
[args] => Array
(
[0] => G:\Webmaster\wamp\www\app\code\core\Mage\CatalogRule\sql\catalogrule_setup\mysql4-upgrade-0.7.4-0.7.5.php
)

[function] => include
)

[5] => Array
(
[file] => G:\Webmaster\wamp\www\app\code\core\Mage\Core\Model\Resource\Setup.php
[line] => 178
[function] => _modifyResourceDb
[class] => Mage_Core_Model_Resource_Setup
[type] => ->
[args] => Array
(
[0] => upgrade
[1] => 0.7.4
[2] => 0.7.5
)

)

[6] => Array
(
[file] => G:\Webmaster\wamp\www\app\code\core\Mage\Core\Model\Resource\Setup.php
[line] => 145
[function] => _upgradeResourceDb
[class] => Mage_Core_Model_Resource_Setup
[type] => ->
[args] => Array
(
[0] => 0.7.4
[1] => 0.7.5
)

)

[7] => Array
(
[file] => G:\Webmaster\wamp\www\app\code\core\Mage\Core\Model\Resource\Setup.php
[line] => 120
[function] => applyUpdates
[class] => Mage_Core_Model_Resource_Setup
[type] => ->
[args] => Array
(
)

)

[8] => Array
(
[file] => G:\Webmaster\wamp\www\app\code\core\Mage\Core\Model\Config.php
[line] => 215
[function] => applyAllUpdates
[class] => Mage_Core_Model_Resource_Setup
[type] => ::
[args] => Array
(
)

)

[9] => Array
(
[file] => G:\Webmaster\wamp\www\app\code\core\Mage\Core\Model\App.php
[line] => 243
[function] => init
[class] => Mage_Core_Model_Config
[type] => ->
[args] => Array
(
[0] => Array
(
)

)

)

[10] => Array
(
[file] => G:\Webmaster\wamp\www\app\Mage.php
[line] => 424
[function] => init
[class] => Mage_Core_Model_App
[type] => ->
[args] => Array
(
[0] =>
[1] => store
[2] => Array
(
)

)

)

[11] => Array
(
[file] => G:\Webmaster\wamp\www\downloader\Maged\Controller.php
[line] => 384
[function] => app
[class] => Mage
[type] => ::
[args] => Array
(
)

)

[12] => Array
(
[file] => G:\Webmaster\wamp\www\downloader\Maged\Controller.php
[line] => 338
[function] => isInstalled
[class] => Maged_Controller
[type] => ->
[args] => Array
(
)

)

[13] => Array
(
[file] => G:\Webmaster\wamp\www\downloader\Maged\Controller.php
[line] => 170
[function] => dispatch
[class] => Maged_Controller
[type] => ->
[args] => Array
(
)

)

[14] => Array
(
[file] => G:\Webmaster\wamp\www\downloader\index.php
[line] => 35
[function] => run
[class] => Maged_Controller
[type] => ::
[args] => Array
(
)

)

)

[errorInfo] => Array
(
[0] => 42S01
[1] => 1050
[2] => Table ‘magento_catalogrule_affected_product’ already exists
)

)

Magento Downloader

Fatal error: Uncaught exception ‘Exception’ with message ‘Warning: Cannot modify header information - headers already sent by (output started at G:\Webmaster\wamp\www\app\code\core\Mage\Core\Model\Resource\Setup.php:285) in G:\Webmaster\wamp\www\app\code\core\Mage\Core\Model\Cookie.php on line 49’ in G:\Webmaster\wamp\www\app\code\core\Mage\Core\functions.php:246 Stack trace: #0 [internal function]: mageCoreErrorHandler(2, ‘Cannot modify h...’, ‘G:\Webmaster\wa...’, 49, Array) #1 G:\Webmaster\wamp\www\app\code\core\Mage\Core\Model\Cookie.php(49): setcookie(’magento’, ‘5eie6qqwpb4ppni...’, 1229802910, ‘/downloader’, ‘localhost’) #2 G:\Webmaster\wamp\www\app\code\core\Mage\Core\Model\Config.php(721): Mage_Core_Model_Cookie->__construct(Array) #3 G:\Webmaster\wamp\www\app\Mage.php(314): Mage_Core_Model_Config->getModelInstance(’core/cookie’, Array) #4 G:\Webmaster\wamp\www\app\Mage.php(328): Mage::getModel(’core/cookie’, Array) #5 G:\Webmaster\wamp\www\app\code\core\Mage\Core\Model\Session\Abstract.php(64): Mage::getSinglet in G:\Webmaster\wamp\www\app\code\core\Mage\Core\functions.php on line 246

 
Magento Community Magento Community
Magento Community
Magento Community
 
markf
Sr. Member
 
Total Posts:  145
Joined:  2007-09-20
 

I have been trying to get past this error all day.  I do think I understand what some of the problem is, just dont know how to fix it. 

I believe the problem exists because I did a magento connect update to 1.1.7 but then realized it messed up my theme.  So I rolled back to 1.1.6 (using the built in restore feature DirectAdmin has).  Even though it restores, it keeps some of the new stuff from 1.1.7 in the DB and directories.  For example this “catalogrule_affected_product” table is part of the 1.1.7 database but its still in my 1.1.6 database that I reverted back to.  So when magento tries to install again, that table, among others are already in there and it does not now what to do. 

I tried deleting the new tables created by 1.1.7 and installing, but then there are other errors dealing with files. Such as this:

Error in file: “/home/markfick/domains/allstatesign.com/public_html/app/code/core/Mage/Wishlist/sql/wishlist_setup/mysql4-upgrade-0.7.2-0.7.4.php” - SQLSTATE[HY000]: General error: 1005 Can’t create table ‘./markfick_magento/#sql-192b_2f41df.frm’ (errno: 121)
Trace:
#0 /home/markfick/domains/allstatesign.com/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(286): Mage::exception(’Mage_Core’, ‘Error in file: ...’)
#1 /home/markfick/domains/allstatesign.com/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(178): Mage_Core_Model_Resource_Setup->_modifyResourceDb(’upgrade’, ‘0.7.2’, ‘0.7.4’)
#2 /home/markfick/domains/allstatesign.com/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(145): Mage_Core_Model_Resource_Setup->_upgradeResourceDb(’0.7.2’, ‘0.7.4’)
#3 /home/markfick/domains/allstatesign.com/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(120): Mage_Core_Model_Resource_Setup->applyUpdates()
#4 /home/markfick/domains/allstatesign.com/public_html/app/code/core/Mage/Core/Model/Config.php(215): Mage_Core_Model_Resource_Setup::applyAllUpdates()
#5 /home/markfick/domains/allstatesign.com/public_html/app/code/core/Mage/Core/Model/App.php(243): Mage_Core_Model_Config->init(Array)
#6 /home/markfick/domains/allstatesign.com/public_html/app/Mage.php(424): Mage_Core_Model_App->init(’’, ‘store’, Array)
#7 /home/markfick/domains/allstatesign.com/public_html/app/Mage.php(443): Mage::app(’’, ‘store’, Array)
#8 /home/markfick/domains/allstatesign.com/public_html/index.php(52): Mage::run()
#9 {main}

If you find out anything, let me know.

 
Magento Community Magento Community
Magento Community
Magento Community
 
restos
Sr. Member
 
Total Posts:  79
Joined:  2008-05-10
 

I get the same issue....

 
Magento Community Magento Community
Magento Community
Magento Community
 
Nexus Rex
Sr. Member
 
Avatar
Total Posts:  139
Joined:  2008-07-10
Utah, USA
 

I as well.

Anybody know what to do to get my site back up very quickly?

 
Magento Community Magento Community
Magento Community
Magento Community
 
David @ WSS
Jr. Member
 
Total Posts:  15
Joined:  2007-09-29
 

I have the same problem.

I updated successfully the first night that 1.1.7 was available and the update worked fine.
When I realized that some of my custom modifications were not working I decided to go back to my last 1.1.6 backup.  That worked fine, when I was ready to try the 1.1.7 update again it appeared to install but I get the same error message posted here when I access my site and site admin. I tried applying the update to various backup versions, even a backup before any of my modification but received the same results.

Hopefully some one will figure this out. I am just starting to play with Magento, I may have to reinstall from “scratch”.  I have spent more time trying to fix this then I would have just going back to the beginning and making my changes.

Hopefully this is all worth the trouble.

David

 
Magento Community Magento Community
Magento Community
Magento Community
 
markf
Sr. Member
 
Total Posts:  145
Joined:  2007-09-20
 

David - The scenario you described is EXACTLY what got me into the same bind. 

I installed and reverted and tried to reinstall again.  Unfortunately I have thousands of products, etc so I can’t just start over.

It appears that the initial 1.1.7 upgrade left some new tables and modifications in the database, even after I reverted.  And that is what causes the problems. 

So I am stuck with 1.1.6 unless I can figure a way past this.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Nexus Rex
Sr. Member
 
Avatar
Total Posts:  139
Joined:  2008-07-10
Utah, USA
 

David and markf,

To get your sites back up, it’s actually more important that you revert the codebase back to it’s prior state than the database. You need to get rid of the code changes that 1.1.7 makes and revert back to 1.1.6.

I had a nightly backup of all files that I was able to conveniently revert to. If you don’t, I would recommend downloading the 1.1.6 codebase and using FTP to revert back.

Best of luck!

Travis Cable

 
Magento Community Magento Community
Magento Community
Magento Community
 
markf
Sr. Member
 
Total Posts:  145
Joined:  2007-09-20
 

Travis - Thanks for the tip, but my site is actually up (Running 1.1.6), the problem is it wont allow us to upgrade to 1.1.7 without errors.

Also, I tried running a full clean install with the 1.1.7 files and using my existing database and it would not work.  So I really think it has more to do with the database.  But I could be wrong..

 
Magento Community Magento Community
Magento Community
Magento Community
 
Nexus Rex
Sr. Member
 
Avatar
Total Posts:  139
Joined:  2008-07-10
Utah, USA
 

I think it is apparent that 1.1.7 was released prematurely. The upgrade is where the problem is, and I hope that Varien finds the problem and fixes it soon, so that more people don’t experience this.

I was not able to revert to 1.1.6 after trying the upgrade, because even the Magento Connect page was broken and displaying the errors.

 
Magento Community Magento Community
Magento Community
Magento Community
 
leeaston
Sr. Member
 
Total Posts:  77
Joined:  2007-11-26
France
 

Same problem here.

-Lee

 
Magento Community Magento Community
Magento Community
Magento Community
 
RPGShop
Sr. Member
 
Total Posts:  143
Joined:  2008-06-16
 

Any solution to this? I just did an update from 1.16 and got this same stupid error… come on… It’s always a nightmare to update.

James

 
Magento Community Magento Community
Magento Community
Magento Community
 
Nexus Rex
Sr. Member
 
Avatar
Total Posts:  139
Joined:  2008-07-10
Utah, USA
 

I see that 1.1.8 has now come out. Has anybody had better luck upgrading to it?

 
Magento Community Magento Community
Magento Community
Magento Community
 
VladD
Jr. Member
 
Total Posts:  4
Joined:  2008-11-15
Moscow
 

Same issue. Update from 1.1.6 to 1.1.8

 
Magento Community Magento Community
Magento Community
Magento Community
 
biwac INFORMATIK GmbH
Jr. Member
 
Total Posts:  15
Joined:  2008-04-02
Solothurn
 

Exactly the same problem here. I hope of a solution very, very quick dear varien-team.

 
Magento Community Magento Community
Magento Community
Magento Community
 
SimpleHelixcom
Enthusiast
 
Avatar
Total Posts:  906
Joined:  2007-08-31
Huntsville, AL
 

open up one of those files as indicated in the error you get, such as : mysql4-upgrade-0.7.2-0.7.4.php

then comment out the sql query or php code that tries to create the table

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
Page 1 of 2