Need help, Cannot move past DB migration! Thank you!

Hello, I have been struggling with this error on and off for a very long time and after today, I noticed that my Librenms web UI will not even load until I can finally get the migrate command to complete, i think it’s because my site upgraded, and my DB is far behind. but I’ve been pulling my hair out and I cannot get it to move past this. I’ve done everything I can think of including running it in -pretend and then running the SQL commands manually, but they do not help me move past this. how can I skip this particular migration script since I did it manually?
Thanks!

Output of validate:

-bash-4.2$ ./validate.php
===========================================
Component | Version
--------- | -------
LibreNMS  | 23.10.0-66-gf59388d (2023-11-11T13:19:42-06:00)
DB Schema | 2021_11_29_165046_improve_devices_search_index (225)
PHP       | 8.1.25
Python    | 3.6.8
Database  | MariaDB 10.5.17-MariaDB
RRDTool   | 1.4.8
SNMP      | 5.7.2
===========================================

[OK]    Composer Version: 2.6.5
[OK]    Dependencies up-to-date.
[OK]    Database connection successful
[FAIL]  Your database is out of date!
        [FIX]: 
        ./lnms migrate
Attempt to fix this issue (y or n)?:y

In Connection.php line 795:
                                                                                                                                                                                                                                                       
  SQLSTATE[42000]: Syntax error or access violation: 1061 Duplicate key name 'ports_ifalias_port_descr_descr_portname_index' (Connection: mysql, SQL: alter table `ports` add index `ports_ifalias_port_descr_descr_portname_index`(`ifAlias`, `port_  
  descr_descr`, `portName`))                                                                                                                                                                                                                           
                                                                                                                                                                                                                                                       

In Connection.php line 580:
                                                                                                                              
  SQLSTATE[42000]: Syntax error or access violation: 1061 Duplicate key name 'ports_ifalias_port_descr_descr_portname_index'  

Output of migrate command:

-bash-4.2$         ./lnms migrate

                                                                                                                                                                                                                                                        
                                                                                                               APPLICATION IN PRODUCTION.                                                                                                               
                                                                                                                                                                                                                                                        

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

   INFO  Running migrations.  

  2021_11_29_165436_improve_ports_search_index ............................................................................................ 2ms FAIL

In Connection.php line 795:
                                                                                                                                                                                                                                                       
  SQLSTATE[42000]: Syntax error or access violation: 1061 Duplicate key name 'ports_ifalias_port_descr_descr_portname_index' (Connection: mysql, SQL: alter table `ports` add index `ports_ifalias_port_descr_descr_portname_index`(`ifAlias`, `port_  
  descr_descr`, `portName`))                                                                                                                                                                                                                           
                                                                                                                                                                                                                                                       

In Connection.php line 580:
                                                                                                                              
  SQLSTATE[42000]: Syntax error or access violation: 1061 Duplicate key name 'ports_ifalias_port_descr_descr_portname_index'  
                                                                                                                              

If I try to drop the index manually, then run it again, it complains that the index does not exist. I am stuck in a loop and could really appreciate any and all assistance. Thanks!

Look in your database and remove the duplicate port ifAlias, port_descr_descr, portName combo.

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