cancel
Showing results for 
Search instead for 
Did you mean: 

PHP Fatal error on collect shipping calculation

PHP Fatal error on collect shipping calculation

Hello,
We encounter a PHP Fatal Error on our Magento2 Community Edition v2.1.4.
This case happens when we try to access cart or log in if we have in the cart: some inactive products, some active products and the collect_shipping_rates in quote_address table set to 1.
Here is the log of the error:
"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.

 

Is anyone had this error and could help us?

 

Configuration:

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

Re: PHP Fatal error on collect shipping calculation

Hi @ADubot,

 

I've made a test with 2.1.10 (I'll recommend you upgrade to that version because security).

In my case, I've added the product to the cart and then I've disabled.

Product disableProduct disable

 

Then I've clicked to see my cart.

 

CartCart

Of course, there is a problem there (but to be fair I didnt' clean cache and my cronjobs and reindexers are not running in this dev environment).

 

Mini cartMini cart

 The mini cart didn't refreseh but, as I said, I've just disabled the product and I dind't execute another command.

 

 

 

Re: PHP Fatal error on collect shipping calculation

Maybe if you can reproduce the issue on a vanilla installation you could create an Issue on GitHub with the proper instructions: https://github.com/magento/magento2/issues

Re: PHP Fatal error on collect shipping calculation

Hi @Damian Culotta,

Did you have the possibility to test a case with 1 enabled product and 1 disabled product in the cart?

Because we checked that was this case that caused the fatal error: Magento tried to delete the disabled product but didn't succeed in, and caused a lot of memory usage until reaching the memory limit.

Thank you