Cannot Delete VS: Lock Wait Timeout Exceeded
When deleting a virtual server, the following message appears:
Mysql2::Error: Lock wait timeout exceeded; try restarting transaction xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
OnApp 3.x.x, 4.x, 5.x, 6.x
There are a couple of different options to solve this issue. It is recommended to increase the lock wait timeout in the MySQL configuration, restart the MySQL server, and then try again to delete the virtual server. In case of any other errors that occur, contact OnApp Support.
To increase the lock wait timeout:
- SSH into the Control Panel server as a root user.
- Edit the
• Under the
[mysqld]section, add or edit
####with the desired amount of seconds. The default amount is 50. It is recommended to increase it to 120 or higher, depending on the volume of disk statistics the virtual servers have.
- Check if there are no transactions are running/pending and stop the OnApp daemon with
- Restart the MySQL server with
- Optionally, verify the MySQL settings by opening the MySQL CLI and running
- Start the OnApp daemon again with
Once it is done, the delete query should finish properly and also prevent the issue from happening in the future.
This error occurs when the database either is too busy or has too many records in the table it is attempting to delete from. It often occurs on virtual servers that have been in the cloud for a long time and if there are other heavy database queries running on the server at the same time.
Please note that this failure may delete the virtual server's vDisk. If the "Error running lvchange: One or more specified logical volume(s) not found." message appears in this following log failure, refer to the Cannot Delete VS: One or More Specified Logical Volume(s) Not Found page.