Validate.php fails, trustedproxy.php file is not where it should be

Good morning,

I recently (Jan. 10) inherited a CentOS7 VMware guest running librenms. All was running well until yesterday when the web gui began showing this:

Whoops, looks like something went wrong. Check your librenms.log.

The log, and the validate command, both show the same error. This is the line in red from validate.php:

In ServiceProvider.php line 59:

Illuminate\Support\ServiceProvider::mergeConfigFrom(): Failed opening required ‘/opt/librenms/vendor/fideloper/proxy/src/src/…/config/trustedproxy.php’ (include_path=’.:/usr/share/pear:/usr/s
hare/php’)

I searched for the trustedproxy.php file starting from /opt/librenms and I do have one but not in that location.

[root@itnms librenms]# find . -name trustedproxy.php -print
./vendor/fideloper/proxy/config/config/trustedproxy.php
./vendor/fideloper/proxy/config/trustedproxy.php
./config/trustedproxy.php

Here is the additional system info:

[root@itnms librenms]# uname -a
Linux itnms.umpublishing.org 3.10.0-957.5.1.el7.x86_64 #1 SMP Fri Feb 1 14:54:57 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

====================================

Component Version
LibreNMS 1.48.1-12-g2b4d8fc
DB Schema 2018_07_03_091322_add_foreign_keys_to_wireless_sensors_table (129)
PHP 7.1.26
MySQL 5.5.60-MariaDB
RRDTool 1.4.8
SNMP NET-SNMP 5.7.2

====================================

[OK] Composer Version: 1.8.3
[OK] Dependencies up-to-date.

I have not made any changes to this server since inheriting it, but the guy I inherited it from left some documentation saying I could update librenms manually by running daily.php. I have not run it but believe it may be running though I don’t know where, as I don’t know why the server would just stop working unless something got updated. There is no crontab for the librenms user, or for root or operator. To see if it might fix things, I did take a snapshot of the guest, and run it, but it did not help. I reverted back to the snapshot.

Can anyone tell me how to fix the problem so I can start the service? I searched the forum and there was a similar “missing files” question that was fixed by running composer-wrapper.php install --no-dev so I took a snapshot of the guest and ran that, to no avail. I’ve reverted to the snapshot, so I’m back to original broken state.

Hi,

is this the full output of validate?

./vendor/fideloper/proxy/config/config/trustedproxy.php should not exist… ./vendor/fideloper/proxy/config/trustedproxy.php is the file it is trying to open, which does exist.

I suggest you re-do you vendor directory, not sure how it got messed up. Run these as the librenms user

  1. cd /opt/librenms
  2. rm -rf vendor
  3. ./scripts/composer-wrapper.php install --no-dev
  4. ./validate.php

No, I will post that for you below;

[root@itnms librenms]# ./validate.php
PHP Warning: Uncaught ErrorException: require(/opt/librenms/vendor/fideloper/proxy/src/src/…/config/trustedproxy.php): failed to open stream: No such file or directory in /opt/librenms/vendor/laravel/framework/src/Illuminate/Support/ServiceProvider.php:59
Stack trace:
#0 /opt/librenms/vendor/laravel/framework/src/Illuminate/Support/ServiceProvider.php(59): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, ‘require(/opt/li…’, ‘/opt/librenms/v…’, 59, Array)
#1 /opt/librenms/vendor/laravel/framework/src/Illuminate/Support/ServiceProvider.php(59): require()
#2 /opt/librenms/vendor/fideloper/proxy/src/src/TrustedProxyServiceProvider.php(28): Illuminate\Support\ServiceProvider->mergeConfigFrom(‘/opt/librenms/v…’, ‘trustedproxy’)
#3 [internal function]: Fideloper\Proxy\TrustedProxyServiceProvider->boot()
#4 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(29): call_user_func_array(Array, Array)
#5 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php( in /opt/librenms/vendor/laravel/framework/src/Illuminate/Support/ServiceProvider.php on line 59
PHP Fatal error: Illuminate\Support\ServiceProvider::mergeConfigFrom(): Failed opening required ‘/opt/librenms/vendor/fideloper/proxy/src/src/…/config/trustedproxy.php’ (include_path=‘.:/usr/share/pear:/usr/share/php’) in /opt/librenms/vendor/laravel/framework/src/Illuminate/Support/ServiceProvider.php on line 59

Component Version
LibreNMS 1.48.1-12-g2b4d8fc
DB Schema 2018_07_03_091322_add_foreign_keys_to_wireless_sensors_table (129)
PHP 7.1.26
MySQL 5.5.60-MariaDB
RRDTool 1.4.8
SNMP NET-SNMP 5.7.2
====================================

[OK] Composer Version: 1.8.3
[OK] Dependencies up-to-date.

In ServiceProvider.php line 59:

Illuminate\Support\ServiceProvider::mergeConfigFrom(): Failed opening required ‘/opt/librenms/vendor/fideloper/proxy/src/src/…/config/trustedproxy.php’ (include_path=‘.:/usr/share/pear:/usr/s
hare/php’)

[root@itnms librenms]#

murrant, the file ./vendor/proxy/config/config/trustedproxy.php you reference is not the same path as the one specified in the error I’m getting. The error path is
‘/opt/librenms/vendor/fideloper/proxy/src/src/…/config/trustedproxy.php’

Are you saying the error path is somehow corrupted, and if I delete the vendor directory and run composer-wrapper it will start looking for the file where it is actually located? Forgive me for my ignorance, but I’ve never used librenms before. And thanks to you and Kevin_Krumm for taking time to assist.

Fixed! Thanks for the help, deleting the vendor directory and running composer_wrapper.php install --no-dev fixed it.

1 Like

... is not a valid path, it was likely hiding /../../ which means two parent directories up, so you remove the src/src/.