Can't get daily.sh running without any problems

Hello,
Month ago I upgraded my php installation to 7.3. After that the notification on the web gui about unsupported version of php disappeared, but I can’t get daily.sh running anymore. I’m stuck in a loop of commands, and there is no exist. Watch this:

librenms@monitoring:~$ ./daily.sh
Updating to latest codebase                        FAIL
error: The following untracked working tree files would be overwritten by merge:
    config/hashing.php
    config/logging.php
    config/tinker.php
Please move or remove them before you merge.
Aborting
Updating Composer packages                         OK
Updating SQL-Schema                                OK
Updating submodules                                OK
Cleaning up DB                                     OK
Fetching notifications                             OK
Caching PeeringDB data                             OK
librenms@monitoring:~$

So I read about it on the Internet and it says there is a merge error on git, so the advice is to use this command.

librenms@monitoring:~$ ./scripts/github-remove --discard
Are you sure you want to delete all modified and untracked files? [y/N] y

Then I try to validate, but without success.

librenms@monitoring:~$ ./validate.php
====================================
Component | Version
--------- | -------
LibreNMS  | 1.48.1-27-gc7c1ca2c5
DB Schema | 2019_02_10_220000_add_dates_to_fdb (132)
PHP       | 7.3.3-1+0~20190307202245.32+stretch~1.gbp32ebb2
MySQL     | 10.1.37-MariaDB-0+deb9u1
RRDTool   | 1.6.0
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
[FAIL]  The poller (monitoring) has not completed within the last 5 minutes, check the cron job.
[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: Thu, 07 Feb 2019 20:58:56 +0000
    [FIX]:
    Make sure your daily.sh cron is running and run ./daily.sh by hand to see if there are any errors.
[FAIL]  Some folders have incorrect file permissions, this may cause issues.
    [FIX]:
    sudo chown -R librenms:librenms /opt/librenms
    sudo setfacl -d -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
    sudo chmod -R ug=rwX /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
    Files:
     /opt/librenms/bootstrap/cache/services.php
librenms@monitoring:~$

So I fixed the permissions issues with root account, and try to run daily.sh again.

[email protected]:~# chown -R librenms:librenms /opt/librenms
[email protected]:~# chmod -R ug=rwX /opt/librenms/rrd /opt/librenms/logs /opt/librenms    /bootstrap/cache/ /opt/librenms/storage/
[email protected]:~#

And get same errors:

librenms@monitoring:~$ ./daily.sh
Updating to latest codebase                        FAIL
error: The following untracked working tree files would be overwritten by merge:
    config/hashing.php
    config/logging.php
    config/tinker.php
Please move or remove them before you merge.
Aborting
Updating Composer packages                         OK
Updating SQL-Schema                                OK
Updating submodules                                OK
Cleaning up DB                                     OK
Fetching notifications                             OK
Caching PeeringDB data                             OK
librenms@monitoring:~$

So can anybody help me with that?
Thanks a lot!

I see a few threads with this, did you try moving the files?

su - librenms
cd /opt/librenms
mv config/hashing.php /tmp/hashing.php.old
mv config/logging.php /tmp/logging.php.old
mv config/tinker.php /tmp/tinker.php.old
/scripts/github-remove -d
./daily.sh
./validate.php

#Daily.sh failed today
#Updating to latest codebase FAIL, please help
#Daily.sh failed due to merge requirement

1 Like

Yeah, thanks a lot Chas.
Now the daily.sh is fixed, but I have some strange errors with mysql queries:

MariaDB [(none)]> use librenms
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [librenms]> ALTER TABLE `ports_fdb` CHANGE `created_at` `created_at` timestamp NULL ;
ERROR 1054 (42S22): Unknown column 'created_at' in 'ports_fdb'
MariaDB [librenms]> quit
Bye
librenms@monitoring:~$

Daily.sh runs smoothly but when I start validate.php after that I got this:

[FAIL]  Database: incorrect column (ports_fdb/created_at)
[FAIL]  Database: incorrect column (ports_fdb/updated_at)
[FAIL]  We have detected that your database schema may be wrong, please report the following to us on Discord (https://t.libren.ms/discord) or the community site (https://t.libren.ms/5gscd):
    [FIX]:
    Run the following SQL statements to fix.
    SQL Statements:
     ALTER TABLE `ports_fdb` CHANGE `created_at` `created_at` timestamp NULL ;
     ALTER TABLE `ports_fdb` CHANGE `updated_at` `updated_at` timestamp NULL ;
[FAIL]  The poller (monitoring) has not completed within the last 5 minutes, check the cron job.
[WARN]  IPv6 is disabled on your server, you will not be able to add IPv6 devices.
[FAIL]  Some folders have incorrect file permissions, this may cause issues.
    [FIX]:
    sudo chown -R librenms:librenms /opt/librenms
    sudo setfacl -d -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
    sudo chmod -R ug=rwX /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
    Files:
     /opt/librenms/bootstrap/cache/packages.php
librenms@monitoring:~$

I mean, the daily.sh broke the permissions every time I run it.

What’s the output from mysql DESCRIBE TABLE ports_fdb;

also:

git status
git remote -v
git describe --tags

MariaDB [librenms]> show tables;
+---------------------------+
| Tables_in_librenms        |
+---------------------------+
| access_points             |
| alert_device_map          |
| alert_group_map           |
| alert_log                 |
| alert_rules               |
| alert_schedulables        |
| alert_schedule            |
| alert_template_map        |
| alert_templates           |
| alert_transport_groups    |
| alert_transport_map       |
| alert_transports          |
| alerts                    |
| api_tokens                |
| application_metrics       |
| applications              |
| authlog                   |
| bgpPeers                  |
| bgpPeers_cbgp             |
| bill_data                 |
| bill_history              |
| bill_perms                |
| bill_port_counters        |
| bill_ports                |
| bills                     |
| callback                  |
| cef_switching             |
| ciscoASA                  |
| component                 |
| component_prefs           |
| component_statuslog       |
| config                    |
| customers                 |
| dashboards                |
| dbSchema                  |
| device_graphs             |
| device_group_device       |
| device_groups             |
| device_mibs               |
| device_oids               |
| device_perf               |
| device_relationships      |
| devices                   |
| devices_attribs           |
| devices_perms             |
| entPhysical               |
| entPhysical_state         |
| entityState               |
| eventlog                  |
| graph_types               |
| hrDevice                  |
| ipsec_tunnels             |
| ipv4_addresses            |
| ipv4_mac                  |
| ipv4_networks             |
| ipv6_addresses            |
| ipv6_networks             |
| juniAtmVp                 |
| links                     |
| loadbalancer_rservers     |
| loadbalancer_vservers     |
| locations                 |
| mac_accounting            |
| mefinfo                   |
| mempools                  |
| mibdefs                   |
| migrations                |
| munin_plugins             |
| munin_plugins_ds          |
| netscaler_vservers        |
| notifications             |
| notifications_attribs     |
| ospf_areas                |
| ospf_instances            |
| ospf_nbrs                 |
| ospf_ports                |
| packages                  |
| pdb_ix                    |
| pdb_ix_peers              |
| perf_times                |
| plugins                   |
| poller_cluster            |
| poller_cluster_stats      |
| poller_groups             |
| pollers                   |
| ports                     |
| ports_adsl                |
| ports_fdb                 |
| ports_nac                 |
| ports_perms               |
| ports_stack               |
| ports_statistics          |
| ports_stp                 |
| ports_vlans               |
| processes                 |
| processors                |
| proxmox                   |
| proxmox_ports             |
| pseudowires               |
| route                     |
| sensors                   |
| sensors_to_state_indexes  |
| services                  |
| session                   |
| slas                      |
| state_indexes             |
| state_translations        |
| storage                   |
| stp                       |
| syslog                    |
| tnmsneinfo                |
| toner                     |
| transport_group_transport |
| ucd_diskio                |
| users                     |
| users_prefs               |
| users_widgets             |
| vlans                     |
| vminfo                    |
| vrf_lite_cisco            |
| vrfs                      |
| widgets                   |
| wireless_sensors          |
+---------------------------+
123 rows in set (0.00 sec)

MariaDB [librenms]> DESCRIBE TABLE ports_fdb;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'TABLE ports_fdb' at line 1
MariaDB [librenms]>

About git status:

librenms@monitoring:~$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working tree clean
librenms@monitoring:~$
librenms@monitoring:~$ git remote -v
origin  https://github.com/librenms/librenms.git (fetch)
origin  https://github.com/librenms/librenms.git (push)
librenms@monitoring:~$ git describe --tags
1.49-115-g4e4ceffc0
librenms@monitoring:~$

Your install missed some migrations.

Try this:

DELETE FROM migrations where migration='2019_02_10_220000_add_dates_to_fdb'; and ./lnms migrate

3 Likes
MariaDB [librenms]> DELETE FROM migrations where         migration='2019_02_10_220000_add_dates_to_fdb';
    Query OK, 1 row affected (0.08 sec)

    MariaDB [librenms]> quit
    Bye

    librenms@monitoring:~$ ./lnms migrate
    **************************************
    *     Application In Production!     *
    **************************************

     Do you really wish to run this command? (yes/no) [no]:
     > yes

    Migrating: 2019_02_10_220000_add_dates_to_fdb
    Migrated:  2019_02_10_220000_add_dates_to_fdb
    librenms@monitoring:~$ ./validate.php
    ====================================
    Component | Version
    --------- | -------
    LibreNMS  | 1.49-115-g4e4ceffc0
    DB Schema | 2019_02_10_220000_add_dates_to_fdb (132)
    PHP       | 7.3.3-1+0~20190307202245.32+stretch~1.gbp32ebb2
MySQL     | 10.1.37-MariaDB-0+deb9u1
RRDTool   | 1.6.0
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
[FAIL]  The poller (monitoring) has not completed within the last 5 minutes, check the cron job.
[WARN]  IPv6 is disabled on your server, you will not be able to add IPv6 devices.
[FAIL]  Some folders have incorrect file permissions, this may cause issues.
    [FIX]:
    sudo chown -R librenms:librenms /opt/librenms
    sudo setfacl -d -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
    sudo chmod -R ug=rwX /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
    Files:
     /opt/librenms/bootstrap/cache/packages.php
librenms@monitoring:~$ exit
$
[email protected]:~# sudo chown -R librenms:librenms /opt/librenms
[email protected]:~# sudo chmod -R ug=rwX /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
[email protected]:~# su - librenms
$ bash
librenms@monitoring:~$ ./validate.php
====================================
Component | Version
--------- | -------
LibreNMS  | 1.49-115-g4e4ceffc0
DB Schema | 2019_02_10_220000_add_dates_to_fdb (132)
PHP       | 7.3.3-1+0~20190307202245.32+stretch~1.gbp32ebb2
MySQL     | 10.1.37-MariaDB-0+deb9u1
RRDTool   | 1.6.0
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
[FAIL]  The poller (monitoring) has not completed within the last 5 minutes, check the cron job.
[WARN]  IPv6 is disabled on your server, you will not be able to add IPv6 devices.
librenms@monitoring:~$ ./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
librenms@monitoring:~$ ./validate.php
====================================
Component | Version
--------- | -------
LibreNMS  | 1.49-115-g4e4ceffc0
DB Schema | 2019_02_10_220000_add_dates_to_fdb (132)
PHP       | 7.3.3-1+0~20190307202245.32+stretch~1.gbp32ebb2
MySQL     | 10.1.37-MariaDB-0+deb9u1
RRDTool   | 1.6.0
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
[FAIL]  The poller (monitoring) has not completed within the last 5 minutes, check the cron job.
[WARN]  IPv6 is disabled on your server, you will not be able to add IPv6 devices.
[FAIL]  Some folders have incorrect file permissions, this may cause issues.
    [FIX]:
    sudo chown -R librenms:librenms /opt/librenms
    sudo setfacl -d -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
    sudo chmod -R ug=rwX /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
    Files:
     /opt/librenms/bootstrap/cache/packages.php
librenms@monitoring:~$

So the MySQL error disappeared, the validation script is ok, but every time I start update script, I need to fix the permissions with root account. Is it that correct?

Dont worry about permissions on that specific file.

1 Like

Thanks you all for solving my problem.