LibreNMS not working after OS upgrade

Tags: #<Tag:0x00007f84a78febb0>

After upgrading to my LibreNMS instance to Ubuntu 20.04 from 18.04 the web UI has stopped working just returns a “Whoops looks like something went wrong error”.

I get the following error in the libreNMS log file:

[2021-01-22 09:34:07] production.ERROR: Class App\Http\Controllers\OverviewController does not exist {“exception”:"[object] (ReflectionException(code: -1): Class App\Http\Controllers\OverviewController does not exist at /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php:779)

[stacktrace]

#0 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(779): ReflectionClass->__construct()

#1 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(658): Illuminate\Container\Container->build()

#2 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(609): Illuminate\Container\Container->resolve()

#3 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(759): Illuminate\Container\Container->make()

#4 /opt/librenms/vendor/laravel/framework/src/Illuminate/Routing/Route.php(233): Illuminate\Foundation\Application->make()

#5 /opt/librenms/vendor/laravel/framework/src/Illuminate/Routing/Route.php(833): Illuminate\Routing\Route->getController()

#6 /opt/librenms/vendor/laravel/framework/src/Illuminate/Routing/Route.php(794): Illuminate\Routing\Route->controllerMiddleware()

#7 /opt/librenms/vendor/laravel/framework/src/Illuminate/Routing/Router.php(695): Illuminate\Routing\Route->gatherMiddleware()

#8 /opt/librenms/vendor/laravel/framework/src/Illuminate/Routing/Router.php(675): Illuminate\Routing\Router->gatherRouteMiddleware()

#9 /opt/librenms/vendor/laravel/framework/src/Illuminate/Routing/Router.php(659): Illuminate\Routing\Router->runRouteWithinStack()

#10 /opt/librenms/vendor/laravel/framework/src/Illuminate/Routing/Router.php(625): Illuminate\Routing\Router->runRoute()

#11 /opt/librenms/vendor/laravel/framework/src/Illuminate/Routing/Router.php(614): Illuminate\Routing\Router->dispatchToRoute()

#12 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(176): Illuminate\Routing\Router->dispatch()

#13 /opt/librenms/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(30): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}()

#14 /opt/librenms/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}()

#15 /opt/librenms/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Fideloper\Proxy\TrustProxies->handle()

#16 /opt/librenms/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()

#17 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(31): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}()

#18 /opt/librenms/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle()

#19 /opt/librenms/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()

#20 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(31): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}()

#21 /opt/librenms/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle()

#22 /opt/librenms/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()

#23 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}()

#24 /opt/librenms/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle()

#25 /opt/librenms/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()

#26 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(62): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}()

#27 /opt/librenms/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle()

#28 /opt/librenms/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()

#29 /opt/librenms/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(104): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}()

#30 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(151): Illuminate\Pipeline\Pipeline->then()

#31 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(116): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter()

#32 /opt/librenms/html/index.php(53): Illuminate\Foundation\Http\Kernel->handle()

#33 {main}

"}
Here is the output of validate.php which does show a ton of DB schema errors. I already went through and entered the SQL commands it told me too, however, once all of those were fixed I ran ./daily.sh and it reverted the SQL changes :frowning:

[email protected]:~$ ./validate.php

Component Version
LibreNMS 1.70.1
DB Schema 2020_11_02_164331_add_powerstate_enum_to_vminfo (191)
PHP 7.4.3
Python 3.8.5
MySQL 10.3.25-MariaDB-0ubuntu0.20.04.1
RRDTool 1.7.2
SNMP NET-SNMP 5.8
OpenSSL

====================================

[OK] Composer Version: 2.0.8
[OK] Dependencies up-to-date.
[OK] Database connection successful
[FAIL] Database: missing index (access_points/access_points_deleted_index)
[FAIL] Database: extra index (access_points/deleted)
[FAIL] Database: incorrect column (alerts/timestamp)
[FAIL] Database: missing index (alerts/alerts_device_id_index)
[FAIL] Database: missing index (alerts/alerts_device_id_rule_id_unique)
[FAIL] Database: missing index (alerts/alerts_rule_id_index)
[FAIL] Database: extra index (alerts/device_id)
[FAIL] Database: extra index (alerts/rule_id)
[FAIL] Database: extra index (alerts/unique_alert)
[FAIL] Database: missing index (alert_device_map/alert_device_map_rule_id_device_id_unique)
[FAIL] Database: extra index (alert_device_map/alert_device_map_rule_id_device_id_uindex)
[FAIL] Database: missing index (alert_group_map/alert_group_map_rule_id_group_id_unique)
[FAIL] Database: extra index (alert_group_map/alert_group_map_rule_id_group_id_uindex)
[FAIL] Database: missing table (alert_location_map)
[FAIL] Database: missing index (alert_log/alert_log_device_id_index)
[FAIL] Database: missing index (alert_log/alert_log_rule_id_device_id_index)
[FAIL] Database: missing index (alert_log/alert_log_rule_id_device_id_state_index)
[FAIL] Database: missing index (alert_log/alert_log_rule_id_index)
[FAIL] Database: missing index (alert_log/alert_log_time_logged_index)
[FAIL] Database: extra index (alert_log/device_id)
[FAIL] Database: extra index (alert_log/rule_id)
[FAIL] Database: extra index (alert_log/time_logged)
[FAIL] Database: missing column (alert_rules/invert_map)
[FAIL] Database: missing index (alert_rules/alert_rules_name_unique)
[FAIL] Database: extra index (alert_rules/name)
[FAIL] Database: missing index (alert_schedulables/alert_schedulables_schedule_id_index)
[FAIL] Database: extra index (alert_schedulables/schedule_id)
[FAIL] Database: extra column (alert_schedule/start_recurring_dt)
[FAIL] Database: extra column (alert_schedule/end_recurring_dt)
[FAIL] Database: extra column (alert_schedule/start_recurring_hr)
[FAIL] Database: extra column (alert_schedule/end_recurring_hr)
[FAIL] Database: missing index (api_tokens/api_tokens_token_hash_unique)
[FAIL] Database: extra index (api_tokens/token_hash)
[FAIL] Database: missing index (applications/applications_device_id_app_type_unique)
[FAIL] Database: extra index (applications/unique_index)
[FAIL] Database: incorrect column (application_metrics/metric)
[FAIL] Database: missing index (application_metrics/application_metrics_app_id_metric_unique)
[FAIL] Database: extra index (application_metrics/application_metrics_app_id_metric_uindex)
[FAIL] Database: missing table (availability)
[FAIL] Database: missing column (bgpPeers/bgpPeerLastErrorCode)
[FAIL] Database: missing column (bgpPeers/bgpPeerLastErrorSubCode)
[FAIL] Database: missing column (bgpPeers/bgpPeerLastErrorText)
[FAIL] Database: missing index (bgpPeers/bgppeers_device_id_context_name_index)
[FAIL] Database: extra index (bgpPeers/device_id)
[FAIL] Database: missing index (bgpPeers_cbgp/bgppeers_cbgp_device_id_bgppeeridentifier_afi_safi_unique)
[FAIL] Database: missing index (bgpPeers_cbgp/bgppeers_cbgp_device_id_bgppeeridentifier_context_name_index)
[FAIL] Database: extra index (bgpPeers_cbgp/device_id)
[FAIL] Database: extra index (bgpPeers_cbgp/unique_index)
[FAIL] Database: missing index (bill_data/bill_data_bill_id_index)
[FAIL] Database: extra index (bill_data/bill_id)
[FAIL] Database: missing index (bill_history/bill_history_bill_id_bill_datefrom_bill_dateto_unique)
[FAIL] Database: missing index (bill_history/bill_history_bill_id_index)
[FAIL] Database: extra index (bill_history/bill_id)
[FAIL] Database: extra index (bill_history/unique_index)
[FAIL] Database: missing column (bill_perms/id)
[FAIL] Database: missing column (bill_ports/id)
[FAIL] Database: missing table (cache)
[FAIL] Database: missing table (cache_locks)
[FAIL] Database: missing index (cef_switching/cef_switching_device_id_entphysicalindex_afi_cef_index_unique)
[FAIL] Database: extra index (cef_switching/device_id)
[FAIL] Database: missing index (ciscoASA/ciscoasa_device_id_index)
[FAIL] Database: extra index (ciscoASA/device_id)
[FAIL] Database: missing index (component/component_device_id_index)
[FAIL] Database: missing index (component/component_type_index)
[FAIL] Database: extra index (component/device)
[FAIL] Database: extra index (component/type)
[FAIL] Database: missing index (component_prefs/component_prefs_component_index)
[FAIL] Database: extra index (component_prefs/component)
[FAIL] Database: missing index (component_statuslog/component_statuslog_component_id_index)
[FAIL] Database: extra index (component_statuslog/device)
[FAIL] Database: extra column (config/config_default)
[FAIL] Database: extra column (config/config_descr)
[FAIL] Database: extra column (config/config_group)
[FAIL] Database: extra column (config/config_group_order)
[FAIL] Database: extra column (config/config_sub_group)
[FAIL] Database: extra column (config/config_sub_group_order)
[FAIL] Database: extra column (config/config_hidden)
[FAIL] Database: extra column (config/config_disabled)
[FAIL] Database: missing index (config/config_config_name_unique)
[FAIL] Database: extra index (config/uniqueindex_configname)
[FAIL] Database: missing index (customers/customers_username_unique)
[FAIL] Database: extra index (customers/username)
[FAIL] Database: missing table (customoids)
[FAIL] Database: incorrect column (devices/inserted)
[FAIL] Database: missing column (devices/overwrite_ip)
[FAIL] Database: incorrect column (devices/authalgo)
[FAIL] Database: incorrect column (devices/cryptoalgo)
[FAIL] Database: missing column (devices/disable_notify)
[FAIL] Database: missing index (devices/devices_hostname_index)
[FAIL] Database: missing index (devices/devices_last_poll_attempted_index)
[FAIL] Database: missing index (devices/devices_last_polled_index)
[FAIL] Database: missing index (devices/devices_os_index)
[FAIL] Database: missing index (devices/devices_status_index)
[FAIL] Database: missing index (devices/devices_sysname_index)
[FAIL] Database: extra index (devices/hostname)
[FAIL] Database: extra index (devices/last_poll_attempted)
[FAIL] Database: extra index (devices/last_polled)
[FAIL] Database: extra index (devices/os)
[FAIL] Database: extra index (devices/status)
[FAIL] Database: extra index (devices/sysName)
[FAIL] Database: missing index (devices_attribs/devices_attribs_device_id_index)
[FAIL] Database: extra index (devices_attribs/device_id)
[FAIL] Database: missing table (devices_group_perms)
[FAIL] Database: missing column (devices_perms/id)
[FAIL] Database: missing index (devices_perms/devices_perms_user_id_index)
[FAIL] Database: extra index (devices_perms/user_id)
[FAIL] Database: missing column (device_graphs/id)
[FAIL] Database: missing index (device_graphs/device_graphs_device_id_index)
[FAIL] Database: extra index (device_graphs/device_id)
[FAIL] Database: incorrect column (device_groups/desc)
[FAIL] Database: missing column (device_groups/type)
[FAIL] Database: missing column (device_groups/rules)
[FAIL] Database: extra column (device_groups/params)
[FAIL] Database: missing index (device_groups/device_groups_name_unique)
[FAIL] Database: extra index (device_groups/name)
[FAIL] Database: missing table (device_outages)
[FAIL] Database: missing index (device_perf/device_perf_device_id_index)
[FAIL] Database: missing index (device_perf/device_perf_device_id_timestamp_index)
[FAIL] Database: extra index (device_perf/device_id)
[FAIL] Database: missing index (device_relationships/device_relationships_child_device_id_index)
[FAIL] Database: extra index (device_relationships/device_relationship_child_device_id_fk)
[FAIL] Database: missing index (entityState/entitystate_device_id_index)
[FAIL] Database: extra index (entityState/entityState_device_id_index)
[FAIL] Database: missing index (entPhysical/entphysical_device_id_index)
[FAIL] Database: extra index (entPhysical/device_id)
[FAIL] Database: missing column (entPhysical_state/id)
[FAIL] Database: missing index (eventlog/eventlog_datetime_index)
[FAIL] Database: missing index (eventlog/eventlog_device_id_index)
[FAIL] Database: extra index (eventlog/datetime)
[FAIL] Database: extra index (eventlog/device_id)
[FAIL] Database: missing index (graph_types/graph_types_graph_section_index)
[FAIL] Database: missing index (graph_types/graph_types_graph_subtype_index)
[FAIL] Database: missing index (graph_types/graph_types_graph_type_index)
[FAIL] Database: extra index (graph_types/graph_section)
[FAIL] Database: extra index (graph_types/graph_subtype)
[FAIL] Database: extra index (graph_types/graph_type)
[FAIL] Database: missing index (hrDevice/hrdevice_device_id_index)
[FAIL] Database: extra index (hrDevice/device_id)
[FAIL] Database: missing index (ipsec_tunnels/ipsec_tunnels_device_id_peer_addr_unique)
[FAIL] Database: extra index (ipsec_tunnels/unique_index)
[FAIL] Database: missing index (ipv4_addresses/ipv4_addresses_port_id_index)
[FAIL] Database: extra index (ipv4_addresses/interface_id)
[FAIL] Database: missing column (ipv4_mac/id)
[FAIL] Database: missing index (ipv4_mac/ipv4_mac_mac_address_index)
[FAIL] Database: missing index (ipv4_mac/ipv4_mac_port_id_index)
[FAIL] Database: extra index (ipv4_mac/mac_address)
[FAIL] Database: extra index (ipv4_mac/port_id)
[FAIL] Database: missing index (ipv6_addresses/ipv6_addresses_port_id_index)
[FAIL] Database: extra index (ipv6_addresses/interface_id)
[FAIL] Database: missing column (juniAtmVp/id)
[FAIL] Database: missing index (juniAtmVp/juniatmvp_port_id_index)
[FAIL] Database: extra index (juniAtmVp/port_id)
[FAIL] Database: missing index (links/links_local_port_id_index)
[FAIL] Database: missing index (links/links_remote_port_id_index)
[FAIL] Database: extra index (links/dst_if)
[FAIL] Database: extra index (links/src_if)
[FAIL] Database: missing column (loadbalancer_vservers/id)
[FAIL] Database: missing index (loadbalancer_vservers/loadbalancer_vservers_device_id_index)
[FAIL] Database: extra index (loadbalancer_vservers/device_id)
[FAIL] Database: missing index (locations/locations_location_unique)
[FAIL] Database: extra index (locations/locations_location_uindex)
[FAIL] Database: missing index (mac_accounting/mac_accounting_port_id_index)
[FAIL] Database: extra index (mac_accounting/interface_id)
[FAIL] Database: extra index (mac_accounting/interface_id_2)
[FAIL] Database: missing index (mefinfo/mefinfo_device_id_index)
[FAIL] Database: missing index (mefinfo/mefinfo_mefid_index)
[FAIL] Database: extra index (mefinfo/device_id)
[FAIL] Database: extra index (mefinfo/mefID)
[FAIL] Database: incorrect column (mempools/mempool_perc_warn)
[FAIL] Database: missing index (mempools/mempools_device_id_index)
[FAIL] Database: extra index (mempools/device_id)
[FAIL] Database: missing table (mpls_lsps)
[FAIL] Database: missing table (mpls_lsp_paths)
[FAIL] Database: missing table (mpls_saps)
[FAIL] Database: missing table (mpls_sdps)
[FAIL] Database: missing table (mpls_sdp_binds)
[FAIL] Database: missing table (mpls_services)
[FAIL] Database: missing table (mpls_tunnel_ar_hops)
[FAIL] Database: missing table (mpls_tunnel_c_hops)
[FAIL] Database: missing index (munin_plugins/munin_plugins_device_id_index)
[FAIL] Database: missing index (munin_plugins/munin_plugins_device_id_mplug_type_unique)
[FAIL] Database: extra index (munin_plugins/UNIQUE)
[FAIL] Database: extra index (munin_plugins/device_id)
[FAIL] Database: missing index (munin_plugins_ds/munin_plugins_ds_mplug_id_ds_name_unique)
[FAIL] Database: extra index (munin_plugins_ds/splug_id)
[FAIL] Database: missing index (notifications/notifications_checksum_unique)
[FAIL] Database: extra index (notifications/checksum)
[FAIL] Database: missing index (notifications_attribs/notifications_attribs_notifications_id_user_id_index)
[FAIL] Database: incorrect column (ospf_areas/ospfAuthType)
[FAIL] Database: missing index (ospf_areas/ospf_areas_device_id_ospfareaid_context_name_unique)
[FAIL] Database: extra index (ospf_areas/device_area)
[FAIL] Database: missing index (ospf_instances/ospf_instances_device_id_ospf_instance_id_context_name_unique)
[FAIL] Database: extra index (ospf_instances/device_id)
[FAIL] Database: missing index (ospf_nbrs/ospf_nbrs_device_id_ospf_nbr_id_context_name_unique)
[FAIL] Database: extra index (ospf_nbrs/device_id)
[FAIL] Database: missing index (ospf_ports/ospf_ports_device_id_ospf_port_id_context_name_unique)
[FAIL] Database: extra index (ospf_ports/device_id)
[FAIL] Database: missing index (packages/packages_device_id_index)
[FAIL] Database: missing index (packages/packages_device_id_name_manager_arch_version_build_unique)
[FAIL] Database: extra index (packages/device_id)
[FAIL] Database: extra index (packages/unique_key)
[FAIL] Database: missing index (perf_times/perf_times_type_index)
[FAIL] Database: extra index (perf_times/type)
[FAIL] Database: incorrect index (pollers/PRIMARY)
[FAIL] Database: missing index (pollers/pollers_poller_name_unique)
[FAIL] Database: extra index (pollers/id)
[FAIL] Database: extra index (pollers/poller_name)
[FAIL] Database: missing column (poller_cluster/poller_enabled)
[FAIL] Database: missing column (poller_cluster/poller_frequency)
[FAIL] Database: missing column (poller_cluster/poller_workers)
[FAIL] Database: missing column (poller_cluster/poller_down_retry)
[FAIL] Database: missing column (poller_cluster/discovery_enabled)
[FAIL] Database: missing column (poller_cluster/discovery_frequency)
[FAIL] Database: missing column (poller_cluster/discovery_workers)
[FAIL] Database: missing column (poller_cluster/services_enabled)
[FAIL] Database: missing column (poller_cluster/services_frequency)
[FAIL] Database: missing column (poller_cluster/services_workers)
[FAIL] Database: missing column (poller_cluster/billing_enabled)
[FAIL] Database: missing column (poller_cluster/billing_frequency)
[FAIL] Database: missing column (poller_cluster/billing_calculate_frequency)
[FAIL] Database: missing column (poller_cluster/alerting_enabled)
[FAIL] Database: missing column (poller_cluster/alerting_frequency)
[FAIL] Database: missing column (poller_cluster/ping_enabled)
[FAIL] Database: missing column (poller_cluster/ping_frequency)
[FAIL] Database: missing column (poller_cluster/update_enabled)
[FAIL] Database: missing column (poller_cluster/update_frequency)
[FAIL] Database: missing column (poller_cluster/loglevel)
[FAIL] Database: missing column (poller_cluster/watchdog_enabled)
[FAIL] Database: missing column (poller_cluster/watchdog_log)
[FAIL] Database: incorrect index (poller_cluster/PRIMARY)
[FAIL] Database: extra index (poller_cluster/id)
[FAIL] Database: incorrect index (poller_cluster_stats/PRIMARY)
[FAIL] Database: missing index (poller_cluster_stats/poller_cluster_stats_parent_poller_poller_type_unique)
[FAIL] Database: extra index (poller_cluster_stats/id)
[FAIL] Database: extra index (poller_cluster_stats/parent_poller_poller_type)
[FAIL] Database: missing column (ports/ifSpeed_prev)
[FAIL] Database: missing column (ports/ifHighSpeed_prev)
[FAIL] Database: missing index (ports/ports_device_id_ifindex_unique)
[FAIL] Database: missing index (ports/ports_ifdescr_index)
[FAIL] Database: extra index (ports/device_ifIndex)
[FAIL] Database: extra index (ports/if_2)
[FAIL] Database: missing index (ports_adsl/ports_adsl_port_id_unique)
[FAIL] Database: extra index (ports_adsl/interface_id)
[FAIL] Database: missing index (ports_fdb/ports_fdb_mac_address_index)
[FAIL] Database: extra index (ports_fdb/mac_address)
[FAIL] Database: missing column (ports_perms/id)
[FAIL] Database: missing index (ports_stack/ports_stack_device_id_port_id_high_port_id_low_unique)
[FAIL] Database: extra index (ports_stack/device_id)
[FAIL] Database: missing index (ports_stp/ports_stp_device_id_port_id_unique)
[FAIL] Database: extra index (ports_stp/device_id)
[FAIL] Database: missing index (ports_vlans/ports_vlans_device_id_port_id_vlan_unique)
[FAIL] Database: extra index (ports_vlans/unique)
[FAIL] Database: missing column (processes/id)
[FAIL] Database: missing index (processes/processes_device_id_index)
[FAIL] Database: extra index (processes/device_id)
[FAIL] Database: missing index (processors/processors_device_id_index)
[FAIL] Database: extra index (processors/device_id)
[FAIL] Database: missing index (proxmox/proxmox_cluster_vmid_unique)
[FAIL] Database: extra index (proxmox/cluster_vm)
[FAIL] Database: missing index (proxmox_ports/proxmox_ports_vm_id_port_unique)
[FAIL] Database: extra index (proxmox_ports/vm_port)
[FAIL] Database: missing column (route/route_id)
[FAIL] Database: incorrect column (route/created_at)
[FAIL] Database: incorrect column (route/updated_at)
[FAIL] Database: missing column (route/port_id)
[FAIL] Database: incorrect column (route/context_name)
[FAIL] Database: missing column (route/inetCidrRouteIfIndex)
[FAIL] Database: missing column (route/inetCidrRouteType)
[FAIL] Database: missing column (route/inetCidrRouteProto)
[FAIL] Database: missing column (route/inetCidrRouteNextHopAS)
[FAIL] Database: missing column (route/inetCidrRouteMetric1)
[FAIL] Database: missing column (route/inetCidrRouteDestType)
[FAIL] Database: missing column (route/inetCidrRouteDest)
[FAIL] Database: missing column (route/inetCidrRouteNextHopType)
[FAIL] Database: missing column (route/inetCidrRouteNextHop)
[FAIL] Database: missing column (route/inetCidrRoutePolicy)
[FAIL] Database: missing column (route/inetCidrRoutePfxLen)
[FAIL] Database: extra column (route/ipRouteDest)
[FAIL] Database: extra column (route/ipRouteIfIndex)
[FAIL] Database: extra column (route/ipRouteMetric)
[FAIL] Database: extra column (route/ipRouteNextHop)
[FAIL] Database: extra column (route/ipRouteType)
[FAIL] Database: extra column (route/ipRouteProto)
[FAIL] Database: extra column (route/discoveredAt)
[FAIL] Database: extra column (route/ipRouteMask)
[FAIL] Database: extra index (route/device)
[FAIL] Database: incorrect column (sensors/sensor_id)
[FAIL] Database: missing index (sensors/sensors_device_id_index)
[FAIL] Database: missing index (sensors/sensors_sensor_class_index)
[FAIL] Database: missing index (sensors/sensors_sensor_type_index)
[FAIL] Database: extra index (sensors/sensor_class)
[FAIL] Database: extra index (sensors/sensor_host)
[FAIL] Database: extra index (sensors/sensor_type)
[FAIL] Database: incorrect column (sensors_to_state_indexes/sensor_id)
[FAIL] Database: incorrect column (sensors_to_state_indexes/state_index_id)
[FAIL] Database: missing index (sensors_to_state_indexes/sensors_to_state_indexes_sensor_id_state_index_id_unique)
[FAIL] Database: missing index (sensors_to_state_indexes/sensors_to_state_indexes_state_index_id_index)
[FAIL] Database: extra index (sensors_to_state_indexes/sensor_id_state_index_id)
[FAIL] Database: extra index (sensors_to_state_indexes/state_index_id)
[FAIL] Database: missing index (services/services_device_id_index)
[FAIL] Database: extra index (services/service_host)
[FAIL] Database: missing index (session/session_session_value_unique)
[FAIL] Database: extra index (session/session_value)
[FAIL] Database: missing index (slas/slas_device_id_index)
[FAIL] Database: missing index (slas/slas_device_id_sla_nr_unique)
[FAIL] Database: extra index (slas/device_id)
[FAIL] Database: extra index (slas/unique_key)
[FAIL] Database: incorrect column (state_indexes/state_index_id)
[FAIL] Database: missing index (state_indexes/state_indexes_state_name_unique)
[FAIL] Database: extra index (state_indexes/state_name)
[FAIL] Database: missing index (state_translations/state_translations_state_index_id_state_value_unique)
[FAIL] Database: extra index (state_translations/state_index_id_value)
[FAIL] Database: missing index (storage/storage_device_id_index)
[FAIL] Database: missing index (storage/storage_device_id_storage_mib_storage_index_unique)
[FAIL] Database: extra index (storage/device_id)
[FAIL] Database: extra index (storage/index_unique)
[FAIL] Database: missing index (stp/stp_device_id_index)
[FAIL] Database: extra index (stp/stp_host)
[FAIL] Database: missing index (syslog/syslog_device_id_index)
[FAIL] Database: missing index (syslog/syslog_device_id_timestamp_index)
[FAIL] Database: missing index (syslog/syslog_priority_level_index)
[FAIL] Database: missing index (syslog/syslog_program_index)
[FAIL] Database: missing index (syslog/syslog_timestamp_index)
[FAIL] Database: extra index (syslog/datetime)
[FAIL] Database: extra index (syslog/device_id)
[FAIL] Database: extra index (syslog/device_id-timestamp)
[FAIL] Database: extra index (syslog/priority_level)
[FAIL] Database: extra index (syslog/program)
[FAIL] Database: missing index (tnmsneinfo/tnmsneinfo_device_id_index)
[FAIL] Database: missing index (tnmsneinfo/tnmsneinfo_neid_index)
[FAIL] Database: extra index (tnmsneinfo/device_id)
[FAIL] Database: extra index (tnmsneinfo/neID)
[FAIL] Database: missing index (toner/toner_device_id_index)
[FAIL] Database: extra index (toner/device_id)
[FAIL] Database: missing column (transport_group_transport/id)
[FAIL] Database: missing index (ucd_diskio/ucd_diskio_device_id_index)
[FAIL] Database: extra index (ucd_diskio/device_id)
[FAIL] Database: missing column (users/enabled)
[FAIL] Database: missing index (users/users_auth_type_username_unique)
[FAIL] Database: extra index (users/username)
[FAIL] Database: missing index (vminfo/vminfo_device_id_index)
[FAIL] Database: missing index (vminfo/vminfo_vmwvmvmid_index)
[FAIL] Database: extra index (vminfo/device_id)
[FAIL] Database: extra index (vminfo/vmwVmVMID)
[FAIL] Database: missing index (vrfs/vrfs_device_id_index)
[FAIL] Database: extra index (vrfs/device_id)
[FAIL] Database: missing index (vrf_lite_cisco/vrf_lite_cisco_context_name_index)
[FAIL] Database: missing index (vrf_lite_cisco/vrf_lite_cisco_device_id_context_name_vrf_name_index)
[FAIL] Database: missing index (vrf_lite_cisco/vrf_lite_cisco_device_id_index)
[FAIL] Database: missing index (vrf_lite_cisco/vrf_lite_cisco_vrf_name_index)
[FAIL] Database: extra index (vrf_lite_cisco/context)
[FAIL] Database: extra index (vrf_lite_cisco/device)
[FAIL] Database: extra index (vrf_lite_cisco/mix)
[FAIL] Database: extra index (vrf_lite_cisco/vrf)
[FAIL] Database: missing index (widgets/widgets_widget_unique)
[FAIL] Database: extra index (widgets/widget)
[FAIL] Database: missing index (wireless_sensors/wireless_sensors_device_id_index)
[FAIL] Database: missing index (wireless_sensors/wireless_sensors_sensor_class_index)
[FAIL] Database: missing index (wireless_sensors/wireless_sensors_sensor_type_index)
[FAIL] Database: extra index (wireless_sensors/sensor_class)
[FAIL] Database: extra index (wireless_sensors/sensor_host)
[FAIL] Database: extra index (wireless_sensors/sensor_type)
[FAIL] Database: extra table (device_mibs)
[FAIL] Database: extra table (device_oids)
[FAIL] Database: extra table (mibdefs)
[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 access_points DROP INDEX deleted;
ALTER TABLE access_points ADD INDEX access_points_deleted_index (deleted);
ALTER TABLE alerts CHANGE timestamp timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ;
ALTER TABLE alerts DROP INDEX device_id;
ALTER TABLE alerts DROP INDEX rule_id;
ALTER TABLE alerts DROP INDEX unique_alert;
ALTER TABLE alerts ADD INDEX alerts_device_id_index (device_id);
ALTER TABLE alerts ADD UNIQUE alerts_device_id_rule_id_unique (device_id,rule_id);
ALTER TABLE alerts ADD INDEX alerts_rule_id_index (rule_id);
ALTER TABLE alert_device_map DROP INDEX alert_device_map_rule_id_device_id_uindex;
ALTER TABLE alert_device_map ADD UNIQUE alert_device_map_rule_id_device_id_unique (rule_id,device_id);
ALTER TABLE alert_group_map DROP INDEX alert_group_map_rule_id_group_id_uindex;
ALTER TABLE alert_group_map ADD UNIQUE alert_group_map_rule_id_group_id_unique (rule_id,group_id);
CREATE TABLE alert_location_map (id int unsigned NOT NULL auto_increment, rule_id int unsigned NOT NULL , location_id int unsigned NOT NULL , PRIMARY KEY (id), UNIQUE alert_location_map_rule_id_location_id_uindex (rule_id,location_id));
ALTER TABLE alert_log DROP INDEX device_id;
and 350 more…
[WARN] Global lnms shortcut not installed. lnms command must be run with full path
[FIX]:
sudo ln -s /opt/librenms/lnms /usr/local/bin/lnms
[WARN] Bash completion not installed. lnms command tab completion unavailable.
[FIX]:
sudo cp /opt/librenms/misc/lnms-completion.bash /etc/bash_completion.d/
[WARN] Your local git contains modified files, this could prevent automatic updates.
[FIX]:
You can fix this with ./scripts/github-remove
Modified Files:
logs/.gitignore

Any help would be appreciated.

Your installation doesn’t look healthy.
Maybe try

./scripts/composer_wrapper.php install --no-dev
php artisan optimize:clear
php artisan migrate

I just remembered that previously when I entered all the SQL commands I was missing the php-fpm module. After re-entering in all those recommended SQL commands its all happy again. However, there are still a few SQL statements that give me errors when I got to enter them:

[email protected]:~$ ./validate.php

Component Version
LibreNMS 1.70.1
DB Schema 2020_11_02_164331_add_powerstate_enum_to_vminfo (191)
PHP 7.4.3
Python 3.8.5
MySQL 10.3.25-MariaDB-0ubuntu0.20.04.1
RRDTool 1.7.2
SNMP NET-SNMP 5.8
OpenSSL

====================================

[OK] Composer Version: 2.0.8
[OK] Dependencies up-to-date.
[OK] Database connection successful
[FAIL] Database: incorrect column (devices/inserted)
[FAIL] Database: incorrect index (pollers/PRIMARY)
[FAIL] Database: extra index (pollers/id)
[FAIL] Database: incorrect index (poller_cluster/PRIMARY)
[FAIL] Database: extra index (poller_cluster/id)
[FAIL] Database: incorrect index (poller_cluster_stats/PRIMARY)
[FAIL] Database: extra index (poller_cluster_stats/id)
[FAIL] Database: incorrect column (route/created_at)
[FAIL] Database: incorrect column (route/updated_at)
[FAIL] Database: incorrect column (sensors/sensor_id)
[FAIL] Database: incorrect column (sensors_to_state_indexes/sensor_id)
[FAIL] Database: incorrect column (sensors_to_state_indexes/state_index_id)
[FAIL] Database: incorrect column (state_indexes/state_index_id)
[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 devices CHANGE inserted inserted timestamp NULL DEFAULT CURRENT_TIMESTAMP ;
ALTER TABLE pollers DROP INDEX id;
ALTER TABLE pollers DROP INDEX PRIMARY, PRIMARY KEY (id);
ALTER TABLE poller_cluster DROP INDEX id;
ALTER TABLE poller_cluster DROP INDEX PRIMARY, PRIMARY KEY (id);
ALTER TABLE poller_cluster_stats DROP INDEX id;
ALTER TABLE poller_cluster_stats DROP INDEX PRIMARY, PRIMARY KEY (id);
ALTER TABLE route CHANGE created_at created_at timestamp NULL ;
ALTER TABLE route CHANGE updated_at updated_at timestamp NULL ;
ALTER TABLE sensors CHANGE sensor_id sensor_id int unsigned NOT NULL auto_increment;
ALTER TABLE sensors_to_state_indexes CHANGE sensor_id sensor_id int unsigned NOT NULL ;
ALTER TABLE sensors_to_state_indexes CHANGE state_index_id state_index_id int unsigned NOT NULL ;
ALTER TABLE state_indexes CHANGE state_index_id state_index_id int unsigned NOT NULL auto_increment;
[WARN] Your local git contains modified files, this could prevent automatic updates.
[FIX]:
You can fix this with ./scripts/github-remove
Modified Files:
logs/.gitignore

Here are the SQL errors I get when entering in the suggested fixes.

MariaDB [librenms]> ALTER TABLE devices CHANGE inserted inserted timestamp NULL DEFAULT CURRENT_TIMESTAMP ;

ERROR 1054 (42S22): Unknown column ‘inserted’ in ‘devices’

MariaDB [librenms]> ALTER TABLE pollers DROP INDEX id;

ERROR 1075 (42000): Incorrect table definition; there can be only one auto column and it must be defined as a key

MariaDB [librenms]> ALTER TABLE pollers DROP INDEX PRIMARY, PRIMARY KEY (id);

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘PRIMARY KEY (id)’ at line 1

MariaDB [librenms]> ALTER TABLE poller_cluster DROP INDEX id;

ERROR 1075 (42000): Incorrect table definition; there can be only one auto column and it must be defined as a key

MariaDB [librenms]> ALTER TABLE poller_cluster DROP INDEX PRIMARY, PRIMARY KEY (id);

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘PRIMARY KEY (id)’ at line 1

MariaDB [librenms]> ALTER TABLE poller_cluster_stats DROP INDEX id;

ERROR 1075 (42000): Incorrect table definition; there can be only one auto column and it must be defined as a key

MariaDB [librenms]> ALTER TABLE poller_cluster_stats DROP INDEX PRIMARY, PRIMARY KEY (id);

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘PRIMARY KEY (id)’ at line 1

MariaDB [librenms]> ALTER TABLE route CHANGE created_at created_at timestamp NULL ;

ERROR 1054 (42S22): Unknown column ‘created_at’ in ‘route’

MariaDB [librenms]> ALTER TABLE route CHANGE updated_at updated_at timestamp NULL ;

ERROR 1054 (42S22): Unknown column ‘updated_at’ in ‘route’

MariaDB [librenms]> ALTER TABLE sensors CHANGE sensor_id sensor_id int unsigned NOT NULL auto_increment;

ERROR 1833 (HY000): Cannot change column ‘sensor_id’: used in a foreign key constraint ‘sensors_to_state_indexes_sensor_id_foreign’ of table ‘librenms.sensors_to_state_indexes’

MariaDB [librenms]> ALTER TABLE sensors_to_state_indexes CHANGE sensor_id sensor_id int unsigned NOT NULL ;

ERROR 1832 (HY000): Cannot change column ‘sensor_id’: used in a foreign key constraint ‘sensors_to_state_indexes_sensor_id_foreign’

MariaDB [librenms]> ALTER TABLE sensors_to_state_indexes CHANGE state_index_id state_index_id int unsigned NOT NULL ;

ERROR 1832 (HY000): Cannot change column ‘state_index_id’: used in a foreign key constraint ‘sensors_to_state_indexes_ibfk_1’

MariaDB [librenms]> ALTER TABLE state_indexes CHANGE state_index_id state_index_id int unsigned NOT NULL auto_increment;

ERROR 1833 (HY000): Cannot change column ‘state_index_id’: used in a foreign key constraint ‘sensors_to_state_indexes_ibfk_1’ of table ‘librenms.sensors_to_state_indexes’

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