Daily.sh Error

Recently updated our Libre server and ran into some errors. After much reading and asking coworkers for advice, it is finally down to one error that we cannot seem to tackle. The daily.sh command gives the following results:

Updating to latest codebase FAIL
warning: unable to access ‘/root/.config/git/ignore’: Permission denied
error: The following untracked working tree files would be overwritten by merge:
app/Http/Controllers/Auth/VerificationController.php
config/hashing.php
config/logging.php
config/tinker.php
html/svg/403.svg
html/svg/404.svg
html/svg/500.svg
html/svg/503.svg
includes/definitions/discovery/nokia-isam.yaml
includes/definitions/nokia-isam.yaml
includes/discovery/mempools/nokia-isam.inc.php
includes/discovery/sensors/dbm/nokia-isam.inc.php
includes/discovery/sensors/pre-cache/nokia-isam.inc.php
includes/discovery/sensors/state/nokia-isam.inc.php
includes/discovery/sensors/temperature/nokia-isam.inc.php
includes/polling/mempools/nokia-isam.inc.php
includes/polling/os/nokia-isam.inc.php
includes/polling/ports/nokia-isam.inc.php
includes/polling/sensors/state/eds.inc.php
includes/polling/sensors/temperature/eds.inc.php
mibs/nokia/ASAM-ALARM-MIB
mibs/nokia/ASAM-EQUIP-MIB
mibs/nokia/ASAM-SYSTEM-MIB
mibs/nokia/ASAM-TC-MIB
mibs/nokia/ITF-MIB
mibs/nokia/ITF-MIB-EXT
mibs/nokia/SFP-MIB
mibs/nokia/SYSTEM-MIB
resources/js/app.js
resources/js/bootstrap.js
resources/js/components/ExampleComponent.vue
resources/sass/_variables.scss
resources/sass/app.scss
tests/data/nokia-isam.json
tests/snmpsim/nokia-isam.snmprec
Please move or remove them before you can merge.
Aborting
Updating Composer packages OK
Updating SQL-Schema OK
Updating submodules OK
Cleaning up DB OK
Fetching notifications OK
Caching PeeringDB data OK
and validate.php gives this:

Component Version
LibreNMS 1.48.1-32-g25954cc
DB Schema 2019_01_16_195644_add_vrf_id_and_bgpLocalAs (131)
PHP 7.2.15-1+ubuntu16.04.1+deb.sury.org+1
MySQL 10.0.38-MariaDB-0ubuntu0.16.04.1
RRDTool 1.5.5
SNMP NET-SNMP 5.7.3

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

[OK] Composer Version: 1.8.4
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database schema correct
[WARN] Your install is over 24 hours out of date, last update: Mon, 11 Feb 2019 20:17:50 +0000
[FIX]:
Make sure your daily.sh cron is running and run ./daily.sh by hand to see if there are any errors.
I am still new to Linux and learning more daily, but this one has several people stumped. Any assistance would be greatly appreciated.

I started getting the same issue on my Ubuntu 18.04 install. I have tried changing the permissions and running “./scripts/github-remove -d” and so far nothing is able to fix it.

This is what I have done to remediate this.

Make a backup first, validate config and fix errors, and then fix git.

STEPS:

cd /opt
sudo rsync --exclude=librenms/logs -avh librenms librenms.bak #Make backup
./validate.php

Fix issues

./validate.php

Try github-remove -s … it fails on my host

./scripts/github-remove -s

So I tried a quick manual fix

git reset --hard HEAD
git clean -f -d --dry-run
#INSPECT above output!

WATCH OUT!!##

##git clean -f -d
git pull

OUTPUT:

~~
[librenms@librenmshost1 ~ ]$ ./validate.php

Component Version
LibreNMS 1.48.1-32-g25954cc
DB Schema 2019_01_16_195644_add_vrf_id_and_bgpLocalAs (131)
PHP 7.1.26
MySQL 5.5.60-MariaDB
RRDTool 1.4.8
SNMP NET-SNMP 5.7.2
====================================

[OK] Composer Version: 1.8.4
[OK] Dependencies up-to-date.
[OK] Database connection successful
[FAIL] Time between this server and the mysql database is off
Mysql time 2019-02-14 19:37:22
PHP time 2019-02-14 18:37:22

[OK] Database schema correct
[FAIL] You have no timezone set for php.
[FIX]:

[WARN] IPv6 is disabled on your server, you will not be able to add IPv6 devices.
[WARN] Your install is over 24 hours out of date, last update: Mon, 11 Feb 2019 20:17:50 +0000
[FIX]:
Make sure your daily.sh cron is running and run ./daily.sh by hand to see if there are any errors.
[WARN] Your local git contains modified files, this could prevent automatic updates.
[FIX]:
You can fix this with ./scripts/github-remove
Modified Files:
.editorconfig
.gitignore
.travis.yml
LibreNMS/Alert/Transport/Alertmanager.php
LibreNMS/Alert/Transport/Elasticsearch.php
LibreNMS/Alert/Transport/Mattermost.php
LibreNMS/Util/Laravel.php
LibreNMS/Util/ModuleTestHelper.php
LibreNMS/Validations/Database.php
app/Console/Kernel.php
app/Exceptions/Handler.php
app/Http/Controllers/Auth/RegisterController.php
app/Http/Kernel.php
app/Http/Middleware/EncryptCookies.php
app/Http/Middleware/TrimStrings.php
and 67 more…
[FAIL] Some folders have incorrect file permissions, this may cause issues.
[FIX]:
sudo chown -R librenms:librenms /usr/local/opt/librenms
sudo setfacl -d -m g::rwx /usr/local/opt/librenms/rrd /usr/local/opt/librenms/logs /usr/local/opt/librenms/bootstrap/cache/ /usr/local/opt/librenms/storage/
sudo chmod -R ug=rwX /usr/local/opt/librenms/rrd /usr/local/opt/librenms/logs /usr/local/opt/librenms/bootstrap/cache/ /usr/local/opt/librenms/storage/
Files:
/usr/local/opt/librenms/storage/framework/views/26378f14e676770383128963b26d6510
[librenms@librenmshost1 ~ ]$

Fix issues the above issues

Re-run ./validate.php

[librenms@librenmshost1 ~ ]$ ./validate.php

Component Version
LibreNMS 1.48.1-32-g25954cc
DB Schema 2019_01_16_195644_add_vrf_id_and_bgpLocalAs (131)
PHP 7.1.26
MySQL 5.5.60-MariaDB
RRDTool 1.4.8
SNMP NET-SNMP 5.7.2
====================================

[OK] Composer Version: 1.8.4
[OK] Dependencies up-to-date.
[OK] Database connection successful
[FAIL] Time between this server and the mysql database is off
Mysql time 2019-02-14 19:38:25
PHP time 2019-02-14 18:38:25

[OK] Database schema correct
[FAIL] You have no timezone set for php.
[FIX]:

[WARN] IPv6 is disabled on your server, you will not be able to add IPv6 devices.
[WARN] Your install is over 24 hours out of date, last update: Mon, 11 Feb 2019 20:17:50 +0000
[FIX]:
Make sure your daily.sh cron is running and run ./daily.sh by hand to see if there are any errors.
[WARN] Your local git contains modified files, this could prevent automatic updates.
[FIX]:
You can fix this with ./scripts/github-remove
Modified Files:
.editorconfig
.gitignore
.travis.yml
LibreNMS/Alert/Transport/Alertmanager.php
LibreNMS/Alert/Transport/Elasticsearch.php
LibreNMS/Alert/Transport/Mattermost.php
LibreNMS/Util/Laravel.php
LibreNMS/Util/ModuleTestHelper.php
LibreNMS/Validations/Database.php
app/Console/Kernel.php
app/Exceptions/Handler.php
app/Http/Controllers/Auth/RegisterController.php
app/Http/Kernel.php
app/Http/Middleware/EncryptCookies.php
app/Http/Middleware/TrimStrings.php
and 67 more…
[librenms@librenmshost1 ~ ]$

It will tell you to use ./scripts/github-remove but I have not active GIT account

~~
[librenms@librenmshost1 ~ ]$ ./scripts/github-remove -h
usage: github-remove [-h] (-d | -s | -r) [-v]

optional arguments:
-h, --help show this help message and exit
-d, --discard Discard all changes clean extra files
-s, --save Save and remove changes by stashing them. (git stash)
-r, --restore Attempt to restore saved changes (git stash pop)
-v, --vendor Also discard changes to ./vendor (requires --discard)
[librenms@librenmshost1 ~ ]$ ./scripts/github-remove -s

*** Please tell me who you are.

Run

git config --global user.email “[email protected]
git config --global user.name “Your Name”

to set your account’s default identity.
Omit --global to set the identity only in this repository.

fatal: empty ident name (for librenms@librenmshost1) not allowed
Cannot save the current index state
[librenms@librenmshost1 ~ ]$
~~

[librenms@librenmshost1 ~ ]$ git reset --hard HEAD
HEAD is now at 25954cc JunOS: Added Virtual Chassis Member Role Sensor (#9783)

RUN THIS AND INSPECT THIS
[librenms@librenmshost1 ~ ]$ git clean -f -d --dry-run
RUN THIS AND INSPECT THIS
[librenms@librenmshost1 ~ ]$ git clean -f -d
[librenms@librenmshost1 ~ ]$ git pull

./daily.php
~~

1 Like

Why are you trying to stash that… if you want to stash of course you need account.

Run with the -d and then update

This worked, thank you very much!
Correction This cleared the errors from daily.sh, but crashed the Apache server. The removed files had to be restored from the backup to get it back online, so the error has returned.

Hi,
That’s probably because you have an apache rights issue…

[librenms@librenms1 ~ ]$ git pull
Updating 25954cc…2eac72d
error: unable to create file storage/framework/cache/data/.gitignore (Permission denied)
[librenms@librenms1 ~ ]$

Make sure you fix all the issues validate.php is telling, so also the:

  • chown
  • chmod
  • setfacl

So in the end it boils down to:
./validate.php
(FIX all chown chmod setfacl etc)
./scripts/github-remove -d
./validate.php
git pull

If that works verify with

./daily.sh

2 Likes

Validate.php does not give me any permission or ownership errors. Only the database schema and my install being more than 24 hours out of date.

Uhm… restored from backup?
You forgot to do the:
~~
cd /opt
sudo rsync --exclude=librenms/logs -avh librenms librenms.bak #Make backup
./validate.php
~~
??

Ok… show us the ./validate.php and ./daily.sh pls…

root@fast:/opt/librenms# ./validate.php

Component Version
LibreNMS 1.48.1-32-g25954cc
DB Schema 2019_02_10_220000_add_dates_to_fdb (132)
PHP 7.2.15-1+ubuntu16.04.1+deb.sury.org+1
MySQL 10.0.38-MariaDB-0ubuntu0.16.04.1
RRDTool 1.5.5
SNMP NET-SNMP 5.7.3

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

[OK] Composer Version: 1.8.4
[OK] Dependencies up-to-date.
[OK] Database connection successful
[WARN] Your database schema has extra migrations (2019_02_10_220000_add_dates_to_fdb). If you just switched to the stable release from the daily release, your database is in between releases and this will be resolved with the next release.
[OK] Database schema correct
[WARN] Your install is over 24 hours out of date, last update: Mon, 11 Feb 2019 20:17:50 +0000
[FIX]:
Make sure your daily.sh cron is running and run ./daily.sh by hand to see if there are any errors.

root@fast:/opt/librenms# ./daily.sh
Re-running /opt/librenms/daily.sh as librenms user
Updating to latest codebase FAIL
warning: unable to access ‘/root/.config/git/ignore’: Permission denied
error: The following untracked working tree files would be overwritten by merge:
app/Http/Controllers/Auth/VerificationController.php
config/hashing.php
config/logging.php
config/tinker.php
html/svg/403.svg
html/svg/404.svg
html/svg/500.svg
html/svg/503.svg
includes/definitions/discovery/nokia-isam.yaml
includes/definitions/nokia-isam.yaml
includes/discovery/mempools/nokia-isam.inc.php
includes/discovery/sensors/dbm/nokia-isam.inc.php
includes/discovery/sensors/pre-cache/nokia-isam.inc.php
includes/discovery/sensors/state/nokia-isam.inc.php
includes/discovery/sensors/temperature/nokia-isam.inc.php
includes/polling/mempools/nokia-isam.inc.php
includes/polling/os/nokia-isam.inc.php
includes/polling/ports/nokia-isam.inc.php
includes/polling/sensors/state/eds.inc.php
includes/polling/sensors/temperature/eds.inc.php
mibs/nokia/ASAM-ALARM-MIB
mibs/nokia/ASAM-EQUIP-MIB
mibs/nokia/ASAM-SYSTEM-MIB
mibs/nokia/ASAM-TC-MIB
mibs/nokia/ITF-MIB
mibs/nokia/ITF-MIB-EXT
mibs/nokia/SFP-MIB
mibs/nokia/SYSTEM-MIB
resources/js/app.js
resources/js/bootstrap.js
resources/js/components/ExampleComponent.vue
resources/sass/_variables.scss
resources/sass/app.scss
tests/data/nokia-isam.json
tests/snmpsim/nokia-isam.snmprec
Please move or remove them before you can merge.
Aborting
Updating Composer packages OK
Updating SQL-Schema OK
Updating submodules OK
Cleaning up DB OK
Fetching notifications OK
Caching PeeringDB data OK
root@fast:/opt/librenms#

So… after you first make a copy with rsync:

  • cd /opt
  • sudo rsync --exclude=librenms/logs -avh librenms librenms.bak #Make backup

(Don’t forget that step now…)

What does the following give you?

  • cd /opt/librenms
  • ./scripts/github-remove -d
  • ./validate.php
  • ./daily.sh