Database migration error

I’m currently having a problem with an out of date database I’m trying to fix, but getting an error running ./lnms migrate

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

Component Version
LibreNMS 21.7.0-63-ga7f9c97ae
DB Schema 2021_07_06_1845_alter_bill_history_max_min (212)
PHP 7.4.20
Python 3.6.9
MySQL 10.5.10-MariaDB-1:10.5.10+maria~bionic
RRDTool 1.7.0
SNMP NET-SNMP 5.7.3
====================================

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

user@host:~$ ./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[42000]: Syntax error or access violation: 1061 Duplicate key name ‘syslog_device_id_program_index’ (SQL: alter table syslog add in
dex 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’

After dropping the syslog_device_id_program_index and repairing the table, the migration script finally ran properly.

Can you add some detail to the fix you used? I’m trying to drop the index but it fails.

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