We have detected that your database schema may be wrong

I am getting this result from validate.php, after running ./lnms migrate

 [email protected]:~$ ./validate.php 
====================================
Component | Version
--------- | -------
LibreNMS  | 21.2.0-58-ge3a1a239f
DB Schema | 2021_03_17_160729_service_templates_cleanup (201)
PHP       | 7.3.27
Python    | 3.6.8
MySQL     | 10.5.9-MariaDB
RRDTool   | 1.7.2
SNMP      | NET-SNMP 5.7.2
====================================

[OK]    Composer Version: 2.0.11
[OK]    Dependencies up-to-date.
[OK]    Database connection successful
[FAIL]  Database: incorrect column (alerts/timestamp)
[FAIL]  Database: incorrect column (alert_log/time_logged)
[FAIL]  Database: incorrect column (alert_schedule/start)
[FAIL]  Database: incorrect column (alert_schedule/end)
[FAIL]  Database: incorrect column (applications/timestamp)
[FAIL]  Database: incorrect column (authlog/datetime)
[FAIL]  Database: incorrect column (bills/bill_last_calc)
[FAIL]  Database: incorrect column (bill_data/timestamp)
[FAIL]  Database: incorrect column (bill_history/updated)
[FAIL]  Database: incorrect column (bill_history/bill_datefrom)
[FAIL]  Database: incorrect column (bill_history/bill_dateto)
[FAIL]  Database: incorrect column (bill_port_counters/timestamp)
[FAIL]  Database: incorrect column (component_statuslog/timestamp)
[FAIL]  Database: incorrect column (customoids/lastupdate)
[FAIL]  Database: incorrect column (devices/inserted)
[FAIL]  Database: incorrect column (devices/last_polled)
[FAIL]  Database: incorrect column (devices/last_poll_attempted)
[FAIL]  Database: incorrect column (devices/last_discovered)
[FAIL]  Database: incorrect column (devices/last_ping)
[FAIL]  Database: incorrect column (devices_attribs/updated)
[FAIL]  Database: incorrect column (device_perf/timestamp)
[FAIL]  Database: incorrect column (entityState/entStateLastChanged)
[FAIL]  Database: incorrect column (eventlog/datetime)
[FAIL]  Database: incorrect column (locations/timestamp)
[FAIL]  Database: incorrect column (notifications/datetime)
[FAIL]  Database: incorrect column (pollers/last_polled)
[FAIL]  Database: incorrect column (poller_cluster/last_report)
[FAIL]  Database: incorrect column (ports_adsl/port_adsl_updated)
[FAIL]  Database: incorrect column (ports_fdb/created_at)
[FAIL]  Database: incorrect column (ports_fdb/updated_at)
[FAIL]  Database: incorrect column (proxmox/last_seen)
[FAIL]  Database: incorrect column (proxmox_ports/last_seen)
[FAIL]  Database: incorrect column (route/created_at)
[FAIL]  Database: incorrect column (route/updated_at)
[FAIL]  Database: incorrect column (sensors/lastupdate)
[FAIL]  Database: incorrect column (service_templates/changed)
[FAIL]  Database: incorrect column (state_translations/state_lastupdated)
[FAIL]  Database: incorrect column (syslog/timestamp)
[FAIL]  Database: incorrect column (users/created_at)
[FAIL]  Database: incorrect column (users/updated_at)
[FAIL]  Database: incorrect column (wireless_sensors/lastupdate)
[FAIL]  We have detected that your database schema may be wrong, please report the following to us on Discord (https://t.libren.ms/discord) or the community site (https://t.libren.ms/5gscd):
        [FIX]: 
        Run the following SQL statements to fix.
        SQL Statements:
         ALTER TABLE `alerts` CHANGE `timestamp` `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ;
         ALTER TABLE `alert_log` CHANGE `time_logged` `time_logged` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ;
         ALTER TABLE `alert_schedule` CHANGE `start` `start` datetime NOT NULL DEFAULT '1970-01-02 00:00:01' ;
         ALTER TABLE `alert_schedule` CHANGE `end` `end` datetime NOT NULL DEFAULT '1970-01-02 00:00:01' ;
         ALTER TABLE `applications` CHANGE `timestamp` `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP;
         ALTER TABLE `authlog` CHANGE `datetime` `datetime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ;
         ALTER TABLE `bills` CHANGE `bill_last_calc` `bill_last_calc` datetime NOT NULL ;
         ALTER TABLE `bill_data` CHANGE `timestamp` `timestamp` datetime NOT NULL ;
         ALTER TABLE `bill_history` CHANGE `updated` `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ;
         ALTER TABLE `bill_history` CHANGE `bill_datefrom` `bill_datefrom` datetime NOT NULL ;
         ALTER TABLE `bill_history` CHANGE `bill_dateto` `bill_dateto` datetime NOT NULL ;
         ALTER TABLE `bill_port_counters` CHANGE `timestamp` `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ;
         ALTER TABLE `component_statuslog` CHANGE `timestamp` `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ;
         ALTER TABLE `customoids` CHANGE `lastupdate` `lastupdate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP;
         ALTER TABLE `devices` CHANGE `inserted` `inserted` timestamp NULL DEFAULT CURRENT_TIMESTAMP ;
          and 26 more...
[INFO]  Detected Dispatcher Service
[WARN]  IPv6 is disabled on your server, you will not be able to add IPv6 devices.

How can I fix this?

Thanks!

I have run the individual SQL statements and it seems that the issue was solved.

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