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.48k stars 9.29k forks source link

Magento 2.3.4 Checkout Infinite loop detected #26786

Closed nazimwibsoft closed 4 years ago

nazimwibsoft commented 4 years ago

Preconditions (*)

  1. Add product to cart and go to checkout page
  2. Select any payment method and try to checkout

Steps to reproduce (*)

  1. Add product to cart and go to checkout page
  2. Select any payment method and try to checkout
  3. Web Browser console will show 500 Internal Server Error

Expected result (*)

  1. Order placed successful

Actual result (*)

  1. 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)"} []

Bug in Code File of 2.3.4

  1. /app/code/Magento/Checkout/Model/Session.php line 240 code is a bug
  2. On line 240 we have the code: if ($this->isLoading) { ... which throw this exception. The private member $isLoading is set to false by default and is only set to true on line number 243 in the Session.php the code will never reach this line as the Quote is not already created and need to be created at line number 244 but we are throwing an error one line 241 which breaks the script. No matter what we select in payment method the code always breaks.
m2-assistant[bot] commented 4 years ago

Hi @nazimwibsoft. Thank you for your report. To help us process this issue please make sure that you provided the following information:

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

@nazimwibsoft do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?


m2-assistant[bot] commented 4 years ago

Hi @krishprakash. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

krishprakash commented 4 years ago

@magento give me 2.4-develop instance

magento-engcom-team commented 4 years ago

Hi @krishprakash. Thank you for your request. I'm working on Magento 2.4-develop instance for you

magento-engcom-team commented 4 years ago

Hi @krishprakash, here is your Magento instance. Admin access: https://i-26786-2-4-develop.instances.magento-community.engineering/admin_bb50 Login: 57631fc1 Password: 234686a4fc9c Instance will be terminated in up to 3 hours.

krishprakash commented 4 years ago

Hi @nazimwibsoft. Not able to reproduce the issue as provided steps by you. Please review below link for reference: https://nimb.ws/JYGxjv Please provide more detail to reproduce this issue Thanks.

krishprakash commented 4 years ago

Hi @nazimwibsoft. It should be 3rd party module issue. Please review the issue #26774 Please provide the video if this is default issue and please confirm on provided automated instance.

nazimwibsoft commented 4 years ago

@krishprakash Thanks for the update and prompt response on this, we have Paypal, and Stripe Payment methods installed on the site which were working fine with 2.3.3 , and after upgrade to 2.3.4 it started this issue of infinite loop message

nazimwibsoft commented 4 years ago

The issue was with the Stripe Payment Integration extension, after updating that to latest 1.5.2 resolved the issue for me. Thanks.

We can install the latest version from here: https://stripe.com/docs/plugins/magento/install

nabilrizvi commented 4 years ago

Infinite loop detected, review the trace for the looping path while checking out for paypal or strip both.. do we have any solution to fix this in Magento 2.3.4??

rahulthakral38 commented 4 years ago

Infinite loop detected, review the trace for the looping path in Payment gateways on checkout.

do we have any solution to fix this in Magento 2.3.4?? Any Solution will be helpful. My Stripe is updated but still issue.

rahulthakral38 commented 4 years ago

Infinite loop detected, review the trace for the looping path in Payment gateways on checkout. magento-payment-checkout

Any solution or any information for this issue patch released..??

walterbak commented 4 years ago

@rahulthakral38 check in your custom code if there is at least one observer on a quote load event (in my case 'payment_method_is_active') that try to load quote from \Magento\Checkout\Model\Session (i.e. in construct function). In this case the constructor of your custom observer try to load quote inside ->getQuote session function, and generate this infinite loop error. So try to load quote from your $observer object (in my case $observer->getQuote()) to solve the problem. It works for me.

ihorvansach commented 4 years ago

In my case this error was related to the custom extension that was installed on the Magento instance. The easiest way to find the the source of the issue is to print backtrace in file vendor/magento/module-checkout/Model/Session.php right before the line throw new \LogicException("Infinite loop detected, review the trace for the looping path");

to detect what plugin/observer/rewrite creates a loop.

roshanyadav89 commented 3 years ago

Any solution for the same I am facing the same issue after m2.3.3 upgrade 2.3.5 EE

ghost commented 3 years ago

change in file vendor/magento/module-checkout/Model/Session.php

This error comes in 2.3.4 or later versions because of

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

Here, $quote->collectTotals(); generates error because of recursive call

so, by commenting $quote->collectTotals(); or whole if condition it will not go in infinite and code will work properly.

Actually there is no need of $quote->collectTotals(); in this file.

nagarajuk12 commented 3 years ago

Thanks Amit-Hariyaniz We have faced the same issue on one of the project yesterday as per your suggestion commented respected line in session.php and issue has been fixed in 2.3 EE.

Thanks

moElwan commented 2 years ago

Hello @Amit-Hariyani Please refer to the original commit and you can see why the code is added and how commenting it would affect some cases when products are unavailable Unused code should be removed, If you're still sure it won't affect anything please open a PR removing the condition Such suggestion to edit core file with the assumption it won't affect anything is really dangerous! Regards

danielpugh commented 2 years ago

just come across this issue on 2.4.3-p1. the problem occurred because using the mageworx delivery date module and the adyen payment method together. i do not want to edit core files, but this does seem to fix the issue. confused why it has been fixed in EE, (i.e. implying identified as a bug), but not the community edition??

SeanWahoo commented 2 years ago

just come across this issue on 2.4.3-p1. the problem occurred because using the mageworx delivery date module and the adyen payment method together. i do not want to edit core files, but this does seem to fix the issue. confused why it has been fixed in EE, (i.e. implying identified as a bug), but not the community edition??

We're on enterprise edition 2.4.3-p1 EE and the issue persists here too. I've had to comment out the offending line and hope that the issue it supposedly fixed (deleted items not being removed from minicarts) doesn't cause a larger issue.

atIOCrON commented 2 years ago

We came across this error on community v2.4.3-p1. Why is this issue "closed" if it still exists? Can anyone point me to a patch? We don't want to comment out lines in core files as there could be serious unintended consequences.

4cpatrickgebhardt commented 1 year ago

Still exists in 2.4.5....

alimurtaza026 commented 1 year ago

Facing it on 2.4.2 why still exists?

PietroFantini commented 1 year ago

yes this garbage still exist

kwilliams-concentrix commented 1 year ago

Still exists in 2.4.5-p2. Can we get an update and reopen?

KoolAndTheHamiltonGang commented 1 year ago

Hi all,

I confirm it still exist on Magento 2.4.6 EE

creativebay commented 11 months ago

Hi All,

the issue still exists in 2.4.6-p2

ravindra0054 commented 1 month ago

hi this issue on magneto2.4.7-p1 Screenshot 2024-07-29 151057

r1tt3r commented 1 week ago

this issue still exists on 2.4.7-p2