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

Solved: Zend_db_statement_exception object
 
maxwellthomas08
Jr. Member
 
Total Posts:  6
Joined:  2013-02-07
 

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. 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, 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 exists1050 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` (
  `
idint UNSIGNED NOT NULL auto_increment COMMENT 'Id',
  `
perioddate NULL COMMENT 'Period',
  `
store_idsmallint UNSIGNED NULL COMMENT 'Store Id',
  `
product_idint UNSIGNED NULL COMMENT 'Product Id',
  `
product_namevarchar(255NULL COMMENT 'Product Name',
  `
product_pricedecimal(12,4NOT NULL default '0.0000' COMMENT 'Product Price',
  `
views_numint NOT NULL default '0' COMMENT 'Number of Views',
  `
rating_possmallint 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_IDFOREIGN 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_IDFOREIGN 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
                                (
                                )

                        )

                )
 
Magento Community Magento Community
Magento Community
Magento Community
 
maxwellthomas08
Jr. Member
 
Total Posts:  6
Joined:  2013-02-07
 

Solved it!

According to http://duntuk.com/magento-upgrade, I had to go into MySQL and drop the tables

report_viewed_product_aggregated_daily
report_viewed_product_aggregated_monthly
report_viewed_product_aggregated_yearly

Dropping just the daily table would result in an error being created for the monthly table, then creating the error again on daily. I wasn’t sure if the solution was relevant this wasn’t an installation issue but resulted just from clearing the cache. We had recently updated to 1.7 about 2 or 3 weeks ago though

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