2

please help to fix these issues

1 exception(s): Exception #0 (LogicException): Infinite loop detected, review the trace for the looping path

Exception #0 (LogicException): Infinite loop detected, review the trace for the looping path

#1 Magento\Checkout\Model\Session\Interceptor->getQuote() called at [vendor/magento/module-checkout/Model/Cart.php:221] #2 Magento\Checkout\Model\Cart->getQuote() called at [generated/code/Magento/Checkout/Model/Cart/Interceptor.php:76] #3 Magento\Checkout\Model\Cart\Interceptor->getQuote() called at [app/code/StripeIntegration/Payments/Helper/Generic.php:439] #4 StripeIntegration\Payments\Helper\Generic->hasSubscriptions() called at [app/code/StripeIntegration/Payments/Plugin/Tax/Config.php:22] #5 StripeIntegration\Payments\Plugin\Tax\Config->aroundGetAlgorithm() called at [vendor/magento/framework/Interception/Interceptor.php:135] #6 Magento\Tax\Model\Config\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153] #7 Magento\Tax\Model\Config\Interceptor->___callPlugins() called at [generated/code/Magento/Tax/Model/Config/Interceptor.php:130] #8 Magento\Tax\Model\Config\Interceptor->getAlgorithm() called at [vendor/magento/module-tax/Model/TaxCalculation.php:163] #9 Magento\Tax\Model\TaxCalculation->calculateTax() called at [vendor/magento/framework/Interception/Interceptor.php:58] #10 Magento\Tax\Model\TaxCalculation\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138] #11 Magento\Tax\Model\TaxCalculation\Interceptor->Magento\Framework\Interception\{closure}() #12 call_user_func_array() called at [vendor/vertex/module-tax/Model/Plugin/TaxCalculationPlugin.php:69] #13 Vertex\Tax\Model\Plugin\TaxCalculationPlugin->aroundCalculateTax() called at [vendor/magento/framework/Interception/Interceptor.php:135] #14 Magento\Tax\Model\TaxCalculation\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153] #15 Magento\Tax\Model\TaxCalculation\Interceptor->___callPlugins() called at [generated/code/Magento/Tax/Model/TaxCalculation/Interceptor.php:26] #16 Magento\Tax\Model\TaxCalculation\Interceptor->calculateTax() called at [vendor/magento/module-tax/Model/Sales/Total/Quote/Subtotal.php:43] #17 Magento\Tax\Model\Sales\Total\Quote\Subtotal->collect() called at [vendor/magento/framework/Interception/Interceptor.php:58] #18 Magento\Tax\Model\Sales\Total\Quote\Subtotal\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138] #19 Magento\Tax\Model\Sales\Total\Quote\Subtotal\Interceptor->Magento\Framework\Interception\{closure}() #20 call_user_func_array() called at [vendor/vertex/module-tax/Model/Plugin/SubtotalPlugin.php:64] #21 Vertex\Tax\Model\Plugin\SubtotalPlugin->aroundCollect() called at [vendor/magento/framework/Interception/Interceptor.php:135] #22 Magento\Tax\Model\Sales\Total\Quote\Subtotal\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153] #23 Magento\Tax\Model\Sales\Total\Quote\Subtotal\Interceptor->___callPlugins() called at [generated/code/Magento/Tax/Model/Sales/Total/Quote/Subtotal/Interceptor.php:26] #24 Magento\Tax\Model\Sales\Total\Quote\Subtotal\Interceptor->collect() called at [vendor/magento/module-quote/Model/Quote/TotalsCollector.php:274] #25 Magento\Quote\Model\Quote\TotalsCollector->collectAddressTotals() called at [vendor/magento/module-quote/Model/Quote/TotalsCollector.php:148] #26 Magento\Quote\Model\Quote\TotalsCollector->collect() called at [vendor/magento/module-quote/Model/Quote.php:1995] #27 Magento\Quote\Model\Quote->collectTotals() called at [generated/code/Magento/Quote/Model/Quote/Interceptor.php:1064] #28 Magento\Quote\Model\Quote\Interceptor->collectTotals() called at [vendor/magento/module-checkout/Model/Session.php:269] #29 Magento\Checkout\Model\Session->getQuote() called at [generated/code/Magento/Checkout/Model/Session/Interceptor.php:63] #30 Magento\Checkout\Model\Session\Interceptor->getQuote() called at [vendor/magento/module-checkout/Controller/Onepage.php:153] #31 Magento\Checkout\Controller\Onepage->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58] #32 Mageplaza\Osc\Controller\Index\Index\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138] #33 Mageplaza\Osc\Controller\Index\Index\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153] #34 Mageplaza\Osc\Controller\Index\Index\Interceptor->___callPlugins() called at [generated/code/Mageplaza/Osc/Controller/Index/Index/Interceptor.php:91] #35 Mageplaza\Osc\Controller\Index\Index\Interceptor->dispatch() called at [vendor/magento/framework/App/FrontController.php:159] #36 Magento\Framework\App\FrontController->processRequest() called at [vendor/magento/framework/App/FrontController.php:99] #37 Magento\Framework\App\FrontController->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58] #38 Magento\Framework\App\FrontController\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138] #39 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/module-store/App/FrontController/Plugin/RequestPreprocessor.php:99] #40 Magento\Store\App\FrontController\Plugin\RequestPreprocessor->aroundDispatch() called at [vendor/magento/framework/Interception/Interceptor.php:135] #41 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php:73] #42 Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch() called at [vendor/magento/framework/Interception/Interceptor.php:135] #43 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153] #44 Magento\Framework\App\FrontController\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/App/FrontController/Interceptor.php:26] #45 Magento\Framework\App\FrontController\Interceptor->dispatch() called at [vendor/magento/framework/App/Http.php:116] #46 Magento\Framework\App\Http->launch() called at [generated/code/Magento/Framework/App/Http/Interceptor.php:24] #47 Magento\Framework\App\Http\Interceptor->launch() called at [vendor/magento/framework/App/Bootstrap.php:261] #48 Magento\Framework\App\Bootstrap->run() called at [index.php:39] 
2
  • can you remove generated and run di compile command do paste errors here for compile command Commented Jun 11, 2020 at 11:15
  • thanks for helping its working now stripe payment module version problem. Commented Jun 11, 2020 at 13:30

2 Answers 2

1

This issue comes some time when we use any custom payment gateway with checkout page. Please disable custom/paid payment gateway first if you are using then try to create order.

Then debug with that specific payment gateway extensions.

Thank you.

1
  • thanks for helping its working now stripe payment module version problem. Commented Jun 11, 2020 at 13:30
4

Do not use checkoutSession->getQuote()!!! it will cause infinite loop for quotes with trigger_recollect = 1, see Quote::_afterLoad() in custom shipping module development.

Alternative you can load a quote like

$isQuoteExists = true; $items = $subject->getAllItems(); if (!empty($items)) { $firstItem = reset($items); if ($firstItem) { $quote = $firstItem->getQuote(); if (!($quote instanceof \Magento\Quote\Model\Quote)) { $isQuoteExists = false; } } }else{ $isQuoteExists = false; } 

You can run your logic remaining logic if $isQuoteExist true or false based on your requirements.

Let me know if you need more help who are facing such issue.

Thanks, Sam

1
  • 2
    Thank you. Using $checkoutSession->getQuote() was indeed the cause of the problem in my case. I used $quote_id = $this->checkout_session->getQuoteId(); and then $this->cart_repository->get($quote_id)->getAllVisibleItems(); to get all items without triggering the infinite loop. Commented Apr 25, 2024 at 13:45

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.