Timeout trying to delete an item

Hi,
I’m replacing many network equipments. I remove the old ones and then I add the new ones. It was working fine until I got to one that I cannot delete, I get timeout error in web mode. The device is ID 519.

I tried to run the following command in SSH :
lnms device:remove [devicename]
It returns the following message :
In Connection.php line 822:
SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction (Connection: mysql, SQL: delete from syslog where syslog.device_id = 519 and syslog.
device_id is not null)
In Connection.php line 593:
SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction

I tried the following command in MySQL :
MariaDB [librenms]> delete from syslog where syslog.device_id=519 and syslog.device_id is not null;
ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction

Here’s my validate.php :

Component Version
LibreNMS 25.8.0-dev.25+b481497ba (2025-08-05T04:05:55-04:00)
DB Schema 2025_07_10_201918_update_vlans_table (353)
PHP 8.3.14
Python 3.12.3
Database MariaDB 10.11.13-MariaDB-0ubuntu0.24.04.1
RRDTool 1.7.2
SNMP 5.9.4.pre2
===========================================
[OK] Composer Version: 2.8.10
[OK] Dependencies up-to-date.
[OK] Database Connected
[OK] Database Schema is current
[OK] SQL Server meets minimum requirements
[OK] lower_case_table_names is enabled
[OK] MySQL engine is optimal
[OK] Database and column collations are correct
[OK] Database schema correct
[OK] MySQL and PHP time match
[OK] Distributed Polling setting is enabled globally
[OK] Connected to rrdcached
[OK] Active pollers found
[OK] Dispatcher Service is enabled
[OK] Locks are functional
[OK] Python wrapper cron entry is not present
[OK] Redis is functional
[OK] rrdtool version ok
[OK] Connected to rrdcached

What can I do to remove this device ?

I found a way to remove my device.

I ran the following SQL command :
DELETE FROM syslog
WHERE device_id = 519
AND timestamp >= ‘2025-08-05 00:00:00’;

After it finished, I changed the date for 5 days earlier and ran it again. I repeated until I removed a month of log and then I was able to delete my device with the web page.