ACSD-67347: Order fails with Cannot acquire a lock error when using coupon codes
The ACSD-67347 patch fixes the issue where orders fail with a Cannot acquire a lock error when coupon codes contain special characters (for example, BIT/123456) and file locking is enabled. This patch is available when the Quality Patches Tool (QPT) 1.1.69 is installed. The patch ID is ACSD-67347. Please note that this issue is scheduled to be fixed in ۶Ƶ Commerce 2.4.9.
Affected products and versions
The patch is created for ۶Ƶ Commerce version:
- ۶Ƶ Commerce (all deployment methods) 2.4.5-p12
Compatible with ۶Ƶ Commerce versions:
- ۶Ƶ Commerce (all deployment methods) 2.4.5-p11 - 2.4.5-p13
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.Issue
Orders fail with the Cannot acquire a lock error when coupons with special characters are used and file locking is enabled.
Steps to reproduce:
-
Install 2.4-develop.
-
Set the file lock configuration in the
env.php
file:code language-none 'lock' => [ 'provider' => 'file', 'config' => [ 'path' => '/Users/awijesooriya/sites/acsd15194dev/locks' ] ],
-
Create a cart rule with a coupon using the coupon code format: BIT/123456.
-
Create a simple product.
-
Add the product to the cart and apply the coupon code.
-
Proceed to checkout and place the order.
Expected results:
Orders are placed successfully because there are no restrictions on creating coupon codes.
Actual results:
The order cannot be placed. The following error appears: Cannot acquire lock.
File "/Users/test/sites/test/locks/coupon_code_123/abc" cannot be opened Warning!fopen(/Users/test/sites/test/locks/coupon_code_123/abc): Failed to open stream: No such file or directory
Apply the patch
To apply individual patches, use the following links depending on your deployment method:
- ۶Ƶ Commerce or Magento Open Source on-premises: Quality Patches Tool > Usage in the Quality Patches Tool guide.
- ۶Ƶ Commerce on cloud infrastructure: Upgrades and Patches > Apply Patches in the Commerce on Cloud Infrastructure guide.
Related reading
To learn more about Quality Patches Tool, refer to:
- Quality Patches Tool: A self-service tool for quality patches in the Tools guide.