Table 'librenms.locations' doesn't exist

unable to complete the ./lnms upgrade due to missing table ‘librenms.locations’

Any thoughts?
Thank you.

--------------------./lnms migrate-------------------------

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

yes

Migrating: 2021_02_21_203415_location_add_fixed_coordinates_flag

In Connection.php line 703:

SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘librenms.locations’ doesn’t exist (SQL: alter table locations add fixed_coordinates tinyint(1) not n
ull default ‘0’)

In Exception.php line 18:

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

In PDOStatement.php line 117:

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

------------------------,/validate.php-----------------------------------------

$ ./validate.php

Component Version
LibreNMS 21.9.0-58-g9d92cf19f
DB Schema 2021_02_09_122930_migrate_to_utf8mb4 (204)
PHP 7.4.24
Python 3.6.9
MySQL 10.6.4-MariaDB-1:10.6.4+maria~bionic
RRDTool 1.7.0
SNMP NET-SNMP 5.7.3

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

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

When asking for help and support, please provide as much information as possible. This should include:

  • Steps to reproduce an issue.
  • The output of ./validate.php

If it’s an issue with the WebUI then please consider including a screenshot and the browser version you are using.

If you are having troubles with discovery/polling include the pastebin output of:

./discovery.php -h HOSTNAME -d | ./pbin.sh
./poller.php -h HOSTNAME -r -f -d | ./pbin.sh

If you need to post any text longer than a few lines, please use a pastebin service such as https://p.libren.ms using non-expiring pastes.

Try this:

./lnms tinker --execute="DB::table('migrations')->where('migration', '2018_07_03_091314_create_locations_table')->delete();"
./lnms migrate

Ok, so I finally got back to this. I ran the commands that you suggested and it cleared the missing locations table. It then failed on missing toner table, so I adapted the command and fixed that. Now I am getting the following…

SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name ‘check’ (SQL: ALTER TABLE service_templates CHANGE type check VARCHAR(16) DEFAULT ‘static’ NOT
NULL)

It seems there is more to my misery… Any thoughts?

Thank you.

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