Lnms fails to migrate database

I’m trying to migrate the database but it fails because it finds a duplicate index in the syslog table.

Here is the validate output:

Component Version
LibreNMS 21.8.0-62-g117036bf2
DB Schema 2020_06_24_155119_drop_ports_if_high_speed (213)
PHP 7.4.23
Python 3.6.9
MySQL 10.5.12-MariaDB-1:10.5.12+maria~bionic-log
RRDTool 1.7.0
SNMP NET-SNMP 5.7.3

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

[OK] Composer Version: 2.1.8
[OK] Dependencies up-to-date.
[OK] Database connection successful
[FAIL] Your database is out of date!
[FIX]:
./lnms migrate

Here is the output from lnms migrate:
Running ./lnms migrate

Migrating: 2021_08_04_102914_add_syslog_indexes

In Connection.php line 692:

SQLSTATE[42000]: Syntax error or access violation: 1061 Duplicate key name ‘syslog_device_id_program_index’ (SQL: alter table syslog add index syslog_device_id_program_index (device_id, program))
In Exception.php line 18:

SQLSTATE[42000]: Syntax error or access violation: 1061 Duplicate key name ‘syslog_device_id_program_index’

In PDOStatement.php line 112:

SQLSTATE[42000]: Syntax error or access violation: 1061 Duplicate key name ‘syslog_device_id_program_index’

Any help is appreciated.

Thanks,
Chris Burt

Hello Community
I was able to run the migration after I dropped the index syslog_device_id_program_index but it failed with the error below:

[email protected]:~$ ./lnms migrate


  • Application In Production!     *
    

Do you really wish to run this command? (yes/no) [no]:

yes

Migrating: 2021_08_04_102914_add_syslog_indexes

In Connection.php line 692:

SQLSTATE[HY000] [2002] Connection refused (SQL: alter table syslog add index syslog_device_id_program_index(device_id, program))

In Exception.php line 18:

SQLSTATE[HY000] [2002] Connection refused

In PDOConnection.php line 39:

SQLSTATE[HY000] [2002] Connection refused

Any ideas? What’s next drop the whole table and run it?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.