2

Description:

After a customer logs into my shop, the script receives a stack overflow, execution timeout or exhausted memory size. But only at one store view (en_GB). I guess it's a loop. I have only one magento-website with one store and a few store views. They are identical except for language/localization and each of them use the same templates etc. It doesn't matter which page I want to open in this store view (en_GB), it's always the same problem. If you log in to another store view and everything works and you change to this special store ID (en_GB), it's broken again until you delete all cookies. The status of the visitor is important: Without a logged-in user, the entire shop functions perfectly and you can change the shop IDs as many times as you want.

My setup:

  • Ubuntu 18.04
  • Nginx 1.14
  • PHP 7.1
  • HAProxy 1.88
  • Magento 1.9.3.9 & PHP 7.2 PATCH
  • Redis 4.0.9 & MariaDB 10.1.34 (on another server)

After the update of PHP and the increase of the memory limit, there are only exceptions to the maximum execution time. I guess after 30 seconds it's random which message is displayed.

Error Messages:

Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/magento/app/code/core/Zend/Db/Select.php on line 1012[, 821, 1139]

or

Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/magento/lib/Varien/Object.php on line 625

or

Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/magento/lib/Varien/Simplexml/Element.php on line 195

or

Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/magento/app/Mage.php on line 479

or

Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/magento/lib/Zend/Locale/Math.php on line 244

or

Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/magento/app/code/core/Mage/Sales/Model/Quote/Item/Abstract.php on line 255

or

Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/magento/lib/Zend/Db/Statement/Pdo.php on line 431

There are no exceptions in the Magento logs. I don't know how to properly debug that. I've already deleted all caches and reindexed the database.

What I've already done:

  • Delete all cookies and try again.
  • Create new user in special store view (en_GB) and use its credentials. It works for this special store view (en_GB), but the change to another store view (e.g. de_DE) killed it again. It's the other way round.
  • Activate and deactivate persistent shopping cart.
  • Activate and deactivate session validation: Use SID in Frontend
  • Change session storage from file to redis.
  • Update SQL and PHP.

I've checked the general query log of SQL and found the following queries over and over again, maybe it's suspicious and give a hint. They occurred at the main page with a few widgets in a cms-page that are linking to the categories.

 LEFT JOIN `cataloginventory_stock_status` AS `status_table` ON main_table.product_id=status_table.product_id AND main_table.stock_id=status_table.stock_id AND status_table.website_id='1' WHERE (`main_table`.`stock_id` = '1') AND (`main_table`.`product_id` IN('47881'))
            6 Query SELECT `catalogrule_product_price`.`product_id`, `catalogrule_product_price`.`rule_price` FROM `catalogrule_product_price` WHERE (rule_date = '2018-09-28') AND (website_id = '1') AND (customer_group_id = '0') AND (product_id IN('47881'))
            6 Query SELECT `main_table`.* FROM `sales_flat_quote_address_item` AS `main_table` WHERE (`quote_address_id` = '78723')
            6 Query SELECT `main_table`.* FROM `sales_flat_quote_address_item` AS `main_table` WHERE (`quote_address_id` = '78724')
            6 Query SELECT `catalog_product_entity_group_price`.`value_id` AS `price_id`, `catalog_product_entity_group_price`.`website_id`, `catalog_product_entity_group_price`.`all_groups`, `catalog_product_entity_group_price`.`customer_group_id` AS `cust_group`, `catalog_product_entity_group_price`.`value` AS `price`, `catalog_product_entity_group_price`.`is_percent` FROM `catalog_product_entity_group_price` WHERE (entity_id='47881') AND (website_id = 0)
            6 Query SELECT `sales_flat_quote`.* FROM `sales_flat_quote` WHERE (`sales_flat_quote`.`entity_id`='39295') AND (store_id IN ('1', '4', '5', '3', '6', '7', '8', '9', '10', '2', '11', '12', '13', '15', '14')) AND (is_active = 1)
            6 Query SELECT `main_table`.* FROM `sales_flat_quote_address` AS `main_table` WHERE (`quote_id` = '39295')
            6 Query SELECT `main_table`.* FROM `sales_flat_quote_item` AS `main_table` WHERE (`quote_id` = '39295')
            6 Query SELECT `main_table`.* FROM `sales_flat_quote_item_option` AS `main_table` WHERE (`item_id` IN(81750))
            6 Query SELECT DISTINCT ea.attribute_code FROM `salesrule_product_attribute` AS `a`
 INNER JOIN `eav_attribute` AS `ea` ON ea.attribute_id = a.attribute_id
            6 Query SELECT `e`.* FROM `catalog_product_entity` AS `e` WHERE (`e`.`entity_id` IN(47881, 47881))
            6 Query SELECT `t_d`.`entity_id`, `t_d`.`attribute_id`, `t_d`.`value` AS `default_value`, `t_s`.`value` AS `store_value`, IF(t_s.value_id IS NULL, t_d.value, t_s.value) AS `value` FROM `catalog_product_entity_varchar` AS `t_d`
 LEFT JOIN `catalog_product_entity_varchar` AS `t_s` ON t_s.attribute_id = t_d.attribute_id AND t_s.entity_id = t_d.entity_id AND t_s.store_id = 2 WHERE (t_d.entity_type_id = 4) AND (t_d.entity_id IN (47881)) AND (t_d.attribute_id IN ('71', '98', '97', '87', '86', '118', '119', '122', '130')) AND (t_d.store_id = 0) UNION ALL SELECT `t_d`.`entity_id`, `t_d`.`attribute_id`, `t_d`.`value` AS `default_value`, `t_s`.`value` AS `store_value`, IF(t_s.value_id IS NULL, t_d.value, t_s.value) AS `value` FROM `catalog_product_entity_int` AS `t_d`
 LEFT JOIN `catalog_product_entity_int` AS `t_s` ON t_s.attribute_id = t_d.attribute_id AND t_s.entity_id = t_d.entity_id AND t_s.store_id = 2 WHERE (t_d.entity_type_id = 4) AND (t_d.entity_id IN (47881)) AND (t_d.attribute_id IN ('96', '102', '121', '100', '126', '123', '127', '125', '124', '128')) AND (t_d.store_id = 0) UNION ALL SELECT `t_d`.`entity_id`, `t_d`.`attribute_id`, `t_d`.`value` AS `default_value`, `t_s`.`value` AS `store_value`, IF(t_s.value_id IS NULL, t_d.value, t_s.value) AS `value` FROM `catalog_product_entity_decimal` AS `t_d`
 LEFT JOIN `catalog_product_entity_decimal` AS `t_s` ON t_s.attribute_id = t_d.attribute_id AND t_s.entity_id = t_d.entity_id AND t_s.store_id = 2 WHERE (t_d.entity_type_id = 4) AND (t_d.entity_id IN (47881)) AND (t_d.attribute_id IN ('75', '80', '76', '120')) AND (t_d.store_id = 0) UNION ALL SELECT `t_d`.`entity_id`, `t_d`.`attribute_id`, `t_d`.`value` AS `default_value`, `t_s`.`value` AS `store_value`, IF(t_s.value_id IS NULL, t_d.value, t_s.value) AS `value` FROM `catalog_product_entity_datetime` AS `t_d`
 LEFT JOIN `catalog_product_entity_datetime` AS `t_s` ON t_s.attribute_id = t_d.attribute_id AND t_s.entity_id = t_d.entity_id AND t_s.store_id = 2 WHERE (t_d.entity_type_id = 4) AND (t_d.entity_id IN (47881)) AND (t_d.attribute_id IN ('77', '78')) AND (t_d.store_id = 0) UNION ALL SELECT `t_d`.`entity_id`, `t_d`.`attribute_id`, `t_d`.`value` AS `default_value`, `t_s`.`value` AS `store_value`, IF(t_s.value_id IS NULL, t_d.value, t_s.value) AS `value` FROM `catalog_product_entity_text` AS `t_d`
 LEFT JOIN `catalog_product_entity_text` AS `t_s` ON t_s.attribute_id = t_d.attribute_id AND t_s.entity_id = t_d.entity_id AND t_s.store_id = 2 WHERE (t_d.entity_type_id = 4) AND (t_d.entity_id IN (47881)) AND (t_d.attribute_id IN ('101')) AND (t_d.store_id = 0)
            6 Query SELECT `cataloginventory_stock_status`.`product_id`, `cataloginventory_stock_status`.`stock_status` FROM `cataloginventory_stock_status` WHERE (product_id IN('47881')) AND (stock_id=1) AND (website_id=1)
            6 Query SELECT `main_table`.*, `default_option_title`.`title` AS `default_title`, `store_option_title`.`title` AS `store_title`, IF(store_option_title.title IS NULL, default_option_title.title, store_option_title.title) AS `title`, `default_option_price`.`price` AS `default_price`, `default_option_price`.`price_type` AS `default_price_type`, `store_option_price`.`price` AS `store_price`, `store_option_price`.`price_type` AS `store_price_type`, IF(store_option_price.price IS NULL, default_option_price.price, store_option_price.price) AS `price`, IF(store_option_price.price_type IS NULL, default_option_price.price_type, store_option_price.price_type) AS `price_type` FROM `catalog_product_option` AS `main_table`
 INNER JOIN `catalog_product_option_title` AS `default_option_title` ON default_option_title.option_id = main_table.option_id
 LEFT JOIN `catalog_product_option_title` AS `store_option_title` ON store_option_title.option_id = main_table.option_id AND store_option_title.store_id = '2'
 LEFT JOIN `catalog_product_option_price` AS `default_option_price` ON default_option_price.option_id = main_table.option_id AND default_option_price.store_id = 0
 LEFT JOIN `catalog_product_option_price` AS `store_option_price` ON store_option_price.option_id = main_table.option_id AND store_option_price.store_id = '2' WHERE (default_option_title.store_id = 0) AND (`product_id` IN('47881'))
            6 Query SELECT `core_url_rewrite`.`product_id`, `core_url_rewrite`.`request_path` FROM `core_url_rewrite` WHERE (store_id = 2) AND (is_system = 1) AND (category_id = 0 OR category_id IS NULL) AND (product_id IN('47881')) ORDER BY `category_id` DESC
            6 Query SELECT `catalog_product_entity_tier_price`.`value_id` AS `price_id`, `catalog_product_entity_tier_price`.`website_id`, `catalog_product_entity_tier_price`.`all_groups`, `catalog_product_entity_tier_price`.`customer_group_id` AS `cust_group`, `catalog_product_entity_tier_price`.`qty` AS `price_qty`, `catalog_product_entity_tier_price`.`value` AS `price`, `catalog_product_entity_tier_price`.`entity_id` AS `product_id` FROM `catalog_product_entity_tier_price` WHERE (entity_id IN('47881')) AND (website_id = 0) ORDER BY `entity_id` ASC, `qty` ASC
            6 Query SELECT `main_table`.*, `cp_table`.`type_id`, `status_table`.`stock_status` FROM `cataloginventory_stock_item` AS `main_table`
 INNER JOIN `catalog_product_entity` AS `cp_table` ON main_table.product_id = cp_table.entity_id
 LEFT JOIN `cataloginventory_stock_status` AS `status_table` ON main_table.product_id=status_table.product_id AND main_table.stock_id=status_table.stock_id AND status_table.website_id='1' WHERE (`main_table`.`stock_id` = '1') AND (`main_table`.`product_id` IN('47881'))
            6 Query SELECT `catalogrule_product_price`.`product_id`, `catalogrule_product_price`.`rule_price` FROM `catalogrule_product_price` WHERE (rule_date = '2018-09-28') AND (website_id = '1') AND (customer_group_id = '0') AND (product_id IN('47881'))
            6 Query SELECT `main_table`.* FROM `sales_flat_quote_address_item` AS `main_table` WHERE (`quote_address_id` = '78723')

If you need more information, please let me know and thank you in advance!


Edit (24.10.2018):

After re-generating the "en_gb" store view, I saw this loop behavior when changing the currency to Pounds in the configuration. When I use Euro as my default currency in this store view, everything works fine. Any ideas how i can debug this?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.