Error: Daily update failed; ./validate shows "[FAIL] No composer available, please install composer [FIX] https://getcomposer.org/"

Been running LibreNMS for about a year now:

  • Ubuntu 16.04 LTS with latest updates
  • NGINX
  • MariaDB
  • I only do the monthly updates, but after logging in, it’s showing that it did update and is running “1.36 - Sat Jan 27 2018 07:57:40 GMT-0500”.

But tried logging into my LibreNMS this morning, only to see a relentless popup saying

Error: Daily update failed
The daily update script (daily.sh) has failed on traffic.Please check output by hand. If you need assistance, visit the LibreNMS Website to find out how.

So clicked the link, which just took me to the generic LibreNMS support page. So searched this community site and did some Googling, and started by doing what I found, which was verifying that the permissions were correct (only files not owned by librenms:librenms were the ./logs/access_log and ./logs/error_log which are owned by user www-data so NGINX can properly update. But even there the group owner was librenms.

But when I run ./validate as user librenms, this is the output I’m getting now:

$ sudo -u librenms ./validate.php
PHP Notice:  ob_end_clean(): failed to delete buffer. No buffer to delete in /opt/librenms/validate.php on line 164
====================================
Component | Version
--------- | -------
LibreNMS  | 1.36
DB Schema | ?
PHP       | 7.0.22-0ubuntu0.16.04.1
MySQL     | ?
RRDTool   | 1.5.5
SNMP      | NET-SNMP 5.7.3
====================================

[FAIL]  No composer available, please install composer [FIX] https://getcomposer.org/

I’m kind of confused. This has been working pretty reliably until now. Any ideas what could be causing this or how to resolve? Nothing really jumps out at me.

And is composer a new requirement or has it always been there? I only ask as I have NOT removed any packages since setting this system up. I only do routine commands like

$ sudo apt-get update && sudo apt-get dist-upgrade

and once in awhile removing no longer used/outdated packages using

$ sudo apt auto-remove

But that’s it. And my installation notes don’t indicate installing composer (though I simply note I was following the steps on this page: Home - LibreNMS Docs , hence the question whether composer was always there), and I know for sure I’ve never gone out of my way to remove it.

Anyway, any insight into this would be greatly appreciated. Thanks in advance for any/all help.

Ok, making headway. Though still would love to know whether composer is new or not to this setup, I ran

$ sudo apt-get update
$ sudo apt-get install composer

and allowed it to install all the packages listed. Once done, re-running ./validate.php completed, this time showing

$ sudo -u librenms ./validate.php
====================================
Component | Version
--------- | -------
LibreNMS  | 1.36
DB Schema | 232
PHP       | 7.0.22-0ubuntu0.16.04.1
MySQL     | 10.0.33-MariaDB-0ubuntu0.16.04.1
RRDTool   | 1.5.5
SNMP      | NET-SNMP 5.7.3
====================================

[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: http://docs.librenms.org/Support/Performance/
	Devices:
	 *snip*
[FAIL]  The log folder has improper permissions.
	[FIX] chmod ug+rw /opt/librenms/logs

So next did

$ sudo chmod ug+rw /opt/librenms/logs

which took care of that issue. So with that done, next ran

$ sudo -u librenms ./daily.sh
Checking PHP version                               OK
Updating to latest codebase                        FAIL
You are not currently on a branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>
Updating SQL-Schema                                OK
Updating submodules                                OK
Cleaning up DB                                     OK
Fetching notifications                             OK
Caching PeeringDB data                             OK

Looking in /opt/librenms/logs/daily.log, I see the following:

Checking PHP version

Returned: 0
Updating to latest codebase
You are not currently on a branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>
Returned: 1
Updating SQL-Schema

Returned: 0
Updating submodules

Returned: 0
Cleaning up DB
Refreshing alert rules queries
Clearing OS cache
Eventlog cleared for entries over 30 days
Authlog cleared for entries over 60 days
Perf times cleared for entries over 30 days
Device perf cleared for entries over 7 days
Returned: 0
Fetching notifications
[ Tue, 30 Jan 2018 14:41:04 -0500 ] http://www.librenms.org/notifications.rss (25)
[ Tue, 30 Jan 2018 14:41:04 -0500 ] misc/notifications.rss (32)
[ Tue, 30 Jan 2018 14:41:04 -0500 ] Updating DB  Done
Returned: 0
Caching PeeringDB data
Peering DB integration disabled
Returned: 0

All looks ok, as again, I’m on just the monthly releases. But the error message kept popping up when visiting the LibreNMS web UI. So to resolve this finally, first I edited the config using

$ sudo -u librenms nano /opt/librenms/config.php

and uncommented the line near the bottom which read

...
# Uncomment the next line to disable daily updates
$config['update'] = 0;   # <==== Uncommented this line
$config['update_channel'] = 'release';

Then re-ran

$ sudo -u librenms ./daily.sh
Updating SQL-Schema                                OK
Cleaning up DB                                     OK

I verified the site no longer shows the popup. I then re-edited the config.php and commented out that line once more.

So with this, resolved my own issue. Thanks all the same to anyone who took the time to read this.

1 Like

This still exists.

Solved it by upgrading composer to 1.6.3

curl -sS https://getcomposer.org/installer | sudo php – --install-dir=/usr/local/bin --filename=composer

I get the error message in the UI but not when I run validate.php:

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

Component Version
LibreNMS 1.37-21-g6c3473a
DB Schema 239
PHP 7.0.25-0ubuntu0.16.04.1
MySQL 10.0.33-MariaDB-0ubuntu0.16.04.1
RRDTool 1.5.5
SNMP NET-SNMP 5.7.3

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

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

but UI:
Dependencies Failure
Fail: No composer available, please install composer
Fix: https://getcomposer.org/

Same here, UI show composer missing and validate.php seems ok:

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

Component Version
LibreNMS 1.37-21-g6c3473a
DB Schema 239
PHP 7.2.2
MySQL 5.5.56-MariaDB
RRDTool 1.4.8
SNMP NET-SNMP 5.7.2

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

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

The inconsistency between web & cli validation is known - see Http://<librenms>/validate & ./validate.php inconsistent - and being worked on