Infinite loop detected on checkout - Magento 2

Blank Admin Page - Magento 2


Are you stuck in checkout infinite loop in magento 2 ?

We have also faced the same problem while working with magento version 2.3.4 or later.

Here, we found solution which worked for us.

We have tried below solution and it worked for us, but we strongly recommend to solve the problem in another way and if you are fully confident than use below solution.

Error we faced is :


                                Error received: main.CRITICAL: Report ID: webapi-5e3d62454a015;
                                Message: Infinite loop detected, review the trace for the looping path
                                {"exception":"[object]
                                (Exception(code: 0):
                                Report ID: webapi-5e3d62454a015;
                                Message: Infinite loop detected, review the trace for the looping path at ...\vendor\magento\framework\Webapi\ErrorProcessor.php:208,
                                LogicException(code: 0): Infinite loop detected, review the trace for the looping path at ..\vendor\magento\module-checkout\Model\Session.php:241)"}
                            

which shows vendor/magento/module-checkout/Model/Session.php line 240 code is a bug

Solution we have applied is :

commented // $quote->collectTotals();
in file vendor/magento/module-checkout/Model/Session.php

Before :


                                if($quote->getTotalsCollectedFlag() === false)
                                {
                                    $quote->collectTotals();
                                }
                            

After :


                                if($quote->getTotalsCollectedFlag() === false)
                                {
                                   // $quote->collectTotals();
                                }
                            

In our case it works perfectly , without affecting other functionalities the error gone and the problem of infinite loop is solved.

However again we recommend that you review other solutions before using this and post issue on github or use above solution at your own risk (As change made in magento 2 core file).

For any suggestions, reviews or queries Contact Us