In cases where you get an error like this Lock wait timeout exceeded; try restarting transaction, it indicates that a transaction is waiting for a lock to be released, but the wait time has exceeded the configured limit.

Interactive InnoDB Row Locks & Lock Wait Timeout
INNODB LOCK MANAGER · TABLE orders TX A (Thread 41) UPDATE id=42 RUNNING (uncommitted) TX B (Thread 58) idle ready Row Lock · orders (PRIMARY id = 42) Holder: TX A (Exclusive X-Lock) Waiters: none innodb_lock_wait_timeout (50s) Wait elapsed: 0s / 50s

MariaDB / InnoDB Trace

To resolve this issue, you can try the following steps: Increase the innodb_lock_wait_timeout: This setting controls how long a transaction will wait for a lock before timing out. You can increase this value in your MariaDB configuration file (usually my.cnf) under the [mysqld] section:

[mysqld]
innodb_lock_wait_timeout = 120  # Set to 120 seconds, adjust as needed