Something went wrong after latest update

After latest update our Librenms instance doesn’t work properly any more. It seems that with latest Librenms update, database schema was not updated correctly. In logs i found this error

[2020-10-08 01:02:47] production.ERROR: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'librenms.cache' doesn't exist (SQL: select * from `cache` where `key` = laravel_cachechecks_popup_timeout limit 1) (View: /opt/librenms/resources/views/auth/login.blade.php) {"exception":"[object] (ErrorException(code: 0): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'librenms.cache' doesn't exist (SQL: select * from `cache` where `key` = laravel_cachechecks_popup_timeout limit 1) (View: /opt/librenms/resources/views/auth/login.blade.php) at /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php:671)

Also I checked librenms db instance, I do not see tables cache and cache_locks.

====================================
Component | Version
--------- | -------
LibreNMS  | 1.68-35-g1e4702f
DB Schema | 2020_08_28_212054_drop_uptime_column_outages (169)
PHP       | 7.4.11
Python    | 3.6.8
MySQL     | 8.0.16
RRDTool   | 1.4.8
SNMP      | NET-SNMP 5.7.2
====================================

[OK]    Composer Version: 1.10.13
[OK]    Dependencies up-to-date.
[OK]    Database connection successful
[FAIL]  Your database is out of date!
	[FIX]: 
	./lnms migrate

and

./lnms  migrate
**************************************
*     Application In Production!     *
**************************************

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

Migrating: 2020_04_13_150500_add_last_error_fields_to_bgp_peers

In Connection.php line 671:
                                                                                                                                                                                                            
  SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'bgpPeerLastErrorCode' (SQL: alter table `bgpPeers` add `bgpPeerLastErrorCode` int null after `bgpPeerAdminStatus`, add `bgpPeerLastE  
  rrorSubCode` int null after `bgpPeerLastErrorCode`, add `bgpPeerLastErrorText` varchar(254) null after `bgpPeerLastErrorSubCode`)                                                                         
                                                                                                                                                                                                            

In PDOStatement.php line 131:
                                                                                             
  SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'bgpPeerLastErrorCode'  
                                                                                             

In PDOStatement.php line 129:
                                                                                             
  SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'bgpPeerLastErrorCode'  
                                                                                             

Any suggestions?

Anybody, any further steps to resolve this issue?

Hello,
I managed to resolve this issue. This post was very helpful:

Regards

2 Likes