I cant access libreNMS web

i got error

Whoops, looks like something went wrong. Check your librenms.log.

and when i try to validate i get

-bash-4.2$ ./validate.php

Component Version
LibreNMS 21.5.1-32-g20c44b8
DB Schema 2020_12_14_091314_create_port_group_port_table (205)
PHP 7.4.13
Python 3.6.8
MySQL 5.5.68-MariaDB
RRDTool 1.4.8
SNMP NET-SNMP 5.7.2
====================================

[OK] Composer Version: 2.1.2
[OK] Dependencies up-to-date.
[OK] Database connection successful
[FAIL] MariaDB version 10.2.2 is the minimum supported version as of March, 2021. Update MariaDB to a supported version 10.5 suggested).
[FAIL] Your database is out of date!
[FIX]:
./lnms migrate
[WARN] IPv6 is disabled on your server, you will not be able to add IPv6 devices.
[WARN] Global lnms shortcut not installed. lnms command must be run with full path
[FIX]:
sudo ln -s /opt/librenms/lnms /usr/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:
rrd/.gitignore
-bash-4.2$ ./lnms migrate


  • Application In Production!     *
    

Do you really wish to run this command? (yes/no) [no]:

yes

Migrating: 2020_12_14_091314_create_port_groups_table

In Connection.php line 678:

SQLSTATE[42S01]: Base table or view already exists: 1050 Table ‘port_groups’ already exists (SQL: create table port_groups (id int unsigned not null auto_increment primary key, name varchar(255) not null, desc varchar(255) null) default character set utf8mb4
collate ‘utf8mb4_unicode_ci’)

In Exception.php line 18:

SQLSTATE[42S01]: Base table or view already exists: 1050 Table ‘port_groups’ already exists

In PDOStatement.php line 112:

SQLSTATE[42S01]: Base table or view already exists: 1050 Table ‘port_groups’ already exists

-bash-4.2$ ./daily.sh
Updating to latest codebase OK
Updating Composer packages OK
Updating SQL-Schema OK
Updating submodules OK
Cleaning up DB OK
Fetching notifications OK
Caching PeeringDB data OK
Caching Mac OUI data OK

log showing me

[2021-06-14 19:05:21] production.ERROR: InfluxDB exception: HTTP Code 500 {“error”:“[shard 977] open /var/lib/influxdb/wal/uptimemonitor/autogen/977/_00010.wal: permission denied”}

When i use watch and try to login and get whoops page this is log

Every 2.0s: tail -n 15 librenms.log Mon Jun 14 19:36:43 2021

#85 /opt/librenms/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle(Object(Illuminate\Http\Request), Object(Closure))
#86 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#87 /opt/librenms/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle(Object(Illuminate\Http\Request), Object(Closure))
#88 /opt/librenms/vendor/fruitcake/laravel-cors/src/HandleCors.php(37): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#89 /opt/librenms/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fruitcake\Cors\HandleCors->handle(Object(Illuminate\Http\Request), Object(Closure))
#90 /opt/librenms/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#91 /opt/librenms/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fideloper\Proxy\TrustProxies->handle(Object(Illuminate\Http\Request), Object(Closure))
#92 /opt/librenms/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#93 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(141): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#94 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(110): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#95 /opt/librenms/html/index.php(52): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#96 {main}
"}
/opt/librenms/poller.php 86 2021-06-14 19:36:06 - 1 devices polled in 7.881 secs
/opt/librenms/poller.php 104 2021-06-14 19:36:18 - 1 devices polled in 75.59 secs

i solve:
first update database to 10.1 and then from 10.1 to 10.3

after that:
su - librenms
mysql -u librenms -p
use librenms;
SET FOREIGN_KEY_CHECKS = 0;
drop table port_group_port;
drop table port_groups;
SET FOREIGN_KEY_CHECKS = 1;
quit;
su - librenms
./lnms migrate

here i get a problem like this

Migrating: 2020_12_14_091314_create_port_groups_table
Migrated: 2020_12_14_091314_create_port_groups_table (17.13ms)
Migrating: 2021_02_09_122930_migrate_to_utf8mb4
Migrated: 2021_02_09_122930_migrate_to_utf8mb4 (28,452.25ms)
Migrating: 2021_04_08_151101_add_foreign_keys_to_port_group_port_table

In Connection.php line 678:

SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘librenms.port_group_port’ doesn’t exist (SQL: alter table port_group_port add constraint port_group_port_port_group_id_foreign foreign key (port_group_id) references port_groups (id) on delete CASC
ADE)

In Exception.php line 18:

SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘librenms.port_group_port’ doesn’t exist

In PDOStatement.php line 112:

SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘librenms.port_group_port’ doesn’t exist

but i recreate it
CREATE TABLE port_group_port (
port_group_id int(10) unsigned NOT NULL,
port_id int(10) unsigned NOT NULL,
PRIMARY KEY (port_group_id,port_id),
KEY port_group_port_port_group_id_index (port_group_id),
KEY port_group_port_port_id_index (port_id),
CONSTRAINT port_group_port_port_group_id_foreign FOREIGN KEY (port_group_id) REFERENCES port_groups (id) ON DELETE CASCADE,
CONSTRAINT port_group_port_port_id_foreign FOREIGN KEY (port_id) REFERENCES ports (port_id) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

and than again
./lnms migrate

I HOPE I HELPED SOMEONE!

I get this output when I try to use your solution. Would you be able to tell me what is wrong?

ERROR 1005 (HY000): Can't create table librenmsdb1.port_group_port (errno: 150 "Foreign key constraint is incorrectly formed")

Nevermind, found the solution here: Error port device - #29 by tigerdjohnson

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