For the past month or so the nightly cron job catalogrule_apply_all has been failing with the following error showing up in the error logs:
SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction, query was: RENAME TABLE catalogrule_product TO catalogrule_producta6946100,catalogrule_product__temp11892612 TO catalogrule_product,catalogrule_product_price TO catalogrule_product_price90125c0a,catalogrule_product_price__temp97a2dda6 TO catalogrule_product_price,catalogrule_group_website TO catalogrule_group_websiteb0d46c8f,catalogrule_group_website__tempded0d19d TO catalogrule_group_website
Occasionally when this error happens the catalog rule sale pricing on our site will stop working on the site. A manual index is needed to correct it. The error happens every day but the pricing only stops working once in awhile.
Any ideas on where to start debugging this? I've looked at various different things and can't seem to figure out what is causing this.
Using Magento enterprise edition 2.4.3-p1
Hello @Steve
The "Database Lock Wait Timeout Error" on the catalogrule_apply_all cron job in Magento 2 can occur when the cron job is unable to acquire a database lock within the specified timeout period. This error can be caused by various factors, such as heavy database load, slow queries, or misconfigured server settings.
Please follow the steps below to resolve this error:
If you find our reply helpful, please give us kudos.
A Leading Magento Development Agency That Delivers Powerful Results, Innovation, and Secure Digital Transformation.
WebDesk Solution Support Team
Get a Free Quote | | Adobe Commerce Partner | Hire Us | Call Us 877.536.3789
Thank You,
WebDesk Solution Support Team
Get a Free Quote | Email | Adobe Commerce Partner | Hire Us | Call Us 877.536.3789
Location: 150 King St. W. Toronto, ON M5H 1J9