Need help with updating - missing columns in Database

Hello,

I’m trying to update my libreNMS server. the daily.sh has ran without any issues. However the validate gives the following error:
image

When i try to rune the ./lmns mirgrate i get the following issues:

Migrating: 2021_11_29_165046_improve_devices_search_index

In Connection.php line 703:
SQLSTATE[42000]: Syntax error or access violation: 1072 Key column ‘display’ doesn’t exist in table (SQL: alter table devices add index devices_hostname_sysname_display_index(hostname, sysName, display))

In Exception.php line 18:
SQLSTATE[42000]: Syntax error or access violation: 1072 Key column ‘display’ doesn’t exist in table

In PDOStatement.php line 117:
SQLSTATE[42000]: Syntax error or access violation: 1072 Key column ‘display’ doesn’t exist in table

Can someone help me how i can fix this?

edit: fixed some spelling issues.

Run the SQL statement in the output you posted above.

If I do i get the exact same error. And when I check the database the column really seems to be missing.

If you run that command, you will either get no response meaning the column was added or you’ll get an error back. Post the console where you’ve entered the query and it’s response.

Here is the uitput from the command line:

MariaDB [(none)]> alter table librenms.devices add index devices_hostname_sysname_display_index(hostname, sysName, display);
ERROR 1072 (42000): Key column ‘display’ doesn’t exist in table

I have found the sollution. The lnms migrate appreared to be the issue. After executeing lnms migrate:status it show it had already executed “2021_11_17_105321_device_add_display_field.php”. This was not the case when looking at the database.

After multible lnms migrate:rollbacks and re-executing lnms migrate from the above migration file it appears to have updated the database corretly. I now see the correct schema " 2021_25_01_0129_isis_adjacencies_nullable (229)" and the validate.php doesnt give anymore errors.

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