Broken Validate

While trying to add graphing of CPU usage of Cambium PMP450’s I’ve done something to break validate.

./validate.php

Component Version
LibreNMS 1.47-97-g1bb782b6d
DB Schema 2019_01_16_195644_add_vrf_id_and_bgpLocalAs (131)
PHP 7.0.27-0+deb9u1
MySQL 10.1.26-MariaDB-0+deb9u1
RRDTool 1.6.0
SNMP NET-SNMP 5.7.3

====================================

[OK] Composer Version: 1.8.0
[OK] Dependencies up-to-date.

In functions.php line 2479:

Undefined index: Create Table

I found this in the librenms log.

[2019-01-23 11:26:12] production.ERROR: ErrorException: Undefined index: Create Table in /opt/librenms/includes/functions.php:2479
Stack trace:
#0 /opt/librenms/includes/functions.php(2479): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8, ‘Undefined index…’, ‘/opt/librenms/i…’, 2479, Array)
#1 /opt/librenms/LibreNMS/Validations/Database.php(151): dump_db_schema()
#2 /opt/librenms/LibreNMS/Validations/Database.php(68): LibreNMS\Validations\Database->checkSchema(Object(LibreNMS\Validator))
#3 /opt/librenms/LibreNMS/Validator.php(82): LibreNMS\Validations\Database->validate(Object(LibreNMS\Validator))
#4 /opt/librenms/validate.php(161): LibreNMS\Validator->validate(Array, false)
#5 {main}

This appears to be related to libre not being able to talk to the database but I’ve verified that remote access to the database is available from the web and poller machine’s.

mysql -u librenms -h libresql.cerento.com -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 83399895
Server version: 10.1.26-MariaDB-0+deb9u1 Debian 9.1

Copyright © 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

MariaDB [(none)]>

I’m not sure what the next step would be to troubleshoot this,

Any thoughts?

Do you have the commands you ran to add graphing of CPU usage of Cambium PMP450’s ?

Did you try updating to latest version, or is it still the same?

That’s what has me so confused. I only added some text to a yaml file, it’s just strange that I noticed it around the same time. It likely has no relevance is my guess.

I suspect it’s something on the MySQL server as it’s referencing tables in the error, but I’m able to access it remotely with the correct credentials.

So I found some more information in the web validation.

Database Failure

Fail: Database: extra table (vw_alertlog_updown)

Fail: Database: extra table (vw_eventlog_updown)

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
  • DROP TABLE vw_alertlog_updown;
  • DROP TABLE vw_eventlog_updown;

So I tried to run these commands and it failed.

mysql -ulibrenms -p

Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 4032964
Server version: 10.1.26-MariaDB-0+deb9u1 Debian 9.1

Copyright © 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

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]> DROP TABLE vw_alertlog_updown;
ERROR 1965 (42S02): ‘librenms.vw_alertlog_updown’ is a view
MariaDB [librenms]> DROP TABLE vw_eventlog_updown;
ERROR 1965 (42S02): ‘librenms.vw_eventlog_updown’ is a view

If they are VIEWs, try with DROP VIEW instead DROP TABLE

1 Like

Outstanding!! Thanks!!