Zend_Db_Statement_Exception Object

Category: Magento

unionsurfera
Asked:
2013-04-23 12:57 pm EST

Hits: 1,225

I can no longer access the backend or frontend of my Magento site. When trying to do either, I get a long error that constantly refreshes. I’ve pasted part of it here, but the actual error is much longer and I can provide more if needed. I was trying to execute a dataflow profile to import new products and was receiving this error: “SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction”. When I tried to flush the cache via admin panel afterwards, this error message appeared. I’m not sure if this is related to the main problem.

As far as I can tell its a MySQL error, however I’m very limited in my knowledge of anything and would appreciate any help, as simple as possible for lamens!

Zend_Db_Statement_Exception Object
(
[_previous:Zend_Exception:private] =>
[message:protected] => SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'report_viewed_product_aggregated_daily' already exists
[string:Exception:private] =>
[code:protected] => 42
[file:protected] => /home/unions8/public_html/lib/Zend/Db/Statement/Pdo.php
[line:protected] => 234
[trace:Exception:private] => Array

You must login before you can ask a follow up question.

You must login before you can submit an answer.

Zend_Db_Statement_Exception Object
(
[_previous:Zend_Exception:private] =>
[message:protected] => SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'report_viewed_product_aggregated_daily' already exists
[string:Exception:private] =>
[code:protected] => 42
[file:protected] => /home/unions8/public_html/lib/Zend/Db/Statement/Pdo.php
[line:protected] => 234
[trace:Exception:private] => Array
(
[0] => Array
(
[file] => /home/unions8/public_html/lib/Varien/Db/Statement/Pdo/Mysql.php
[line] => 110
[function] => _execute
[class] => Zend_Db_Statement_Pdo
[type] => ->
[args] => Array
(
[0] => Array
(
)

)

)

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

)

)

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

)

)

[3] => Array
(
[file] => /home/unions8/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php
[line] => 238
[function] => query
[class] => Zend_Db_Adapter_Abstract
[type] => ->
[args] => Array
(
[0] => CREATE TABLE `report_viewed_product_aggregated_daily` (
`id` int UNSIGNED NOT NULL auto_increment COMMENT 'Id',
`period` date NULL COMMENT 'Period',
`store_id` smallint UNSIGNED NULL COMMENT 'Store Id',
`product_id` int UNSIGNED NULL COMMENT 'Product Id',
`product_name` varchar(255) NULL COMMENT 'Product Name',
`product_price` decimal(12,4) NOT NULL default '0.0000' COMMENT 'Product Price',
`views_num` int NOT NULL default '0' COMMENT 'Number of Views',
`rating_pos` smallint UNSIGNED NOT NULL default '0' COMMENT 'Rating Pos',
PRIMARY KEY (`id`),
UNIQUE `UNQ_REPORT_VIEWED_PRD_AGGRED_DAILY_PERIOD_STORE_ID_PRD_ID` (`period`, `store_id`, `product_id`),
INDEX `IDX_REPORT_VIEWED_PRODUCT_AGGREGATED_DAILY_STORE_ID` (`store_id`),
INDEX `IDX_REPORT_VIEWED_PRODUCT_AGGREGATED_DAILY_PRODUCT_ID` (`product_id`),
CONSTRAINT `FK_REPORT_VIEWED_PRD_AGGRED_DAILY_STORE_ID_CORE_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_REPORT_VIEWED_PRD_AGGRED_DAILY_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE
) COMMENT='Most Viewed Products Aggregated Daily' ENGINE=INNODB charset=utf8 COLLATE=utf8_general_ci
[1] => Array
(
)

)

)
unionsurfera
13 Points
2013-04-23 12:59 pm EST

OTHER ANSWERS

0

Scott
Staff
20,848 Points
2013-04-23 1:28 pm EST
Hello unionsurfera,

That error means that there is an existing table or view named report_viewed_product_aggregated_daily and the script that is failing is likely trying to create it. As for a cause, that seems to be a Magento specific reason based upon the research. There are many forum posts relating to that error and it's fix but they all seem to be a bit different.

You may want to do a search for the error "Base table or view already exists:" and see which post relates to your situation.

Best Regards,
Scott M

You must login before you can post a comment about this answer.

Solved it by following the instructions on http://duntuk.com/magento-upgrade about dropping the tables, even though it was related to an installation problem!
unionsurfera
13 Points
2013-04-24 5:40 am EST
Like this Question?

Related Articles

It looks like there are no related articles.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!