No Alerts result found when visiting /alerts but there's Alert History result

Good Day Everyone!

We’re having trouble with the /alerts page showing “No results found!”, which we noticed earlier at midnight. The notifications also suddenly stopped. However, /alert-log still seems to load just fine.

I did the ff:

  • Ran “./daily.sh” multiple times but did not work
  • Checked librenms.log under librenms directory and found this 2 query errors related to alerts ( hoping this was the cause ).
[2025-06-18T11:12:02][ERROR] SQLSTATE[42S22]: Column not found: 1054 Unknown column 'alert_rules.rule' in 'field list' (Connection: dbFacile, SQL: SELECT alert_log.id,alert_log.rule_id,alert_log.device_id,alert_log.state,alert_log.details,alert_log.time_logged,alert_rules.rule,alert_rules.severity,alert_rules.extra
,alert_rules.name,alert_rules.query,alert_rules.builder,alert_rules.proc FROM alert_log,alert_rules WHERE alert_log.rule_id = alert_rules.id && alert_log.device_id = 230 && alert_log.rule_id = 1 && alert_rules.disabled = 0 ORDER BY alert_log.id DESC LIMIT 1)#0 /opt/librenms/LibreNMS/Alert/RunAlerts.php(445): dbFetc
hRow()
#1 /opt/librenms/LibreNMS/Alert/RunAlerts.php(478): LibreNMS\Alert\RunAlerts->loadAlerts()
#2 /opt/librenms/alerts.php(61): LibreNMS\Alert\RunAlerts->runAlerts()
#3 {main}

[2025-06-18T11:13:16][ERROR] SQLSTATE[42S22]: Column not found: 1054 Unknown column 'alert_rules.rule' in 'field list' (Connection: dbFacile, SQL: SELECT `alerts`.*, IFNULL(CONVERT_TZ(`alerts`.`timestamp`, @@global.time_zone, Asia/Shanghai),`alerts`.`timestamp`) AS timestamp_display, `devices`.`hostname`, `devices`
.`sysName`, `devices`.`display`, `devices`.`os`, `devices`.`hardware`, `locations`.`location`, `alert_rules`.`rule`, `alert_rules`.`name`, `alert_rules`.`severity`  FROM `alerts` LEFT JOIN `devices` ON `alerts`.`device_id`=`devices`.`device_id` LEFT JOIN `locations` ON `devices`.`location_id` = `locations`.`id`  RIGHT JOIN `alert_rules` ON `alerts`.`rule_id`=`alert_rules`.`id` WHERE  `devices`.`disabled` = 0 AND `alerts`.`state`!=0 ORDER BY timestamp DESC LIMIT 0,50)#0
/opt/librenms/includes/html/table/alerts.inc.php(131): dbFetchRows()
#1 /opt/librenms/html/ajax_table.php(45): include_once('...')
#2 {main}

I checked the alert_rules tables and there’s no column “rule” as it was removed during the migration 2025_06_11_173916_drop_alert_rule.php


./validate.php result

Component Version
LibreNMS 25.6.0-7-g581c30683 (2025-06-18T10:05:30+08:00)
DB Schema 2025_06_11_173916_drop_alert_rule (344)
PHP 8.3.21
Python 3.8.10
Database MariaDB 10.5.11-MariaDB-1:10.5.11+maria~bionic
RRDTool 1.7.2
SNMP 5.8
===========================================

[OK] Composer Version: 2.8.9
[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
PHP Error(2): stream_socket_client(): Unable to connect to tcp://127.0.0.1:6379 (Connection refused) from vendor/predis/predis/src/Connection/Resource/StreamFactory.php:209 in /opt/librenms/LibreNMS/Validations/Poller/CheckRedis.php:67
[OK] Active pollers found
[OK] Dispatcher Service not detected
[OK] Locks are functional
[OK] Python poller wrapper is polling
[OK] Redis is unavailable
[OK] rrdtool version ok
[OK] Connected to rrdcached

3 Likes

Hello.
I’ve the exact same error:

librenms@librenms:~$ ./validate.php

Component Version
LibreNMS 25.6.0-5-g91ad01ffb (2025-06-17T15:02:12+01:00)
DB Schema 2025_06_11_173916_drop_alert_rule (344)
PHP 8.3.20
Python 3.10.12
Database MariaDB 10.6.22-MariaDB-0ubuntu0.22.04.1
RRDTool 1.7.2
SNMP 5.9.1
===========================================

[OK] Composer Version: 2.8.9
[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
PHP Error(2): stream_socket_client(): Unable to connect to tcp://127.0.0.1:6379 (Connection refused) from vendor/predis/predis/src/Connection/Resource/StreamFactory.php:209 in /opt/librenms/LibreNMS/Validations/Poller/CheckRedis.php:67
[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
librenms@librenms:~$

librenms.log

[2025-06-18T04:27:02][ERROR] SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘alert_rules.rule’ in ‘SELECT’ (Connection: dbFacile, SQL: SELECT alert_log.id,alert_log.rule_id,alert_log.device_id,alert_log.state,alert_log.details,alert_log.time_logged,alert_rules.rule,alert_rules.severity,alert_rules.extra,alert_rules.name,alert_rules.query,alert_rules.builder,alert_rules.proc FROM alert_log,alert_rules WHERE alert_log.rule_id = alert_rules.id && alert_log.device_id = 352 && alert_log.rule_id = 7 && alert_rules.disabled = 0 ORDER BY alert_log.id DESC LIMIT 1)#0 /opt/librenms/LibreNMS/Alert/RunAlerts.php(445): dbFetchRow()
#1 /opt/librenms/LibreNMS/Alert/RunAlerts.php(478): LibreNMS\Alert\RunAlerts->loadAlerts()
#2 /opt/librenms/alerts.php(61): LibreNMS\Alert\RunAlerts->runAlerts()
#3 {main}
[2025-06-18T04:27:02][ERROR] SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘alert_rules.rule’ in ‘SELECT’ (Connection: dbFacile, SQL: SELECT alert_log.id,alert_log.rule_id,alert_log.device_id,alert_log.state,alert_log.details,alert_log.time_logged,alert_rules.rule,alert_rules.severity,alert_rules.extra,alert_rules.name,alert_rules.query,alert_rules.builder,alert_rules.proc FROM alert_log,alert_rules WHERE alert_log.rule_id = alert_rules.id && alert_log.device_id = 352 && alert_log.rule_id = 8 && alert_rules.disabled = 0 ORDER BY alert_log.id DESC LIMIT 1)#0 /opt/librenms/LibreNMS/Alert/RunAlerts.php(445): dbFetchRow()
#1 /opt/librenms/LibreNMS/Alert/RunAlerts.php(478): LibreNMS\Alert\RunAlerts->loadAlerts()
#2 /opt/librenms/alerts.php(61): LibreNMS\Alert\RunAlerts->runAlerts()
#3 {main}
[2025-06-18T04:27:02][ERROR] SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘alert_rules.rule’ in ‘SELECT’ (Connection: dbFacile, SQL: SELECT alert_log.id,alert_log.rule_id,alert_log.device_id,alert_log.state,alert_log.details,alert_log.time_logged,alert_rules.rule,alert_rules.severity,alert_rules.extra,alert_rules.name,alert_rules.query,alert_rules.builder,alert_rules.proc FROM alert_log,alert_rules WHERE alert_log.rule_id = alert_rules.id && alert_log.device_id = 353 && alert_log.rule_id = 1 && alert_rules.disabled = 0 ORDER BY alert_log.id DESC LIMIT 1)#0 /opt/librenms/LibreNMS/Alert/RunAlerts.php(445): dbFetchRow()
#1 /opt/librenms/LibreNMS/Alert/RunAlerts.php(478): LibreNMS\Alert\RunAlerts->loadAlerts()
#2 /opt/librenms/alerts.php(61): LibreNMS\Alert\RunAlerts->runAlerts()
#3 {main}
[2025-06-18T04:27:02][ERROR] SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘alert_rules.rule’ in ‘SELECT’ (Connection: dbFacile, SQL: SELECT alert_log.id,alert_log.rule_id,alert_log.device_id,alert_log.state,alert_log.details,alert_log.time_logged,alert_rules.rule,alert_rules.severity,alert_rules.extra,alert_rules.name,alert_rules.query,alert_rules.builder,alert_rules.proc FROM alert_log,alert_rules WHERE alert_log.rule_id = alert_rules.id && alert_log.device_id = 353 && alert_log.rule_id = 2 && alert_rules.disabled = 0 ORDER BY alert_log.id DESC LIMIT 1)#0 /opt/librenms/LibreNMS/Alert/RunAlerts.php(445): dbFetchRow()
#1 /opt/librenms/LibreNMS/Alert/RunAlerts.php(478): LibreNMS\Alert\RunAlerts->loadAlerts()
#2 /opt/librenms/alerts.php(61): LibreNMS\Alert\RunAlerts->runAlerts()
#3 {main}
[2025-06-18T04:27:02][ERROR] SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘alert_rules.rule’ in ‘SELECT’ (Connection: dbFacile, SQL: SELECT alert_log.id,alert_log.rule_id,alert_log.device_id,alert_log.state,alert_log.details,alert_log.time_logged,alert_rules.rule,alert_rules.severity,alert_rules.extra,alert_rules.name,alert_rules.query,alert_rules.builder,alert_rules.proc FROM alert_log,alert_rules WHERE alert_log.rule_id = alert_rules.id && alert_log.device_id = 353 && alert_log.rule_id = 4 && alert_rules.disabled = 0 ORDER BY alert_log.id DESC LIMIT 1)#0 /opt/librenms/LibreNMS/Alert/RunAlerts.php(445): dbFetchRow()
#1 /opt/librenms/LibreNMS/Alert/RunAlerts.php(478): LibreNMS\Alert\RunAlerts->loadAlerts()
#2 /opt/librenms/alerts.php(61): LibreNMS\Alert\RunAlerts->runAlerts()
#3 {main}
[2025-06-18T04:27:02][ERROR] SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘alert_rules.rule’ in ‘SELECT’ (Connection: dbFacile, SQL: SELECT alert_log.id,alert_log.rule_id,alert_log.device_id,alert_log.state,alert_log.details,alert_log.time_logged,alert_rules.rule,alert_rules.severity,alert_rules.extra,alert_rules.name,alert_rules.query,alert_rules.builder,alert_rules.proc FROM alert_log,alert_rules WHERE alert_log.rule_id = alert_rules.id && alert_log.device_id = 353 && alert_log.rule_id = 7 && alert_rules.disabled = 0 ORDER BY alert_log.id DESC LIMIT 1)#0 /opt/librenms/LibreNMS/Alert/RunAlerts.php(445): dbFetchRow()
#1 /opt/librenms/LibreNMS/Alert/RunAlerts.php(478): LibreNMS\Alert\RunAlerts->loadAlerts()
#2 /opt/librenms/alerts.php(61): LibreNMS\Alert\RunAlerts->runAlerts()
#3 {main}
[2025-06-18T04:27:02][ERROR] SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘alert_rules.rule’ in ‘SELECT’ (Connection: dbFacile, SQL: SELECT alert_log.id,alert_log.rule_id,alert_log.device_id,alert_log.state,alert_log.details,alert_log.time_logged,alert_rules.rule,alert_rules.severity,alert_rules.extra,alert_rules.name,alert_rules.query,alert_rules.builder,alert_rules.proc FROM alert_log,alert_rules WHERE alert_log.rule_id = alert_rules.id && alert_log.device_id = 353 && alert_log.rule_id = 8 && alert_rules.disabled = 0 ORDER BY alert_log.id DESC LIMIT 1)#0 /opt/librenms/LibreNMS/Alert/RunAlerts.php(445): dbFetchRow()
#1 /opt/librenms/LibreNMS/Alert/RunAlerts.php(478): LibreNMS\Alert\RunAlerts->loadAlerts()
#2 /opt/librenms/alerts.php(61): LibreNMS\Alert\RunAlerts->runAlerts()
#3 {main}
[2025-06-18T04:27:06][ALERT] INFO: device:poll 172.30.40.100 (354) polled in 123.464s

I’ve been experiencing the same issue since the morning of June 18, 2025.

Have the same issue as over, Column not found: 1054 Unknown column ‘alert_rules.rule’

Hello

Same problem here after applying 2025_06_11_173916_drop_alert_rule update.

Same here
Just after Update this happened no more Alrets items on Alert tabs but Alert Rules are working cause our speaker keeps on beeping and the alert shows in Alert History

===========================================

Component Version
LibreNMS 25.6.0-8-g4cbc88a53 (2025-06-18T11:49:59+08:00)
DB Schema 2025_06_11_173916_drop_alert_rule (344)
PHP 8.3.6
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.9
[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
PHP Error(2): stream_socket_client(): Unable to connect to tcp://127.0.0.1:6379 (Connection refused) from vendor/predis/predis/src/Connection/Resource/StreamFactory.php:209 in /opt/librenms/LibreNMS/Validations/Poller/CheckRedis.php:67
[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

librenms Log shows this

#1 /opt/librenms/LibreNMS/Alert/RunAlerts.php(478): LibreNMS\Alert\RunAlerts->loadAlerts()
#2 /opt/librenms/alerts.php(61): LibreNMS\Alert\RunAlerts->runAlerts()
#3 {main}
[2025-06-18T14:21:01][ERROR] SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘alert_rules.rule’ in ‘SELECT’ (Connection: dbFacile, SQL: SELECT alert_log.id,alert_log.rule_id,alert_log.device_id,alert_log.state,alert_log.details,alert_log.time_logged,alert_rules.rule,alert_rules.severity,alert_rules.extra,alert_rules.name,alert_rules.query,alert_rules.builder,alert_rules.proc FROM alert_log,alert_rules WHERE alert_log.rule_id = alert_rules.id && alert_log.device_id = 58 && alert_log.rule_id = 1 && alert_rules.disabled = 0 ORDER BY alert_log.id DESC LIMIT 1)#0 /opt/librenms/LibreNMS/Alert/RunAlerts.php(445): dbFetchRow()
#1 /opt/librenms/LibreNMS/Alert/RunAlerts.php(478): LibreNMS\Alert\RunAlerts->loadAlerts()
#2 /opt/librenms/alerts.php(61): LibreNMS\Alert\RunAlerts->runAlerts()
#3 {main}
[2025-06-18T14:22:32][ERROR] SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘alert_rules.rule’ in ‘SELECT’ (Connection: dbFacile, SQL: SELECT alerts.*, IFNULL(CONVERT_TZ(alerts.timestamp, @@global.time_zone, Asia/Manila),alerts.timestamp) AS timestamp_display, devices.hostname, devices.sysName, devices.display, devices.os, devices.hardware, locations.location, alert_rules.rule, alert_rules.name, alert_rules.severity FROM alerts LEFT JOIN devices ON alerts.device_id=devices.device_id LEFT JOIN locations ON devices.location_id = locations.id RIGHT JOIN alert_rules ON alerts.rule_id=alert_rules.id WHERE devices.disabled = 0 AND alerts.state!=0 ORDER BY timestamp DESC LIMIT 0,50)#0 /opt/librenms/includes/html/table/alerts.inc.php(131): dbFetchRows()
#1 /opt/librenms/html/ajax_table.php(45): include_once(‘…’)

We are experiencing this issue as well. Was working normally yesterday and seems to have stopped working due to an update during the night.

Same here.

1 Like
5 Likes

Please re-run ./daily.sh

6 Likes

The alerts are now showing, thanks!

Yes, the alerts are showing again. Look like the “ACK” and “Notes” state were lost. No big deal.

Is there any way to bulk acknowledge all the alerts?

Is anyone else seeing an issue with the alerts disappearing and coming back after applying #17879?

Didn’t have any alerts on the dashboard this morning. Ran daily.sh to apply #17879 and the alerts came back. But then they suddenly disappeared later and came back again.

This morning I am seeing my UP alerts are going off for seemingly no reason, filling up the alert history with 5+ alerts every minute.

output of ./validate.php:

Component Version
LibreNMS 25.6.0-8-g4cbc88a53 (2025-06-17T22:49:59-05:00)
DB Schema 2025_06_11_173916_drop_alert_rule (344)
PHP 8.3.14
Python 3.10.12
Database MariaDB 10.6.22-MariaDB-0ubuntu0.22.04.1
RRDTool 1.7.2
SNMP 5.9.1
===========================================

[OK] Composer Version: 2.8.9
[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] Locks are functional
[OK] Python wrapper cron entry is not present
[OK] Redis is functional
[OK] rrdtool version ok
[OK] Connected to rrdcached


More like this for the whole morning, I have restarted all 3 of my pollers including the master librenms server with no success

Update your installs

1 Like

Well that fixed the alerts, but now BGP All Sessions and BGP External now return 502 Bad Gateway.

/routing/protocol=bgp/type=all
/routing/protocol=bgp/type=external

report your logs here for 502 errors: