Device_perf table reached max value for auto_increment id

My org’s LibreNMS instance had a full polling outage recently because of this. During troubleshooting, I found that devices were returning -1 during polling, which led me to find this error message across all devices:

SQLSTATE[22003]: Numeric value out of range: 167 Out of range value for column 'id' at row 1 (Connection: mysql, SQL: insert into `device_perf` (`min`, `max`, `avg`, `xmt`, `rcv`, `loss`, `debug`, `device_id`, `timestamp`) values (2.4, 2.53, 2.48, 5, 5, 0, {"poller_name":"librenms"}, 1513, 2025-01-15 08:34:54))

I found in DB that the id column in device_perf had auto incremented to the max value of a 32-bit unsigned integer:

MariaDB [librenms]> select max(id) from device_perf limit 1;                
+------------+
| max(id)    |
+------------+
| 4294967295 |          
+------------+

Running the DB clean script in daily.sh was not fixing the issue, so I ended up truncating the device_perf table to fix it.

It looks like the device_perf table has been removed on recent versions of librenms (phew). Hopefully this is not an issue that others will face, but wanted to post info here in case it helps anyone.

P.S. this LibreNMS instance has been running for about 5 years and is up to 4k devices now

FYI, device_perf table no longer exists in LibreNMS. I suggest you update to a recent version.