Problem with update

Hi friends, I cant update. Please help me. What can I do with this ?

root@librenms:/opt/librenms# ./daily.sh
Re-running /opt/librenms/daily.sh as librenms user
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
root@librenms:/opt/librenms#

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

Component Version
LibreNMS 1.36.01
DB Schema 237
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
[WARN] Your schema (237) is newer than than expected (232). If you just switch to the stable release from the daily release, your database is in between releases and this will be resolved with the next release.
[FAIL] Database: incorrect index (bgpPeers/device_id)
[FAIL] Database: incorrect index (bgpPeers_cbgp/device_id)
[FAIL] Database: incorrect column (ipv4_mac/context_name)
[FAIL] Database: extra column (ports_fdb/ports_fdb_id)
[FAIL] Database: extra index (ports_fdb/PRIMARY)
[FAIL] Database: incorrect column (users/password)
[FAIL] We have detected that your database schema may be wrong, please report the following to us on IRC or the community site (https://t.libren.ms/5gscd ):
[FIX] Run the following SQL statements to fix.
SQL Statements:
ALTER TABLE bgpPeers DROP INDEX device_id, INDEX device_id (device_id);
ALTER TABLE bgpPeers_cbgp DROP INDEX device_id, INDEX device_id (device_id,bgpPeerIdentifier);
ALTER TABLE ipv4_mac CHANGE context_name context_name varchar(128) NULL;
ALTER TABLE ports_fdb DROP ports_fdb_id;
ALTER TABLE ports_fdb DROP INDEX PRIMARY;
ALTER TABLE users CHANGE password password varchar(60) NULL;
[WARN] Your install is over 24 hours out of date, last update: Wed, 31 Jan 2018 13:54:16 +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 branch is not master, this will prevent automatic updates.
[FIX] You can switch back to master with git checkout master

Did you try to change update releases?

https://docs.librenms.org/#General/Releases/

yes, this is the output

root@librenms:~# cd /opt/librenms && git checkout master
fatal: Unable to create ‘/opt/librenms/.git/index.lock’: File exists.

If no other git process is currently running, this probably means a
git process crashed in this repository earlier. Make sure no other git
process is running and remove the file manually to continue.
root@librenms:/opt/librenms#
root@librenms:/opt/librenms# mc

root@librenms:/opt/librenms# cd
root@librenms:~# cd /opt/librenms && git fetch --tags && git checkout $(git describe --tags $(git rev-list --tags --max-count=1))
remote: Counting objects: 4, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 4 (delta 2), reused 4 (delta 2), pack-reused 0
Unpacking objects: 100% (4/4), done.
From https://github.com/librenms/librenms
ff02fce…1d45d4b master -> origin/master
fatal: Unable to create ‘/opt/librenms/.git/index.lock’: File exists.

If no other git process is currently running, this probably means a
git process crashed in this repository earlier. Make sure no other git
process is running and remove the file manually to continue.
root@librenms:/opt/librenms#
root@librenms:/opt/librenms# ./daily.sh
Re-running /opt/librenms/daily.sh as librenms user
Updating to latest release FAIL
fatal: Unable to create ‘/opt/librenms/.git/index.lock’: File exists.

If no other git process is currently running, this probably means a
git process crashed in this repository earlier. Make sure no other git
process is running and remove the file manually to continue.
Updating SQL-Schema OK
Updating submodules OK
Cleaning up DB OK
Fetching notifications OK
Caching PeeringDB data OK
root@librenms:/opt/librenms#

Ok i have it.

I deleted file index.lock from ‘/opt/librenms/.git/index.lock’ and then i can update. But I still have a problem with database.
root@librenms:/opt/librenms# ./validate.php

Component Version
LibreNMS 1.37
DB Schema 237
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
[FAIL] Database: missing column (ports_fdb/ports_fdb_id)
[FAIL] Database: missing index (ports_fdb/PRIMARY)
[FAIL] We have detected that your database schema may be wrong, please report the following to us on IRC or the community site (https://t.libren.ms/5gscd):
[FIX] Run the following SQL statements to fix.
SQL Statements:
ALTER TABLE ports_fdb ADD ports_fdb_id bigint(20) unsigned NOT NULL auto_increment;
ALTER TABLE ports_fdb ADD PRIMARY KEY (ports_fdb_id);

when I run MYSQL as librenms it is not working for me, what is libre nms into validate config saying. What can I do with this ?

MariaDB [librenms]> ALTER TABLE ports_fdb ADD ports_fdb_id bigint(20) unsigned NOT NULL auto_increment;
ERROR 1075 (42000): Incorrect table definition; there can be only one auto column and it must be defined as a key
MariaDB [librenms]> ALTER TABLE ports_fdb ADD PRIMARY KEY (ports_fdb_id);
ERROR 1072 (42000): Key column ‘ports_fdb_id’ doesn’t exist in table
MariaDB [librenms]> ALTER TABLE ports_fdb ADD ports_fdb_id bigint(20) unsigned NOT NULL auto_increment;
ERROR 1075 (42000): Incorrect table definition; there can be only one auto column and it must be defined as a key

Thank you for your help.

It means your ports_fdb table is in a state that validate can’t guess the correct commands to fix.

Run DESCRIBE TABLE ports_fdb and post the output here.

MariaDB [librenms]> DESCRIBE ports_fdb;
±------------±-----------------±-----±----±--------±------+
| Field | Type | Null | Key | Default | Extra |
±------------±-----------------±-----±----±--------±------+
| port_id | int(11) unsigned | NO | MUL | NULL | |
| mac_address | varchar(32) | NO | MUL | NULL | |
| vlan_id | int(11) unsigned | NO | MUL | NULL | |
| device_id | int(11) unsigned | NO | MUL | NULL | |
±------------±-----------------±-----±----±--------±------+
4 rows in set (0.00 sec)

ALTER TABLE `ports_fdb` ADD COLUMN `ports_fdb_id` BIGINT(20) UNSIGNED PRIMARY KEY AUTO_INCREMENT FIRST;

Thank you. It is worked for me. :beer:

Dear Folks,
Am having an issue while updating daily.sh
below is the error

root@libresvr:/opt/librenms# ./daily.sh
Re-running /opt/librenms/daily.sh as librenms user
Updating to latest codebase FAIL
fatal: unable to access ‘https://github.com/librenms/librenms.git/’: gnutls_handshake() failed: An unexpected TLS packet was received.
Updating Composer packages OK
Updating SQL-Schema OK
Updating submodules OK
Cleaning up DB OK
Fetching notifications OK
Caching PeeringDB data OK

The codebase fails to run with error as shown above.
Please assist on a fix

Your sever doesn’t have access to git hub check the connection.