Librenms GUI not working

Hi,

I am getting and error message when trying to access my LibreNMS GUI all of a sudden. I’m not sure if an update did this but it happened on Friday.

It says:

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

Check your log for more details. (librenms.log)

If you need additional help, you can find how to get help at https://docs.librenms.org/Support.

So far, I have stopped and restarted httpd and mariadb, and I updated again with no luck. Does anyone know how to mitigate this and where the librenms.log file is located?

./daily.sh

Re-running /opt/librenms/daily.sh as librenms user
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

./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.16
Python 3.6.8
MySQL 10.5.9-MariaDB
RRDTool 1.4.8
SNMP NET-SNMP 5.7.2

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

[OK] Composer Version: 2.1.3
[OK] Dependencies up-to-date.
[OK] Database connection successful
[FAIL] Your database is out of date!
[FIX]:
./lnms migrate

The .lnms issue has already been here so I’m not sure if this is now causing me new issues. I can’t get the database commands to work once I run ./lnms migrate

I seem to have a very similiar problem that popped up over the weekend:

% php validate.php 
====================================
Component | Version
--------- | -------
LibreNMS  | 21.5.1-32-g20c44b85c
DB Schema | 2020_12_14_091314_create_port_group_port_table (205)
PHP       | 7.3.26
Python    | 3.7.9
MySQL     | 5.7.32
RRDTool   | 1.7.2
SNMP      | NET-SNMP 5.9
====================================

[OK]    Composer Version: 2.1.3
[OK]    Dependencies up-to-date.
[OK]    Database connection successful
[FAIL]  Your database is out of date!

However:

 % php lnms migrate
[...]
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 nu  
  ll 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                                                             

So apparently database migration steps where applied but the version parameter not increased?
Is it possible to manually bump the version parameter in the dbSchema table to skip migration steps?

Same thing here. Came in end of week last with the same problem. When I run ./lnms migrate I get this:
-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 p ort_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$

I found a fix after combing through a few threads.

My main error was that the port_groups table was already created and ./lnms migrate was trying to recreate it. So I needed to delete that table before re-running lnms migrate.
I signed into my librenms database then ran DROP TABLE port_groups;
This removed the table, I re-ran ./lnms migrate and ./validate.php and my GUI was working again and the database migration has completed successfully.

1 Like

Hi Ayeisha_Bean this worked for me. Thanks!

1 Like

Many thanks Ayeisha.
That solved my problem as well, and the GUI is back to life.

regards

1 Like

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