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.55k stars 9.32k forks source link

Klarna logs: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'store_id' in 'where clause' #34236

Closed arsalanworld closed 1 month ago

arsalanworld commented 3 years ago

Preconditions (*)

  1. Magento 2.4.3
  2. Cron jobs are enabled
  3. Debug log is enabled
  4. Make sure there is a payment done using Klarna payment method.

    Steps to reproduce (*)

  5. Run the cron jobs and notice it during midnight at 12AM in var/log/debug.log log file
  6. Or create an object to "Klarna\Core\Cron\CleanLogs" class and try accessing the "execute" method.

Expected result (*)

  1. The cron Jobs should run without an exception
  2. The retrieved logs should be deleted.

Actual result (*)

  1. An exception is thrown: "SQLSTATE[42S22]: Column not found: 1054 Unknown column 'store_id' in 'where clause' query was: SELECT COUNT(*) FROM klarna_logs AS main_table WHERE (store_id = '1') AND (created_at <= '2021-07-06') Exception (PDOException): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'store_id' in 'where clause'

Screenshot from 2021-10-04 17-04-24


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

m2-assistant[bot] commented 3 years ago

Hi @arsalanworld. 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.

Please, add a comment to assign the issue: @magento I am working on this


: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, please join the Community Contributions Triage session to discuss the appropriate ticket.

:movie_camera: You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

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

arsalanworld commented 3 years ago

@magento I am working on this

m2-assistant[bot] commented 3 years ago

Hi @arsalanworld! :wave: Thank you for collaboration. Only members of Community Contributors Team are allowed to be assigned to the issue. Please use @magento add to contributors team command to join Contributors team.

arsalanworld commented 3 years ago

@magento add to contributors team

m2-assistant[bot] commented 3 years ago

Hi @arsalanworld! :wave: Thank you for joining. Please accept team invitation :point_right: here :point_left: and add your comment one more time.

ihor-sviziev commented 3 years ago

@magento/klarna could someone look on it?

m2-assistant[bot] commented 3 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:

m2-assistant[bot] commented 3 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 3 years ago

Hello @arsalanworld,

Thanks for reporting the issue. We have tried to reproduce the issue with the above-mentioned steps and are able to reproduce it by making the object of Klarna\Core\Cron\CleanLogs and call the execute method.

Please find below the screenshot for reference:

Untitled

Thanks

github-jira-sync-bot commented 3 years ago

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

m2-assistant[bot] commented 3 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.

ralbin commented 2 years ago

I have a brand new Adobe commerce cloud project version 2.4.3 that shows the exact same errors. When I review the structure of the table klarna_logs it is missing the column store_id.

MariaDB [main]> DESCRIBE klarna_logs;
+--------------+--------------+------+-----+---------------------+----------------+
| Field        | Type         | Null | Key | Default             | Extra          |
+--------------+--------------+------+-----+---------------------+----------------+
| log_id       | smallint(6)  | NO   | PRI | NULL                | auto_increment |
| status       | varchar(255) | NO   |     | NULL                |                |
| action       | varchar(255) | YES  | MUL | NULL                |                |
| klarna_id    | varchar(255) | YES  | MUL | NULL                |                |
| increment_id | varchar(255) | YES  |     | NULL                |                |
| url          | varchar(255) | NO   |     | NULL                |                |
| method       | varchar(255) | NO   |     | NULL                |                |
| service      | varchar(255) | NO   |     | NULL                |                |
| request      | text         | YES  |     | NULL                |                |
| response     | text         | YES  |     | NULL                |                |
| created_at   | datetime     | NO   |     | current_timestamp() |                |
+--------------+--------------+------+-----+---------------------+----------------+
11 rows in set (0.00 sec)
engcom-Hotel commented 1 month ago

Hello @arsalanworld,

As Klarna is not part of the bundled extension now, we are marking this issue as 3rd party extension. Hence closing this issue.

Thanks