MDVA-43824: Order cancellation action failed with error “You have not cancelled the item”

The MDVA-43824 patch solves the issue where the order cancellation action failed with the error: You have not cancelled the item. This patch is available when the Quality Patches Tool (QPT) 1.1.13 is installed. The patch ID is MDVA-43824. Please note that the issue is scheduled to be fixed in Adobe Commerce 2.4.5.

Affected products and versions

The patch is created for Adobe Commerce version:

  • Adobe Commerce (all deployment methods) 2.4.3-p1

Compatible with Adobe Commerce versions:

  • Adobe Commerce (all deployment methods) 2.3.6 - 2.3.7-p3, 2.4.1 - 2.4.4
The patch might become applicable to other versions with new Quality Patches Tool releases. To check if the patch is compatible with your Adobe Commerce version, update the magento/quality-patches package to the latest version and check the compatibility on the Quality Patches Tool: Search for patches page. Use the patch ID as a search keyword to locate the patch.


Order placed by a logged-in customer cannot be cancelled. The order cancellation action failed with the following error:

Zend_Db_Statement_Exception: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`mer33515_ee24developpbdevelop`.`salesrule_customer`, CONSTRAINT `SALESRULE_CUSTOMER_RULE_ID_SEQUENCE_SALESRULE_SEQUENCE_VALUE` FOREIGN KEY (`rule_id`) REFERENCES `sequence_salesrule` (`sequen), query was: INSERT INTO `salesrule_customer` () VALUES (){code}

Steps to reproduce:

  1. Create a sales rule (coupon type is either “Specific Coupon” or “No Coupon”).
  2. Go to the storefront and log in as a customer and add a product to the cart.
  3. Go to the cart and apply the cart price rule if the cart price rule has a coupon as “Specific Coupon”. The cart price rule should be applied successfully.
  4. Go to checkout and place the order with any payment method.
  5. Go to the Commerce Admin > Sales > Orders.
  6. Open the order placed in Step 4.
  7. Click on the Cancel button.

Expected results:

The order is cancelled successfully without any error.

Actual results:

The order cancellation action failed with the following error: You have not cancelled the item.

Apply the patch

To apply individual patches, use the following links depending on your deployment method:

To learn more about Quality Patches Tool, refer to:

For info about other patches available in QPT, refer to Patches available in QPT in our developer documentation.