Sensors initialisation fails with PHP 8.1

I created test librenms server to fix low-temp alerts.

Latest as of today 2022-09-26 librenms. With remi php 8.1 on Oracle Linux 8 (RHEL like) I get an error discovering sensors:

production.ERROR: Error discovering sensors module for 10.0.0.1. TypeError: current(): Argument #1 ($array) must be of type array, null 
given in /opt/librenms/includes/discovery/sensors/state/linux.inc.php:69
Stack trace:
#0 /opt/librenms/includes/discovery/sensors/state/linux.inc.php(69): current()
#1 /opt/librenms/includes/discovery/functions.inc.php(993): include('/opt/librenms/i...')
#2 /opt/librenms/includes/discovery/sensors.inc.php(84): sensors()
#3 /opt/librenms/includes/discovery/functions.inc.php(153): include('/opt/librenms/i...')
#4 /opt/librenms/discovery.php(118): discover_device()
#5 {main}  

After downgrading to php 7.4 stream from AppStream repo the temps get discovered. I don’t think insisting on php 8.1 is a good idea while there are still problems.

Not using Weathermap or any other plugins.

Unfortunately, if no one reports them, they are never fixed.

There are no known issues with PHP 8.1 (including this one Fix ups nut PHP 8.1 issue by murrant · Pull Request #14392 · librenms/librenms · GitHub).

Because LibreNMS is maintained by users, we only have access to what we each have. LibreNMS is a large application and it is impossible to test every hardware environment + configuration. Unfortunately, we are required to upgrade our PHP version by the ecosystem. We chose 8.1 to reduce those upgrade tasks for our users (for the record this error will occur on PHP 8.0 too, which will be the lowest upstream supported PHP version in about 2 months).

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