Can't run validate.php inside container

I have LibreNMS running inside a container and when I try to run the validate.php I get and error that I shouldn’t run it as root. But when I go to run it as non-root user, I get a FAIL error saying I need to “run this script as ‘librenms’ or root”!
How do I get this working? Thank you!

librenms:/opt/librenms# ./validate.php
Do not run validate.php as root
librenms:/opt/librenms# su librenmsadmin
/opt/librenms $ ./validate.php 
Component | Version
--------- | -------
LibreNMS  | 23.9.1 (2023-09-30T07:59:55+02:00)
DB Schema | 2023_09_01_084057_application_new_defaults (259)
PHP       | 8.1.22
Python    | 3.10.13
Database  | MariaDB 10.5.22-MariaDB-1:10.5.22+maria~ubu2004
RRDTool   | 1.7.2
SNMP      | 5.9.3

[OK]    Installed from the official Docker image; no Composer required
[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 python wrapper pollers found
[OK]    Redis is functional
[WARN]  IPv6 is disabled on your server, you will not be able to add IPv6 devices.
[OK]    rrd_dir is writable
[OK]    rrdtool version ok
[WARN]  Updates are managed through the official Docker image
[FAIL]  You need to run this script as 'librenms' or root
1 Like

Thank you!
Running the validate using “docker compose exec --user librenms librenms php validate.php” works.

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