Sql errors - Please Help

Tags: #<Tag:0x00007fd88883acd0> #<Tag:0x00007fd88883aaf0> #<Tag:0x00007fd88883a960>

can anyone help me out on the below error

[email protected]:~$ ./daily.sh
Fetching new release information OK
Updating to latest release OK
Updating Composer packages OK
Updating SQL-Schema OK
Updating submodules OK
Cleaning up DB OK
Fetching notifications OK
Caching PeeringDB data OK

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

Component Version
LibreNMS 21.4.0
DB Schema 2020_12_14_091314_create_port_group_port_table (202)
PHP 7.4.5
Python 3.6.9
MySQL 10.5.9-MariaDB-1:10.5.9+maria~bionic
RRDTool 1.7.0
SNMP NET-SNMP 5.7.3

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

[OK] Composer Version: 2.0.13
[OK] Dependencies up-to-date.
[OK] Database connection successful
[FAIL] Your database is out of date!
[FIX]:
./lnms migrate
[email protected]:~$ ./lnms migrate
**

  • Application In Production!     *
    

**

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

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

We eventually solved that one here - see the solution linked under the question:
Error port device

Your DB version is not the issue, so dropping the tables and letting it re-run worked for others.

thank you

i have done that and can get back in the web gui

now i get the following issue

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

y

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_gr
oup_port’ doesn’t exist (SQL: alter table port_group_port add constraint
port_group_port_port_group_id_foreign foreign key (port_group_id) refer
ences port_groups (id) on delete CASCADE)

In Exception.php line 18:

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

In PDOStatement.php line 112:

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

Check post 29 from the same thread for the manual table creation perhaps, though it’s strange that the migrate seems to have continued on - some people hit that issue, but I didn’t:

What’s the output of the lnms migrate after it progressed past 2020_12_14_091314_create_port_group_port_table?

thank you

you have managed to help to resolve this issue :slight_smile:

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