So. Apparently that wasn’t my issue, or at least… it’s not still my issue? I’ve now managed to upgrade mariadb ; I’m at 10.2.31
$ ./validate.php
Component |
Version |
LibreNMS |
21.5.1-29-g3cf0397 |
DB Schema |
2020_12_14_091314_create_port_group_port_table (205) |
PHP |
7.3.17-1+ubuntu16.04.1+deb.sury.org+1 |
Python |
3.5.2 |
MySQL |
10.2.31-MariaDB-10.2.31+maria~xenial |
RRDTool |
1.5.5 |
SNMP |
NET-SNMP 5.7.3 |
==================================== |
|
[OK] Composer Version: 2.1.2
[OK] Dependencies up-to-date.
[OK] Database connection successful
[FAIL] Your database is out of date!
[FIX]:
./lnms migrate
but that “fix” does not fix anything, just reports some errors:
$ ./lnms migrate
Do you really wish to run this command? (yes/no) [no]:
yes
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
I’ve got the latest daily files:
$ git pull
Already up-to-date.
$ ./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
Caching Mac OUI data OK
The next step in the google rabbit hole said to:
$ ./lnms migrate --pretend
and then MANUALLY run those commands. So I did, by way of:
mysql
MariaDB [(none)]> use librenms
… all the commands from the migrate’s output, adding the requisite ; to the end of each
SOME of them have errors, specifically:
MariaDB [librenms]> select TABLE_NAME
from information_schema
.tables
where table_schema
= ?
→ ;
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 ‘?’ at line 1
MariaDB [librenms]> select * from information_schema
.columns
where table_schema
= ? and CHARACTER_SET_NAME
is not null and COLLATION_NAME
is not null and (CHARACTER_SET_NAME
!= ? or COLLATION_NAME
!= ?)
→ ;
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 ‘? and CHARACTER_SET_NAME
is not null and COLLATION_NAME
is not null and (`CH’ at line 1
… and now it appears to function again. I have no particular understanding of why my librenms was non-functional specifically today. Nor why those particular mysql commands above are not syntactical. But assuming that my particular plight was not unique, maaaaybe it will help somebody else when they google my error messages.
PS. My ./validate.pl STILL tells me that my database is out of date, and I have no idea what’s up with that