Skip to content

Wrong handling some of asynchronous bulk operations and related mysql queue messages in Magento 2.4.0 #29718

Closed
@Neos2007

Description

@Neos2007

Preconditions (*)

  1. Magento version: 2.4.0
  2. Configured cron for running message queue consumers.

Steps to reproduce (*)

  1. On the product grid in the backend perform massaction to update attribute values for couple products ("check" products and select "Update Attributes" action from "Actions" dropdown).
  2. Set values for needed attributes or/and assign products to websites and save.
  3. After the page reloads will be displayed a message like "Task "Update attributes for N selected products": 1 item(s) have been scheduled for an update."
  4. Wait some time and reload the backend page.

Expected result (*)

  1. Displayed messages like "1 item(s) have been successfully updated...".
  2. Attribute values for related products updated.
  3. In DB new record in "magento_bulk" and new record(s) in "magento_operation" table (operations related to the bulk).
  4. New record(s) in the "queue_message" (related to the queues "product_action_attribute.update" and/or product_action_attribute.website.update) and new related record(s) in the "queue_message_status" table with status "4".

Actual result (*)

  1. In system messages still displayed a message like "Task "Update attributes for N selected products": 1 item(s) have been scheduled for an update."
  2. Attribute values for the products updated.
  3. A new record in "message_bulk" table but no related record(s) in "magento_operation" table.
  4. New related records in "queue_message" and "queue_message_status" tables but records in the last table with error stauts (status value "6").
  5. In magento system.logs added string with error: main.CRITICAL: Message has been rejected: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'operation_key' cannot be null, query was: INSERT INTO magento_operation (id, bulk_uuid, topic_name, serialized_data, result_serialized_data, status, error_code, result_message, operation_key) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [] []

During debugging I found out that since Magento 2.4.0 version into "magento_operation" table was added new required (not nullable) column 'operation_key'. But neither controller action which schedules updated product attributes update bulk (\Magento\Catalog\Controller\Adminhtml\Product\Action\Attribute\Save::publish()) nor consumer which executes related messages and updates bulk status(\Magento\Catalog\Model\Attribute\Backend\Consumer::process()) does setting "operation_key" value into related operation. And during an attempt to save operation in the consumer (app/code/Magento/Catalog/Model/Attribute/Backend/Consumer.php:140) trows exception. As result operation is not saved and the status of the reladed message in the "queue_message_status" saved with value "6".

Also, the same problem for code that pushes/handles bulks related to the "media.storage.catalog.image.resize" queue.


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

  • 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”.

Metadata

Metadata

Assignees

Labels

Component: AsynchronousOperationsFixed in 2.4.xThe issue has been fixed in 2.4-develop branchIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: doneReported on 2.4.0Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchSeverity: S2Major restrictions or short-term circumventions are required until a fix is available.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions