PHP 502 errors as of June 6 2025

The output of ./validate.php on Ubuntu 24.04.2 LTS

PHP Error(8): ob_end_clean(): Failed to delete buffer. No buffer to delete in /opt/librenms/validate.php on line 154

Component Version
LibreNMS 25.5.0-80-gfb88e8806 (2025-06-06T22:38:47-06:00)
DB Schema 2025_05_07_103301_fix_ipv4_addresses_id_type (342)
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) in /opt/librenms/vendor/predis/predis/src/Connection/Resource/StreamFactory.php on line 209
[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

I just noticed these PHP issues today. I ran the ./daily.sh after and I get the same result. If I check configuration within the GUI there are no issues and I have not identified any issues within the GUI either. I did update Ubuntu and is updated the following
Start-Date: 2025-06-07 21:34:27
Commandline: apt upgrade
Requested-By: pjs (1000)
Upgrade: apt:amd64 (2.7.14build2, 2.8.3), libibverbs1:amd64 (50.0-2build2, 50.0>
End-Date: 2025-06-07 21:35:09

The same errors appear every time I run the ./validate.php. I have not made any changes to LibreNMS or Ubuntu settings. Any suggestion on how to resolve these 2 errors?

I also got the error today on a ~1 month old LibreNMS installation, but with one other odd thing. From the GUI, if I select Alerts → Alert Rules (and only this option) I get a 502 Bad Gateway response. Immediately prior to this I added a rule from the alert rules collection to check for storage on / (both the critical 95% and warning 90% - 95%).

Same issue here. Getting NGINX 502 Bad Gateway on many LibreNMS URLs. What is the fix?

librenms@librenms:~$ ./validate.php
PHP Error(8): ob_end_clean(): Failed to delete buffer. No buffer to delete in /opt/librenms/validate.php on line 154
===========================================
Component | Version
--------- | -------
LibreNMS  | 25.5.0-80-gfb88e8806 (2025-06-07T05:38:47+01:00)
DB Schema | 2025_05_07_103301_fix_ipv4_addresses_id_type (342)
PHP       | 8.3.16
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) in /opt/librenms/vendor/predis/predis/src/Connection/Resource/StreamFactory.php on line 209
[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
PHP Error(8192): rtrim(): Passing null to parameter #1 ($string) of type string is deprecated in /opt/librenms/LibreNMS/Validations/User.php on line 96

Do you have APP_ENV=production set in .env or something else? If something else, set it to production.

Hi all,

This morning my LibreNMS is showing 502 Bad Gateway on many URLs:

https://librenms.xxx/ OK
https://librenms.xxx/bills 502
https://librenms.xxx/bill/bill_id=31/ OK
https://librenms.xxx/bill/bill_id=31/view=history/ 502
etc.

And there are now errors on validate.php. Any ideas on this one?

librenms@librenms:~$ ./validate.php
PHP Error(8): ob_end_clean(): Failed to delete buffer. No buffer to delete in /opt/librenms/validate.php on line 154
===========================================
Component | Version
--------- | -------
LibreNMS  | 25.5.0-80-gfb88e8806 (2025-06-07T05:38:47+01:00)
DB Schema | 2025_05_07_103301_fix_ipv4_addresses_id_type (342)
PHP       | 8.3.16
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) in /opt/librenms/vendor/predis/predis/src/Connection/Resource/StreamFactory.php on line 209
[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
PHP Error(8192): rtrim(): Passing null to parameter #1 ($string) of type string is deprecated in /opt/librenms/LibreNMS/Validations/User.php on line 96

Seems there was an update last night:

librenms@librenms:~$ git log -1
commit fb88e88061690a5f713373ac29b86048ab781816 (HEAD -> master, origin/master, origin/HEAD)
Author: Tony Murray <[email protected]>
Date:   Fri Jun 6 23:38:47 2025 -0500

Have the same error after Sat-Sun daily job at midnight. Rolled back to early June snapshot and do the apt upgrade. After the midnight job, it happened again.

librenms@librenms:~$ ./validate.php
PHP Error(8): ob_end_clean(): Failed to delete buffer. No buffer to delete in /opt/librenms/validate.php on line 154
===========================================
Component | Version
--------- | -------
LibreNMS  | 25.5.0-80-gfb88e8806 (2025-06-07T11:38:47+07:00)
DB Schema | 2025_05_07_103301_fix_ipv4_addresses_id_type (342)
PHP       | 8.3.12
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) in /opt/librenms/vendor/predis/predis/src/Connection/Resource/StreamFactory.php on line 209
[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
[WARN]  Your install is over 24 hours out of date, last update: Sat, 07 Jun 2025 04:38:47 +0000
        [FIX]:
        Make sure your daily.sh cron is running and run ./daily.sh by hand to see if there are any errors.
PHP Error(8192): rtrim(): Passing null to parameter #1 ($string) of type string is deprecated in /opt/librenms/LibreNMS/Validations/User.php on line 96
librenms@librenms:~$

Applying the APP_ENV=production setting in .env made no difference.

Having the same issues here after apt upgrade.

librenms@librenms:~$ ./validate.php
PHP Error(8): ob_end_clean(): Failed to delete buffer. No buffer to delete in /opt/librenms/validate.php on line 154
===========================================
Component | Version
--------- | -------
LibreNMS  | 25.5.0-84-g8d3698bff (2025-06-09T12:40:02+08:00)
DB Schema | 2025_05_07_103301_fix_ipv4_addresses_id_type (342)
PHP       | 8.4.7
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) in /opt/librenms/vendor/predis/predis/src/Connection/Resource/StreamFactory.php on line 209
[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
librenms@librenms:~$

Same problem here…

librenms@hohanw10:~$ ./validate.php
PHP Error(8): ob_end_clean(): Failed to delete buffer. No buffer to delete in /opt/librenms/validate.php on line 154
===========================================
Component | Version
--------- | -------
LibreNMS  | 25.5.0-84-g8d3698bff (2025-06-09T06:40:02+02:00)
DB Schema | 2025_05_07_103301_fix_ipv4_addresses_id_type (342)
PHP       | 8.3.6
Python    | 3.12.3
Database  | MariaDB 10.11.11-MariaDB-0ubuntu0.24.04.2
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) in /opt/librenms/vendor/predis/predis/src/Connection/Resource/StreamFactory.php on line 209
[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
PHP Error(8192): rtrim(): Passing null to parameter #1 ($string) of type string is deprecated in /opt/librenms/LibreNMS/Validations/User.php on line 96
librenms@hohanw10:~$

How to fix it?

sudo -u librenms ./validate.php
PHP Error(8): ob_end_clean(): Failed to delete buffer. No buffer to delete in /opt/librenms/validate.php on line 154
===========================================
Component | Version
--------- | -------
LibreNMS  | 25.5.0-85-gd4ab499a2 (2025-06-09T07:50:25+02:00)
DB Schema | 2025_05_07_103301_fix_ipv4_addresses_id_type (342)
PHP       | 8.3.22
Python    | 3.9.21
Database  | MariaDB 10.5.27-MariaDB
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) in /opt/librenms/vendor/predis/predis/src/Connection/Resource/StreamFactory.php on line 209
[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
PHP Error(8192): rtrim(): Passing null to parameter #1 ($string) of type string is deprecated in /opt/librenms/LibreNMS/Validations/User.php on line 96

Having the same issue as of this morning, may have been happening all weekend and wasn’t noticed, cannot open my FDB tables page (only place I’ve seen the bad gateway error), however I do not have the same php error in the validation, but I do have different PHP errors when I run ./validate.php

PHP Error(8192): gethostbyname(): Passing null to parameter #1 ($hostname) of type string is deprecated in /opt/librenms/vendor/dapphp/radius/src/Radius.php on line 321
PHP Error(8): ob_end_clean(): Failed to delete buffer. No buffer to delete in /opt/librenms/validate.php on line 154

Component Version
LibreNMS 25.5.0-81-g6d94d1bef (2025-06-08T17:48:27-05:00)
DB Schema 2025_05_07_103301_fix_ipv4_addresses_id_type (342)
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
PHP Error(8192): rtrim(): Passing null to parameter #1 ($string) of type string is deprecated in /opt/librenms/LibreNMS/Validations/User.php on line 96

when I navigate to FDB tables from Overview:

I also see this in /var/log/nginx/error.log
2025/06/09 09:24:49 [error] 73284#73284: *929 FastCGI sent in stderr: "PHP message: PHP Error(2): Undefined variable $sep in /opt/librenms/includes/html/pages/search.inc.php on line 27; PHP message: PHP Error(2): Undefined variable $where in /opt/librenms/includes/html/pages/search/fdb.inc.php on line 48; PHP message: PHP Error(2): Undefined array key “device_id” in /opt/librenms/includes/html/pages/search/fdb.inc.php on line 51; PHP message: PHP Error(2): Undefined array key “device_id” in /opt/librenms/includes/html/pages/search/fdb.inc.php on line 51; PHP message: PHP Error(2): Undefined array key “device_id” in /opt/librenms/includes/html/pages/search/fdb.inc.php on line 51; PHP message: PHP Error(2): Undefined array key “device_id” in /opt/librenms/includes/html/pages/search/fdb.inc.php on line 51; PHP message: PHP Error(2): Undefined array key “device_id” in /opt/librenms/includes/html/pages/search/fdb.inc.php on line 51; PHP message: PHP Error(2): Undefined array key “device_id” in /opt/librenms/includes/html/pages/se…

its very long and just suddenly began.

very hard to decipher but that only populates when I try going to FDB tables.

Same here. I get two errors running validate.php:
PHP Error(8): ob_end_clean(): Failed to delete buffer. No buffer to delete in /opt/librenms/validate.php on line 154

PHP Error(8192): rtrim(): Passing null to parameter #1 ($string) of type string is deprecated in /opt/librenms/LibreNMS/Validations/User.php on line 96

I’m also getting the same as @steverpalmer - a 502 Bad Gateway error on the alert rules page after adding a new rule.

I’ve tried adding APP_ENV=production to .env but still get the same issues.

Looking at the nginx log on the server gives:

2025/06/09 15:46:47 [error] 1031#1031: *240057 FastCGI sent in stderr:
	"PHP message: PHP Error(2): Undefined array key "rule_id" in /opt/librenms/includes/html/table/alerts.inc.php on line 31;
	PHP message: PHP Error(2): Undefined array key "alert_id" in /opt/librenms/includes/html/table/alerts.inc.php on line 36;
	PHP message: PHP Error(2): Undefined array key "state" in /opt/librenms/includes/html/table/alerts.inc.php on line 59;
	PHP message: PHP Error(2): Undefined array key "format" in /opt/librenms/includes/html/table/alerts.inc.php on line 131;
	PHP message: PHP Error(2): Undefined array key "isisISAdjState" in /opt/librenms/includes/html/functions.inc.php on line 602;
	PHP message: PHP Error(2): mkdir(): File exists in /opt/librenms/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php on line 652" while reading response header from upstream,
client: <redacted>, server: <MY-LIBRE-SERVER>, request: "POST /ajax_table.php HTTP/2.0", upstream: "fastcgi://unix:/run/php/php8.3-fpm-librenms.sock:", host: "<MY-LIBRE-SERVER>", referrer: "https://<MY-LIBRE-SERVER>/overview"

Anyone have updates on this? it’s affecting an important tool I use daily.

Edit:
Fixed my 502 error on the FDB Table page by running ./daily.sh on my other two distributed pollers, looks like they were running an older version than my master poller, still seeing random PHP errors when running the embedded librenms scripts, like validate.php and ./daily.sh

image

There was a change to stop hiding errors inside LibreNMS (old holdover from pre-fork).

This should not have caused any issues. But, some pages in the webui have too many errors which causes an error between nginx and php-fpm (headers too large). Especially errors in loops… Please list them here and we can get them cleaned up.

Except for the 502 errors from headers too large, all of these new error messages are non-fatal and should not have any affect on the operation of LibreNMS.

In summary:

  1. these errors existed before, but now they are visible
  2. they are non-fatal and will not cause any issues themselves
  3. some pages had too many errors causing an issue with php-fpm an nginx because the headers grew too large
  4. The errors are mostly easy to cleanup and we will work through them as we see them

The issue has come back after a couple of hours, the 502 error is not allowing me to go to the FDB tables tab under overview, I see a ton of PHP errors in /var/log/nginx/error.log, such as

2025/06/09 14:13:17 [error] 73284#73284: *7559 FastCGI sent in stderr: "Undefined array key “device_id” in /opt/librenms/includes/html/pages/search/fdb.inc.php on line 51; PHP message: PHP Error(2): Undefined array key “device_id” in /opt/librenms/includes/html/pages/search/fdb.inc.php on line 51; PHP message: PHP Error(2): Undefined array key “device_id” in /opt/librenms/includes/html/pages/search/fdb.inc.php on line 51; PHP message: PHP Error(2): Undefined array key “device_id” in /opt/librenms/includes/html/pages/search/fdb.inc.php on line 51; PHP message: PHP Error(2): Undefined array key “device_id” in /opt/librenms/includes/html/pages/search/fdb.inc.php on line 51; PHP message: PHP Error(2): Undefined array key “device_id” in /opt/librenms/includes/html/pages/search/fdb.inc.php on line 51; PHP message: PHP Error(2): Undefined array key “device_id” in /opt/librenms/includes/html/pages/search/fdb.inc.php on line 51; PHP message: PHP Error(2): Undefined array key “device_id” in /opt/librenms/includes/html/pages/search/fdb.inc.php on line 51; PHP message: PHP Error(2): Undefined array key “device_id” in /opt/librenms/includes/html/pages/search/fdb.inc.php on line 51; PHP message: PHP Error(2): Undefined array key “device_id” in /opt/librenms/includes/html/pages/search/fdb.inc.php on line 51; PHP message: PHP Error(2): Undefined array key “device_id” in /opt/librenms/includes/html/pages/search/fdb.inc.php on line 51; PHP message: PHP Error(2): Undefined array key “device_id” in /opt/librenms/includes/html/pages/search/fdb.inc.php on line 51; PHP message: PHP Error(2): Undefined array key “device_id” in /opt/librenms/includes/html/pages/search/fdb.inc.php on line 51; PHP message: PHP Error(2): Undefined array key “device_id” in /opt/librenms/includes/html/pages/search/fdb.inc.php on line 51; PHP message: PHP Error(2): Undefined array key “device_id” in /opt/librenms/includes/html/pages/search/fdb.inc.php on line 51; PHP message: PHP Error(2): Undefined array key “device_id” in /opt/librenms/includes/html/pages/s

any many more lines of similar errors, no changes have been made to my environment, only noticed the issue this morning, was fine on Friday.

You already reported that one… Fixed here: FDB Table fixes by murrant · Pull Request #17809 · librenms/librenms · GitHub

Run ./daily.sh to apply that.

Apologies, it had fixed and then come back, but it seems to be good now.

Thanks!

Alert rule fixes here: Alert Rule Table fixes by murrant · Pull Request #17810 · librenms/librenms · GitHub

Good Afternoon,all

I am getting the below error message, when I enable allow duplicate sysName; Can someone please assist me, I have already run ./daily.sh;

PHP Error(8): ob_end_clean(): Failed to delete buffer. No buffer to delete in /opt/librenms/validate.php on line 154

Component Version
LibreNMS 25.5.0-96-g92508cd80 (2025-06-09T16:07:10-04:00)
DB Schema 2025_05_07_103301_fix_ipv4_addresses_id_type (342)
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
[OK] Active pollers found
[OK] Dispatcher Service not detected
[OK] Locks are functional
[OK] Python poller wrapper is polling
[OK] Redis is functional
[OK] rrdtool version ok
[OK] Connected to rrdcached
PHP Error(8192): rtrim(): Passing null to parameter #1 ($string) of type string is deprecated in /opt/librenms/LibreNMS/Validations/User.php on line 96

librenms@server3:~$ ./validate.php
PHP Error(8): ob_end_clean(): Failed to delete buffer. No buffer to delete in /opt/librenms/validate.php on line 154

Component Version
LibreNMS 25.5.0-82-g677f6cad7 (2025-06-08T23:19:43-04:00)
DB Schema 2025_05_25_183627_drop_view_port_mac_link (342)
PHP 8.3.6
Python 3.12.3
Database MariaDB 10.11.11-MariaDB-0ubuntu0.24.04.2
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) in /opt/librenms/vendor/predis/predis/src/Connection/Resource/StreamFactory.php on line 209
[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