This morning our libre web interface came back saying that the db was inconsistent. I ran a validate.php and all of the SQL commands I was advised to run worked but one:
php validate.php
Component | Version |
---|---|
LibreNMS | 22.5.0 |
DB Schema | 2022_05_30_084932_update-app-status-length (244) |
PHP | 7.4.16 |
Python | 3.5.3 |
MySQL | 10.5.13-MariaDB-1:10.5.13+maria~stretch |
RRDTool | 1.6.0 |
SNMP | 5.7.3 |
====================================
[OK] Composer Version: 2.3.7
[OK] Dependencies up-to-date.
[OK] Database connection successful
[WARN] Your database schema has extra migrations (2022_02_21_073500_add_iface_field_to_bgp_peers, 2022_05_25_084506_add_widgets_column_to_users_widgets_table, 2022_05_25_084617_migrate_widget_ids, 2022_05_25_085715_remove_user_widgets_id, 2022_05_25_090027_drop_widgets_table, 2022_05_30_084932_update-app-status-length). If you just switched to the stable release from the daily release, your database is in between releases and this will be resolved with the next release.
[FAIL] Database: incorrect index (users_widgets/user_id)
[FAIL] We have detected that your database schema may be wrong
[FIX]:
Run the following SQL statements to fix it
SQL Statements:
ALTER TABLE users_widgets
DROP INDEX user_id
, INDEX user_id
(user_id
,widget_id
);
[INFO] Detected Python Wrapper
[OK] Connection to memcached is ok
[WARN] Your local git contains modified files, this could prevent automatic updates.
[FIX]:
You can fix this with ./scripts/github-remove
Modified Files:
includes/definitions/edgeswitch.yaml
When I run that SQL command I get the following error:
MariaDB [librenms]> ALTER TABLE users_widgets
DROP INDEX user_id
, INDEX user_id
(user_id
,widget_id
);
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 ’user_id
(user_id
,widget_id
)’ at line 1