Database: missing index (locations/locations_location_uindex)

Hi chaps,

Maybe you’ve seen this before.
I’m running into a validation issue in my DB.

[OK]    Composer Version: 1.8.4
[OK]    Dependencies up-to-date.
[OK]    Database connection successful
[FAIL]  Database: missing index (locations/locations_location_uindex)
[FAIL]  We have detected that your database schema may be wrong, please report the following to us on Discord (https://t.libren.ms/disco                                                                                                     rd) or the community site (https://t.libren.ms/5gscd):
        [FIX]:
        Run the following SQL statements to fix.
        SQL Statements:
         ALTER TABLE `locations` ADD UNIQUE `locations_location_uindex` (`location`);
librenms@mon-mon-tst:/opt/librenms$ ./daily.sh

Once I run that query, I’m getting :

Database changed
MariaDB [librenms]> ALTER TABLE `locations` ADD UNIQUE `locations_location_uindex` (`location`);
ERROR 1062 (23000): Duplicate entry 'Main DC' for key 'locations_location_uindex'

I’m not sure if I should go in and delete anything or change something?

Any input kindly appreciated.

Delete one of the two entries that are duplicates. There may be (much) more than two.

When that change was made to the system there was a query to remove duplicates. You must have skipped/failed it somehow, but the SQL might be useful look for the file in the sql-schema folder that references the locations table.