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

Critical Klarna issue on Magento 2.4.3 - request logging blocks checkout #35065

Open bartoszkubicki opened 2 years ago

bartoszkubicki commented 2 years ago

Preconditions (*)

  1. Magento 2.4.3-p1 (but expect it to be reproducible as well on 2.4.3)
  2. Klarna set up and working.

Steps to reproduce (*)

  1. All described here https://docs.klarna.com/platform-solutions/adobe-commerce/adobe-commerce-23x-243/notice-for-users-of-magento-v243/

Expected result (*)

  1. Checkout is not blocked.
  2. Patch from article should be applied long time ago, according to article date / klarna module should be in newer verson with this problem fixed.

Actual result (*)

  1. Checkout is blocked as in provided Klarna article.
  2. Patch from article is not applied, Klarna keeps failing / klarna module is not update.

    Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

m2-assistant[bot] commented 2 years ago

Hi @bartoszkubicki. Thank you for your report. To speed up processing of this issue, make sure that you provided the following information:

Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

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

For more details, review the Magento Contributor Assistant documentation.

Add a comment to assign the issue: @magento I am working on this

To learn more about issue processing workflow, refer to the Code Contributions.


:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

oliverde8 commented 2 years ago

We just had this issue.

The second point that I think should be raised is why it causes all the checkout to fail? We have other payment providers as well and due to this issue, we had no orders coming in.

Regards.

bartoszkubicki commented 2 years ago

@oliverde8 It is caused by poor Klarna error handling. We have multiple fixes on native Klarna module, it throws exception here an there, just because some quote is not matching its conditions, instead of detaching itself from payment methods list.

m2-assistant[bot] commented 2 years ago

Hi @engcom-Delta. 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:

engcom-Delta commented 2 years ago

Hi @bartoszkubicki , Thank you for raising an issue . We have verified the issue on Magento 2.4.3 p1 ,it works fine .We could see that Klarna payment presents during checkout. Hence request to review the provided steps.

Screenshot 2022-03-24 at 3 01 26 PM
oliverde8 commented 2 years ago

Hi @engcom-Delta

As stated in the klarna documentation, you need to have 32767 Klarna orders in the database before this issue appears. You also need to have the parameter, "Logging" Enabled for all these orders. image

So this issue can not be reproduced on a clean Magento install (unless you pass 32767 orders or fill up the table manually). It's a ticking time bomb if the website is using Klarna.

Regards.

engcom-Delta commented 2 years ago

Hi @oliverde8 ,

Many thanks for quick turn around, Would like to clarify once again , do i need to have 32767 Klarna orders in the DB ? or are you referring issue # 32767? .Kindly confirm. Regards,

oliverde8 commented 2 years ago

Hello,

Yes to the DB. You need 32767 entries in the klarna_logs table. The klarna_logs table is using tinyint so the number of logs it can store is quite limited. That's the main problem.

By default the cleanup process keeps 90 days of logs in that table, I doubt we had 32K orders in 3 month (default config). But we didn't check so it might be correct. The patch Klarna provides on their website contains changes (that I find strange) to the cleanup process as well.

As a workaround, We simply disabled the logs and emptied that table and didn't apply that patch.

bartoszkubicki commented 2 years ago

I confirm what @oliverde8 has written. Anyway it is described in Klarna article I've posted in initial post.

m2-assistant[bot] commented 2 years ago

Hi @engcom-Hotel. 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:

engcom-Hotel commented 2 years ago

@magento give me 2.4.3-p1 instance

magento-deployment-service[bot] commented 2 years ago

Hi @engcom-Hotel. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 2 years ago

Hi @engcom-Hotel, unfortunately there is no ability to deploy Magento instance at the moment. Please try again later.

engcom-Hotel commented 2 years ago

Hello @bartoszkubicki,

We have tried to reproduce this issue in latest stable version of Magento i.e. 2.4.3-p1. We have also gone through with the link provided in the main description. The issue seems reproducible by looking into the code base as well as database structure.

Please have a look into the below screenshot of the klarna_logs table: image

The log_id column is still has smallint datatype. Hence confirming this issue.

Thanks

github-jira-sync-bot commented 2 years ago

:white_check_mark: Jira issue https://jira.corp.magento.com/browse/AC-2801 is successfully created for this GitHub issue.

m2-assistant[bot] commented 2 years ago

:white_check_mark: Confirmed by @engcom-Hotel. Thank you for verifying the issue.
Issue Available: @engcom-Hotel, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.