Vaidate.php fails with database out of date

Our LIbreNMS stopped working and show splash page with run
./lnms migrate

I ran validate.php first
This is output

~$ ./validate.php

Component Version
LibreNMS 24.4.1-9-g43e6846cb (2024-04-25T13:36:16-07:00)
DB Schema 2024_01_09_211518_custom_map_node_maplink (286)
PHP 8.2.7
Python 3.8.10
Database MariaDB 10.3.39-MariaDB-0ubuntu0.20.04.2
RRDTool 1.7.2
SNMP 5.8
===========================================

[OK] Composer Version: 2.7.3
[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 829:

SQLSTATE[42000]: Syntax error or access violation: 1091 Can’t DROP INDEX PRIMARY; check that it exists (Connection:
mysql, SQL: alter table bill_data drop primary key)

In Connection.php line 587:

SQLSTATE[42000]: Syntax error or access violation: 1091 Can’t DROP INDEX PRIMARY; check that it exists

I haven’t done anything with the database I need help finding out what happened to the table to get this fixed ASAP

Thanks

I was able to get this fixed,
The table bill_data only finished half way through the daily.sh thus corrupting the table.
The reason it only finished half way through was /tmp was filling up while mysql was processing the table.
So in the server.cnf file I changed location of tempdir to a larger partition.
Ran this statement to put ‘id’ back in
ALTER TABLE bill_data ADD id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;

Then ran ./validate again and this time went though all the way and now system is back up with webUI.

1 Like

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