So far, I have stopped and restarted httpd and mariadb, and I updated again with no luck. Does anyone know how to mitigate this and where the librenms.log file is located?
./daily.sh
Re-running /opt/librenms/daily.sh as librenms user
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
Caching Mac OUI data OK
[OK] Composer Version: 2.1.3
[OK] Dependencies up-to-date.
[OK] Database connection successful
[FAIL] Your database is out of date!
[FIX]:
./lnms migrate
The .lnms issue has already been here so I’m not sure if this is now causing me new issues. I can’t get the database commands to work once I run ./lnms migrate
I seem to have a very similiar problem that popped up over the weekend:
% php validate.php
====================================
Component | Version
--------- | -------
LibreNMS | 21.5.1-32-g20c44b85c
DB Schema | 2020_12_14_091314_create_port_group_port_table (205)
PHP | 7.3.26
Python | 3.7.9
MySQL | 5.7.32
RRDTool | 1.7.2
SNMP | NET-SNMP 5.9
====================================
[OK] Composer Version: 2.1.3
[OK] Dependencies up-to-date.
[OK] Database connection successful
[FAIL] Your database is out of date!
However:
% php lnms migrate
[...]
Migrating: 2020_12_14_091314_create_port_groups_table
In Connection.php line 678:
SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'port_groups
' already exists (SQL: create table `port_groups` (`id` int unsigned not nu
ll auto_increment primary key, `name` varchar(255) not null, `desc` varchar
(255) null) default character set utf8mb4 collate 'utf8mb4_unicode_ci')
In Exception.php line 18:
SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'port_groups
' already exists
In PDOStatement.php line 112:
SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'port_groups
' already exists
So apparently database migration steps where applied but the version parameter not increased?
Is it possible to manually bump the version parameter in the dbSchema table to skip migration steps?
SQLSTATE[42S01]: Base table or view already exists: 1050 Table ‘port_groups’ already exists (SQL: create table p ort_groups (id int unsigned not null auto_increment primary key, name varchar(255) not null, desc varchar(
255) null) default character set utf8mb4 collate ‘utf8mb4_unicode_ci’)
In Exception.php line 18:
SQLSTATE[42S01]: Base table or view already exists: 1050 Table ‘port_groups’ already exists
In PDOStatement.php line 112:
SQLSTATE[42S01]: Base table or view already exists: 1050 Table ‘port_groups’ already exists
I found a fix after combing through a few threads.
My main error was that the port_groups table was already created and ./lnms migrate was trying to recreate it. So I needed to delete that table before re-running lnms migrate.
I signed into my librenms database then ran DROP TABLE port_groups;
This removed the table, I re-ran ./lnms migrate and ./validate.php and my GUI was working again and the database migration has completed successfully.