magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.5k stars 9.3k forks source link

PHP Fatal Error on collect shipping calculating #12435

Closed Adubot closed 6 years ago

Adubot commented 6 years ago

Preconditions

  1. Magento2 Community Edition v2.1.4
  2. PHP 7.0.14
  3. MySQL 5.6.36

Steps to reproduce

  1. Have a cart with some inactive products, some active products and the collect_shipping_rates in quote_address table set on 1
  2. If you are not logged in: try to log in to yourt customer account
  3. If you are logged in, try to access your cart or to log out

Expected result

  1. The cart should be loaded without any error or the customer should be logged in

Actual result

  1. We encounter a PHP Fatal Error Log: "PHP message: PHP Fatal error: Allowed memory size of 536870912 bytes exhausted" on a request like: "GET /customer/section/load/?sections=cart%2Cmessages&update_section_id=false" The problem concerns the vendor/magento/module-quote/Model/ResourceModel/Quote/Item/Collection.php on _assignProducts method. There's a loop on the shipping price calculating.
orlangur commented 6 years ago

PHP Fatal error: Allowed memory size of 536870912 bytes exhausted

Looks like you need to increase memory limit according to the needs of your store, please check http://devdocs.magento.com/guides/v2.0/install-gde/trouble/php/tshoot_php-set.html#trouble-php-memory

Adubot commented 6 years ago

To increase memory limit didn't solve the problem. We did it but this doesn't correct the root cause, and the effects are that more memory is used and servers reach limits faster.

magento-engcom-team commented 6 years ago

@Adubot, thank you for your report. The issue is already fixed in 2.2.1

Adubot commented 6 years ago

Hi @magento-engcom-team , could you please tell me which commits fix this bug? So we could fix it asap in production. Thank you.