Multiple device_perf doesn't exist error

Hello.

I’ve noticed that the Event Log for each device is full of this:
Error in alert rule Packet loss over 10% (13): SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘librenms.device_perf’ doesn’t exist (Connection: mysql, SQL: SELECT * FROM devices,device_perf WHERE (( device_perf.device_id = devices.device_id ) && devices.device_id = 105) && (((devices.status = 1 && ((devices.disabled = 0 && devices.ignore = 0)))) = 1 && (((DATE_SUB(NOW(),INTERVAL 5 MINUTE)) && device_perf.loss)) > 10 ))

It seems that after remove device_perf table the macros, packet_loss_5m for example, doesn’t change.

./validate.php

Component Version
LibreNMS 24.3.0-28-g1911dcb (2024-04-19T23:54:27+03:00)
DB Schema 2024_04_10_093513_remove_device_perf (292)
PHP 8.1.27
Python 3.6.8
Database MariaDB 10.5.24-MariaDB
RRDTool 1.4.8
SNMP 5.7.2
===========================================

[OK] Composer Version: 2.7.2
[OK] Dependencies up-to-date.
[OK] Database connection successful
[WARN] Your database schema has extra migrations (2020_12_14_091314_create_port_groups_table ). If you just switched to the stable release from the daily release, your database is in between releases and this will be resolved with the next release.
[OK] SQL Server meets minimum requirements
[OK] lower_case_table_names is enabled
[OK] MySQL engine is optimal
[OK] MySQL and PHP time match
[OK] Active pollers found
[OK] Dispatcher Service not detected
[OK] Locks are functional
[OK] Python poller wrapper is polling
[OK] Redis is unavailable
[OK] rrd_dir is writable
[OK] rrdtool version ok

Hi!

Please check Improved Latency graph by murrant · Pull Request #15940 · librenms/librenms · GitHub

I upgraded to version 24.4.0 (via daily.sh) with this pull request, but it didn’t help. The packet_loss_5m macro still refer to device_perf table.

./validate.php

Component Version
LibreNMS 24.4.0 (2024-04-20T04:52:35+03:00)
DB Schema 2024_04_10_093513_remove_device_perf (292)
PHP 8.1.27
Python 3.6.8
Database MariaDB 10.5.24-MariaDB
RRDTool 1.4.8
SNMP 5.7.2
===========================================

[OK] Composer Version: 2.7.2
[OK] Dependencies up-to-date.
[OK] Database connection successful
[WARN] Your database schema has extra migrations (2020_12_14_091314_create_port_groups_table ). If you just switched to the stable release from the daily release, your database is in between releases and this will be resolved with the next release.
[OK] SQL Server meets minimum requirements
[OK] lower_case_table_names is enabled
[OK] MySQL engine is optimal
[OK] MySQL and PHP time match
[OK] Active pollers found
[OK] Dispatcher Service not detected
[OK] Locks are functional
[OK] Python poller wrapper is polling
[OK] Redis is unavailable
[OK] rrd_dir is writable
[OK] rrdtool version ok

Sorry, what I mean referencing that is device_perf table has been dropped so alerts based on that will fail.

Maybe @murrant can take a look to where is reference and switch it to the correct table?

I was going to try to fix that, but it got merged before I did.

The data does not exist in the database anymore because it was problematic and kept breaking people’s installs.

quick fix is in packet_loss macros quick fix by murrant · Pull Request #15961 · librenms/librenms · GitHub