No validate errors after clean install, validate errors 24 hours later

I am seeing these errors under http://localhost/validate


Database

Fail: Database: missing index (sensors_to_state_indexes/state_index_id)

Fail: Database: extra index (sensors_to_state_indexes/sensors_to_state_indexes_ibfk_1)

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
  • ALTER TABLE sensors_to_state_indexes DROP INDEX sensors_to_state_indexes_ibfk_1;
  • ALTER TABLE sensors_to_state_indexes ADD INDEX state_index_id (state_index_id);

I see the SQL commands that I need to run, but do I need to get to the mysql directory to run those?

Thanks.

You need to login into the sql server and use the librenms database and run those commands.

Ok, I will try that now, thanks.

I thought I could just type mysql after I SSHed into the librenms appliance, but that doesn’t work. How can I log into mysql?

edit- Trying this now, " 1. At the command prompt, run the following command to launch the mysql shell and enter it as the root user: /usr/bin/mysql -u root -p."

Here is what I see after logging in and running the commands

librenms@librenms:~$ /usr/bin/mysql -u librenms -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 13831
Server version: 10.1.34-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04

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

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

MariaDB [(none)]> ALTER TABLE sensors_to_state_indexes DROP INDEX sensors_to_state_indexes_ibfk_1;
ERROR 1046 (3D000): No database selected
MariaDB [(none)]> ALTER TABLE sensors_to_state_indexes ADD INDEX state_index_id (state_index_id);
ERROR 1046 (3D000): No database selected
MariaDB [(none)]>

once you are logged in the database you need to switch over to the librenms DB. Type the following command

USE librenms;

then you can run those queries.

1 Like

Great, thanks that took care of it.

1 Like