LibreNMS and Oxidized Error page

Hi,

I get the following error when i go to the Oxidized tab in LibreNMS:
It worked before so i have no clue what caused this error now.
My database broken maybe?
The oxidized own webui itself is working fine .

Failed to parse time string (never) at position 0 (n): The timezone could not be found in the
database {“userId”:1,“exception”:“[object] (DateMalformedStringException(code: 0): Failed to parse time string (never) at
position 0 (n):
The timezone could not be found in the database at /opt/librenms/includes/html/functions.inc.php:964)”}


Component Version
LibreNMS 24.9.1 (2024-09-30T01:40:22+02:00)
DB Schema 2024_08_27_182000_ports_statistics_table_rev_length (300)
PHP 8.3.12
Python 3.8.10
Database MariaDB 10.6.19-MariaDB-ubu2004
RRDTool 1.7.2
SNMP 5.8
1 Like

It seems it throws an exception error while looping through the oxidized nodes list and the “last updated”
row contains a “never”, which cannot be converted to a datetime.
It makes sense but wondering why it never happened before. Or it is PHP 8.3 which i upgraded a few weeks ago
and an earlier PHP version didn’t throw this exception.

I changed the file /includes/html/functions.inc.php in my LibreNMS Instance
at line 964 a little, (function get_oxidized_nodes_list()) to check $utc_time before.
It works at least for me here now again. Dunno if this is the way
to go with this code.


if ($utc_time === ‘never’ || empty($utc_time)) {
$formatted_local_time = ‘never’;
} else {
try {
$utc_date = new DateTime($utc_time, new DateTimeZone(‘UTC’));
$local_timezone = new DateTimeZone(date_default_timezone_get());
$local_date = $utc_date->setTimezone($local_timezone);
$formatted_local_time = $local_date->format(‘Y-m-d H:i:s T’);
} catch (Exception $e) {
$formatted_local_time = ‘Invalid Date’;
}
}

This should be fixed in the next monthly release.