service librenms start fails. /var/log/librenms/librenms-service.log showing env: php: No such file or directory MainThread(ERROR):ERROR: Could not load or parse configuration! /usr/bin/env php /usr/local/www/librenms/config_to_json.php 2>&1: 'NoneType' object has no attribute 'get' The crux of the problem is that daemon starts with a very restricted path (/sbin:/bin:/usr/sbin:/usr/bin) - this causes env to fail to find php when /usr/local/www/librenms/snmp-scan.py attempts to grab the .env file. I'm not sure what the "right" fix is for this, the two quickest work arounds are to add a soft link from /usr/bin/php to /usr/local/bin/php or adjusting the path in /usr/local/etc/rc.d/librenms to include /usr/local/bin. Neither of which I'm crazy about.
Usually, this is patched by modifying the script in question with the full path to php. re SHEBANG_FILES A new release is available, I'm sure - I may update the port with a new release and patch this file. What version of librenms are you running? On what version of FreeBSD please?
Apologies for neglecting to complete the summary before filing the report and for leaving out the relevant details. I noted the issue on 13.0-RELEASE-p4. I installed librenms-21.5.1_3,1 via pkg which is tracking "latest". Other details in case they are helpful: php74-7.4.25 mod_php74-7.4.25 python38-3.8.12_1
btw Dan: 21.10 would bring a useful improvement in my setting ("Infer character encoding for ifAlias and sysLocation"), so thank you very much in advance!
This may take a while. I am overwhelmed with non-FreeBSD items at present. Sorry.
I am now aiming for 22.1.0
I have a working 22.5.0 here. I need to amend pkg-message
(In reply to Dan Langille from comment #6) That should be 22.2.1
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=467e569d02e854b4e3abd762b796da449b57ff72 commit 467e569d02e854b4e3abd762b796da449b57ff72 Author: Dan Langille <dvl@FreeBSD.org> AuthorDate: 2022-02-18 15:19:22 +0000 Commit: Dan Langille <dvl@FreeBSD.org> CommitDate: 2022-02-18 15:21:02 +0000 net-mgmt/librenms: Update to 22.2.1 re: https://github.com/librenms/librenms/releases/tag/22.2.1 This port update skips over several releases. See: https://github.com/librenms/librenms/releases See UPDATING for details on storage directory which needs to move to /var/db/librenms LiberNMS wants to write to the %%WWWDIR%%/storage directory. To comply with man 7 hier, this entry is now a symlink to /var/db/librenms/storage Please adjust your filesystem accordingly. The contrib directory has been removed from the upstream tarball. As such, the port now installs the log rotation file to /${PREFIX}/etc/newsyslog.conf.d/librenms.conf.sample PR: 260085 261031 UPDATING | 8 ++ net-mgmt/librenms/Makefile | 45 +++++---- net-mgmt/librenms/distinfo | 10 +- net-mgmt/librenms/files/patch-config.php.default | 12 +-- net-mgmt/librenms/files/patch-poller-wrapper.py | 17 ++-- net-mgmt/librenms/files/pkg-message.in | 116 +++++++++++++---------- 6 files changed, 122 insertions(+), 86 deletions(-)
Darren: if I didn't get everything you wanted into the port, please let me know. There was a bunch of changes associated with this update and I fear I may have overlooked something. Thank you.
I happened to be moving librenms to a new server today and found that the original issue in this bug is still present or has regressed. The wording is slightly different: MainThread(CRITICAL):Error in config fetching process: 127 MainThread(CRITICAL):ERROR: Could not execute command [['/usr/bin/env', 'php', '/usr/local/www/librenms/config_to_json.php']]: Expecting value: line 1 column 1 (char 0) So "service librenms start" kicks off the daemon command which starts python which runs librenms-service.py, which at some point tries to run config_to_json.php. Unfortunately, config_to_json.php can't start because env can't find php on the PATH it's running with. Same work arounds, "ln -s /usr/local/bin/php /usr/bin/php" to force php onto the daemon path or add "/usr/local/bin" to the PATH in /usr/local/etc/rc.d/librenms This is now on FreeBSD 13.2-RELEASE-p1 librenms-23.5.0,1 mod_php81-8.1.21 php81-8.1.21
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=917c4c6dd4bbda3ce239856697e3607e8cfb4381 commit 917c4c6dd4bbda3ce239856697e3607e8cfb4381 Author: Dan Langille <dvl@FreeBSD.org> AuthorDate: 2023-07-30 23:51:50 +0000 Commit: Dan Langille <dvl@FreeBSD.org> CommitDate: 2023-07-30 23:55:25 +0000 net-mgmt/librenms: add many files to SHEBANG_FILES While here, run portfmt over the Makefile - that accounts for the majority of changes seen in the diff patch LibreNMS/wrapper.py which contains "/usr/bin/env php" mid-file PR: 260085 net-mgmt/librenms/Makefile | 59 ++++++++++++++++------ .../librenms/files/patch-LibreNMS_wrapper.py (new) | 11 ++++ 2 files changed, 55 insertions(+), 15 deletions(-)
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=3e1bdb56d6eb37603f21d0c8a1b6be3a79a15569 commit 3e1bdb56d6eb37603f21d0c8a1b6be3a79a15569 Author: Dan Langille <dvl@FreeBSD.org> AuthorDate: 2023-07-30 20:49:32 +0000 Commit: Dan Langille <dvl@FreeBSD.org> CommitDate: 2023-07-30 23:55:25 +0000 net/syncthing: Update to 1.23.6 re: https://github.com/syncthing/syncthing/releases/tag/v1.23.6 PR: 260085 net/syncthing/Makefile | 2 +- net/syncthing/distinfo | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-)
(In reply to commit-hook from comment #12) Yeah, that PR reference should have been 272036