magento2: Error message when dismiss all completed tasks

Preconditions and environment

  • Magento version 2.4.4

Steps to reproduce

  1. Update products in bulk from product grid
  2. Go to bulk action logs and wait until all action success
  3. Click to View Details in system message

Expected result

The system message should show without error.

Actual result

It’s showing error message image And the log in system.log is [2022-08-29T10:03:41.237871+00:00] .CRITICAL: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0f2687a6-7b98-4f4d-9847-8cf7afdcf7c1' for key 'magento_acknowledged_bulk.MAGENTO_ACKNOWLEDGED_BULK_BULK_UUID', query was: INSERT INTO magento_acknowledged_bulk (bulk_uuid) VALUES (?) [] []

Additional information

No response

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 23 (8 by maintainers)

Most upvoted comments

@mfickers: I have the feeling that this might have been fixed in Magento 2.4.6 by ACP2E-1245: “Something went wrong” error is displayed when clearing the completed bulk tasks. (the commit are a mess, but I think this might be the merge commit: fb586ea)

Maybe you can test this as well and let us know if this fixed it as well in your case, so we can then close this issue?

I can confirm that this commit fixes the issue. I’ve created composer patch based on this commit changes and it works great for Magento 2.4.5-p1

@mfickers: I have the feeling that this might have been fixed in Magento 2.4.6 by ACP2E-1245: “Something went wrong” error is displayed when clearing the completed bulk tasks. (the commit are a mess, but I think this might be the merge commit: https://github.com/magento/magento2/commit/fb586ea689792a3f3c8a9f4b9e6230dc20dda9a6)

Maybe you can test this as well and let us know if this fixed it as well in your case, so we can then close this issue?

From what I can tell the issue is happening because of jQuery and the way it is deciding if an error occurred. Basically, the response from Magento is empty and jquery expects json. This throws a parsing error.

It should be quite easy to fix by just adding an empty json result but I still need to try this.

Spot on. Added this PR/Commit: https://github.com/magento/magento2/pull/36221/commits/f7570c22723cc67be6fae88d14419ec86a36a586

Reused similar approach in vendor/magento/module-asynchronous-operations/Controller/Adminhtml/Bulk/Retry.php to add non-empty json response:

image

From what I can tell the issue is happening because of jQuery and the way it is deciding if an error occurred. Basically, the response from Magento is empty and jquery expects json. This throws a parsing error.

It should be quite easy to fix by just adding an empty json result but I still need to try this.

This was indeed properly fixed in 2.4.6 without any manual file changes. Which merge fixed it that I’m not sure of though.

I can confirm that this commit fixes the issue.

@sdaugherty-rp could you please create a PR for this, so that this fix can be merged into the main code base?