After the composer update showing as problem with backend

Hi Team ,
I am getting below error in dashboard after the composer update.

/validate.php

Component Version
LibreNMS 1.39-37-g5fd81db
DB Schema 249
PHP 7.0.28-0ubuntu0.16.04.1
MySQL 10.0.34-MariaDB-0ubuntu0.16.04.1
RRDTool 1.5.5
SNMP NET-SNMP 5.7.3
====================================

[OK] Composer Version: 1.6.5
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database schema correct
[WARN] Some devices have not been polled in the last 5 minutes. You may have performance issues.
[FIX] Check your poll log and see: Performance - LibreNMS Docs

please help me to fix this

Clear your browser cache and see if that helps.

Hi Murrant,

I tried that as well but the error remains same. It will work for sometime and later it is back to this state.

I mean to say Suddenly it will start working and later after sometime it shows message that problem with backend

Check for errors in the web browser console and logs/librenms.log

I have this issue as well and thought it was part of another problem that was part of a session permission issue here Wrong session file ownership

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

Component Version
LibreNMS 1.39-46-g7f4566a
DB Schema 249
PHP 7.0.28-0ubuntu0.16.04.1
MySQL 10.0.34-MariaDB-0ubuntu0.16.04.1
RRDTool 1.5.5
SNMP NET-SNMP 5.7.3
====================================

[OK] Composer Version: 1.6.5
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database schema correct

Didn’t find any errors in my browser console or logs/librenms.log

Another peculiar thing is that the username and password will show up in plain text in the address bar, after forcing you to the logout screen when you choose to look at anything in the menu!!!

I have beat this up for the last 24 hours and it has been since the system was updated maybe one or two days ago when i was greeted with " ./scripts/composer_wrapper.php install --no-dev " and then an install of php7.0-mbstring.

Not sure where to go from here because the system isn’t generating any errors in the logs that point to why there is a problem with the backend actually no errors at all or why it keeps sending out to the login screen after each time a menu item is clicked on.

Please run ./daily.sh again as the librenms user then check and post the output of ./validate.php

output of daily.sh

Updating to latest codebase OK
Updating Composer packages OK
Updated from 7f4566a to 182185d OK
Updating SQL-Schema OK
Updating submodules OK
Cleaning up DB OK
Fetching notifications OK
Caching PeeringDB data OK

Output of ./validate.php

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

Component Version
LibreNMS 1.39-48-g182185d
DB Schema 249
PHP 7.0.28-0ubuntu0.16.04.1
MySQL 10.0.34-MariaDB-0ubuntu0.16.04.1
RRDTool 1.5.5
SNMP NET-SNMP 5.7.3

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

[OK] Composer Version: 1.6.5
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database schema correct

Hi Murrant,
here is output of ./daily.sh
Updating to latest codebase OK
Updating Composer packages OK
Updated from 7cb930e to c664fbe OK
Updating SQL-Schema OK
Updating submodules OK
Cleaning up DB OK
Fetching notifications OK
Caching PeeringDB data OK

Output of ./validate.php

Component Version
LibreNMS 1.39-52-gc664fbe
DB Schema 250
PHP 7.0.28-0ubuntu0.16.04.1
MySQL 10.0.34-MariaDB-0ubuntu0.16.04.1
RRDTool 1.5.5
SNMP NET-SNMP 5.7.3

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

[OK] Composer Version: 1.6.5
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database schema correct

And I believe the session is not getting authenticated i tried to modify the rule alerts which i have created earlier but showed up as unauthenticated.

Could you please help me to fix this.

What i have found, is that there is a session file being created in “/opt/librenms/storage/framework/sessions/” however in the database the corresponding session information is not generated in the session table, therefore the session will time out instantly and will look like the user has not logged in when in fact the Apache logs say that user has been authenticated. if you don’t find any entries in the librenms SQL database in the session table, that would be our issue!

One other note, that different browser’s on the same machine with work intermittently for example i have been using Firefox and Chrome and either one works or the other doesn’t. It is not making any sense! I have cleared caches hooked up my laptop direct to the same switch as the librenms server to isolate routers proxies etc… and same deal.

Could you shed some light on what could be going on, would there be a script to run on the database or is it a php issue?

Team could you please help me to fix this

I was looking at this again, I have two installs same Ubuntu version and Librenms versions. There is one major difference, one is hosted on VMware and the other on Proxmox. I have looked to see what could be the difference on both guest VM’s and have not seen anything glaring or different.

So I looked at the browser developer console and saw that the Librenms server(VMware) that is working generates the following, PHPSESSID, XSRF-TOKEN and librenms_session. The server(on ProxMox) that isn’t working is missing PHPSESSID.

All google searches lead to code modifications, so I am not sure where to go from here either, need help.

Hmm, the PHPSESSID session is the legacy session, and it should be started by the authentication code.

Check your webserver and php-fpm.log (if applicable) logs for errors.

There could also be some error output in logs/librenms.log

Hi Murrant,

I checked the error log and found that /opt/librenms/html/ajax_setresolution.php not found or unable to stat

/opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php
there is an error on Line 49 Invalid ID timezone

As well as can see that MySQL Error: MySQL Server has gone away in librenms.log

@Manoj_Nr if you get an error about ajax_setresolution.php, that means your browser has old assets cached.

A newer update should have forced browsers to fetch a new version of the javascript. Please check that your install is up-to-date.

Hello Murrant,

I set my apache log to trace level 6 and found this interesting error, it looks like the PHPSESSID is set to expire in the past!!! time is correct and timezones in php.ini(all files) set properly, I even purged all Ubuntu packages and config files and started like new, kept the database, librenms file folder intact and re-created the librenms user. I am getting farther down the rabbit hole!

Apache error.log
[Wed May 16 15:29:14.731740 2018] [http:trace4] [pid 13594] http_filters.c(958): [client 10.0.5.2:21175] Set-Cookie: PHPSESSID=bnpa29s8st49qmltaejro3k322; path=/; secure; HttpOnly, referer: http://tlnms.example.com/
[Wed May 16 15:29:14.731744 2018] [http:trace4] [pid 13594] http_filters.c(958): [client 10.0.5.2:21175] Expires: Thu, 19 Nov 1981 08:52:00 GMT, referer: http://tlnms.example.com/

librenms.log
lots of these
MySQL Error: MySQL server has gone away

php7.0.log

[16-May-2018 15:00:06] NOTICE: fpm is running, pid 1659
[16-May-2018 15:00:06] NOTICE: ready to handle connections
[16-May-2018 15:00:06] NOTICE: systemd monitor interval set to 10000ms

output of daily.sh

Updating to latest codebase OK
Updating Composer packages OK
Updating SQL-Schema OK
Updating submodules OK
Cleaning up DB OK
Fetching notifications OK
Caching PeeringDB data OK

output of validate.php

Component Version
LibreNMS 1.39-66-gb881cbe
DB Schema 250
PHP 7.0.30-0ubuntu0.16.04.1
MySQL 10.0.34-MariaDB-0ubuntu0.16.04.1
RRDTool 1.5.5
SNMP NET-SNMP 5.7.3

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

[OK] Composer Version: 1.6.5
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database schema correct

After resetting the cache the ajax_setresolution.php has vanished. But the other issue remains same. please let me know how to resolve this.

1 Like

Hi Manoj_Nr,

check your config file for this line --> $config[‘secure_cookies’] = true;

comment it out and see if that works for you. I just found it and i don’t know why I had it enabled in my config. My setup was exhibiting the same symptoms you were describing and all is working now after i removed that line in my config.php file!

I am sure it is for when you use SSL and want secure cookies, which i am not using at the moment!

Yes @tleadley: Thank you it worked :slight_smile: :slight_smile: :slight_smile:

1 Like