Alerts History page always shows "No results found"

Hello! I have completed a LibreNMS server migration, and everything works fine on the new server except for: the Alerts History page only shows “No results found!”. I can see active alerts on the Notifications page, but they never show up on the Alerts History page.

When I inspect the Alerts History page in the browser, I can see an error “ajax_table.php 500 (Internal Server Error)” (see attached):
ajaxerror

Everything else looks fine on this server. Only the Alerts History page is malfunctioning.

This is the output of ./validate.php on this server:

$ ./validate.php 
===========================================
Component | Version
--------- | -------
LibreNMS  | 23.6.0-15-g8081a3f3c (2023-06-28T12:24:59+00:00)
DB Schema | 2023_04_27_164904_update_slas_opstatus_tinyint (252)
PHP       | 8.1.2-1ubuntu2.11
Python    | 3.10.6
Database  | MariaDB 10.6.12-MariaDB-0ubuntu0.22.04.1
RRDTool   | 1.7.2
SNMP      | 5.9.1
===========================================

[OK]    Composer Version: 2.5.8
[OK]    Dependencies up-to-date.
[OK]    Database connection successful
[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]    Active pollers found
[OK]    Dispatcher Service is enabled
[OK]    Locks are functional
[OK]    No active python wrapper pollers found
[OK]    Redis is unavailable
[OK]    rrdtool version ok
[OK]    Connected to rrdcached

Check the logs what the error is

Looking at the /opt/librenms/logs/librenms.log file, every time I Ioad the Alerts History page, I see this message on the log:

fputs(): Argument #1 ($stream) must be of type resource, bool given {“userId”:3,“exception”:“[object] (TypeError(code: 0): fputs(): Argument #1 ($stream) must be of type resource, bool given at /opt/librenms/includes/functions.php:111)”}

I also see this message repeating every minute or or so:

fputs(): Argument #1 ($stream) must be of type resource, bool given {“exception”:“[object] (TypeError(code: 0): fputs(): Argument #1 ($stream) must be of type resource, bool given at /opt/librenms/includes/functions.php:111)”}

I’m not sure what to make of either of those messages.

What other logs I should be looking at?

I identified the issue that was keeping the Alerts History page from functioning. I had ‘lnms config:set log_dir’ set to point to a path on a second disk when I first installed the server, but that path was no longer accessible after the server migration.

Running this fixed the problem:

lnms config:set log_dir /opt/librenms/logs

The Alert History page loads fine now, and I no longer see those log messages about functions.php.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.