Magento – Magento 1.9.01 update to 1.9.1.0 results in ”There has been an error processing your request” LOG FILES uploaded

errorlogmagento-1.9upgrade

Ok, so let me explain the complete story:
I have a VPS with a magento webshop installed, the Magento shop is being maintained by Installatron, as Installatron makes backups and does the updates when needed.

I was on 1.9.01 before and updated to 1.9.1.0 without problems, but because we had some issue's with the skin (allready present in 1.9.01) which we tried fixing after the update somehow the whole webshot crashed.

So i placed back the backup of 1.9.0.1

Website working as before, but now i cannot update anymore, the update completes, in installatron is says 1.9.1.0 but the website shows the error mentioned in the title:

There has been an error processing your request
Exception printing is disabled by default for security reasons.

Error log record number: 1198252680343

The error log number changes, when trying to enter admin-url for example.
I've have a copy of the logs here:
https://dl.dropboxusercontent.com/u/32681465/error%20logs.zip

I've checked them and seems to be a mail issue?
Not sure though, but think it's a MYSQL problem.

Hope someone can help me.

Best Answer

During the Magento Upgrade process, it will attempt to update your Database schema to make changes to the way the Tables, Indices, Constraints and (with the latest updates) Triggers are configured and defined in your Database.

The log files you provided are indicating that one of the changes Magento is attempting to execute against your (I'm assuming MySQL) database is failing:

a:5:{i:0;s:1082:"Error in file: "/home/dynamodz/domains/dynamodz.com/public_html/app/code/core/Mage/Core/sql/core_setup/upgrade-1.6.0.5-1.6.0.6.php" - SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'mage_core_email_queue' already exists, query was: CREATE TABLE `mage_core_email_queue` (
  `message_id` int UNSIGNED NOT NULL auto_increment COMMENT 'Message Id' ,
  `entity_id` int UNSIGNED NULL COMMENT 'Entity ID' ,
  `entity_type` varchar(128) NULL COMMENT 'Entity Type' ,
  `event_type` varchar(128) NULL COMMENT 'Event Type' ,
  `message_body_hash` varchar(64) NOT NULL COMMENT 'Message Body Hash' ,
  `message_body` mediumtext NOT NULL COMMENT 'Message Body' ,
  `message_parameters` text NOT NULL COMMENT 'Message Parameters' ,
  `created_at` timestamp NULL default NULL COMMENT 'Creation Time' ,
  `processed_at` timestamp NULL default NULL COMMENT 'Finish Time' ,
  PRIMARY KEY (`message_id`),
  INDEX `747D3AF379628D00D009E037E2942C80` (`entity_id`, `entity_type`, `event_type`, `message_body_hash`)
) COMMENT='Email Queue' ENGINE=INNODB charset=utf8 COLLATE=utf8_general_ci";i:1;s:1154:"#0 /home/dynamodz/domains/dynamodz.com/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(645): Mage::exception('Mage_Core', 'Error in file: ...')
#1 /home/dynamodz/domains/dynamodz.com/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(437): Mage_Core_Model_Resource_Setup->_modifyResourceDb('upgrade', '1.6.0.4', '1.6.0.6')
#2 /home/dynamodz/domains/dynamodz.com/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(320): Mage_Core_Model_Resource_Setup->_upgradeResourceDb('1.6.0.4', '1.6.0.6')
#3 /home/dynamodz/domains/dynamodz.com/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(235): Mage_Core_Model_Resource_Setup->applyUpdates()
#4 /home/dynamodz/domains/dynamodz.com/public_html/app/code/core/Mage/Core/Model/App.php(417): Mage_Core_Model_Resource_Setup::applyAllUpdates()
#5 /home/dynamodz/domains/dynamodz.com/public_html/app/code/core/Mage/Core/Model/App.php(343): Mage_Core_Model_App->_initModules()
#6 /home/dynamodz/domains/dynamodz.com/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#7 /home/dynamodz/domains/dynamodz.com/public_html/index.php(87): Mage::run('', 'store')
#8 {main}";s:3:"url";s:1:"/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";}

The code in the upgrade script "/home/dynamodz/domains/dynamodz.com/public_html/app/code/core/Mage/Core/sql/core_setup/upgrade-1.6.0.5-1.6.0.6.php" is attempting to add a new table to your database, but MySQL is complaining with an error because that table already exists.

The problem with your previous attempt to "restore the backup" may have been that you only restored the Magento installation files and not a backup of your database. The first time a Magento site is accessed via URL, it's autoloader system runs through it's Core installation / upgrade scripts and those of all installed plugins and attempts to execute any DB setup scripts it finds that haven't been completed.

Whenever you install or create any new module that contains database interaction, you will find an install and upgrade script in that module’s code directory that will run once you hit the URL. Magento’s core modules also follow the same install and upgrade structure. If you want to see some examples, open app/code/core/Mage/Catalog/sql/ catalog_setup. Here, you will find several install and upgrade scripts with proper naming conventions along with their version numbers.

I would engage Installatron and request that they perform a restore of the database backup taken BEFORE you attempted the upgrade then restore your Magento files to the filesystem. That will get your system to a point where the database schema is consistent with the codebase in your Magento installation (hopefully, it's possible there were previous failed installations / upgrades that you're not aware of...)

Then, read this guide carefully and perform the upgrade steps documented there in the order listed. One thing you nee to be aware of is if your site is seeing traffic, the first user who hits the URL will cause Magento to execute the upgrade / installation, and subsequent visitors could trigger additional executions of those scripts (that's why the guide suggests performing it on a local machine or another computer that only you will be accessing).

If you can't do this, You can also

  1. Turn off your webserver (I'm assuming it's apache on a linux varient) : sudo httpd service stop
  2. ssh into your server
  3. navigate to your magento installation root directory
  4. Load your index.php via command-line php : php -f index.php
  5. Turn on your webserver : sudo httpd service start

You may not see any output to your screen, but when you get a command prompt back your installation scripts will have run and any errors will be logged in either the report section where you found your log files or in the var/log/system.log or var/log/exception.log files if you followed the instructions in the upgrade guide and have exception logging enabled.

Related Topic