Multiple errors in ./validate.php

Hi Team,

Hope everyone of you and your family members are safe.

I have tried to run the ./daily.sh for an existing server that was installed in our PROD environment. Following are the errors that I see when I run the validate.php. I have tried to follow the links that were suggested for a fix but that didn’t seem to help me as it gave me another error as to why it could not be applied. I will send out the error messages that I got for each of the suggested fix in my next post.

If anyone else has come across such an issue, can you please help me with the deployment. I need to deploy a poller that speaks to this central server and offload some of the compute as this instance is almost at 80% utilization and an almost 100% memory.

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

Component Version
LibreNMS 1.70.1
DB Schema 2020_12_14_091314_create_port_group_port_table (199)
PHP 7.3.25-1+ubuntu18.04.1+deb.sury.org+1
Python 3.6.9
MySQL 10.5.12-MariaDB-1:10.5.12+maria~bionic
RRDTool 1.7.0
SNMP NET-SNMP 5.7.3
OpenSSL

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

[OK] Composer Version: 2.1.6
[OK] Dependencies up-to-date.
[OK] Database connection successful
[WARN] Your database schema has extra migrations (2020_06_24_155119_drop_ports_if_high_speed, 2020_09_18_230114_create_service_templates_device_group_table, 2020_09_18_230114_create_service_templates_device_table, 2020_09_18_230114_create_service_templates_table, 2020_09_18_230114_extend_services_table_for_service_templates_table, 2020_09_19_230114_add_foreign_keys_to_service_templates_device_group_table, 2020_09_19_230114_add_foreign_keys_to_service_templates_device_table, 2020_12_14_091314_create_port_group_port_table). If you just switched to the stable release from the daily release, your database is in between releases and this will be resolved with the next release.
[FAIL] MySQL tables collation is wrong:
[FIX]:
Check http://bit.ly/2lAG9H8 for info on how to fix.
Tables:
service_templates utf8mb4 utf8mb4_unicode_ci
[FAIL] MySQL column collation is wrong:
[FIX]:
Check https://t.libren.ms/-zdwk for info on how to fix.
Columns:
service_templates ip utf8mb4 utf8mb4_unicode_ci
service_templates type utf8mb4 utf8mb4_unicode_ci
service_templates dtype utf8mb4 utf8mb4_unicode_ci
service_templates drules utf8mb4 utf8mb4_unicode_ci
service_templates dgtype utf8mb4 utf8mb4_unicode_ci
service_templates dgrules utf8mb4 utf8mb4_unicode_ci
service_templates desc utf8mb4 utf8mb4_unicode_ci
service_templates param utf8mb4 utf8mb4_unicode_ci
service_templates name utf8mb4 utf8mb4_unicode_ci
[FAIL] Database: missing column (ports/ifHighSpeed)
[FAIL] Database: missing column (ports/ifHighSpeed_prev)
[FAIL] Database: extra table (service_templates)
[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 ports ADD ifHighSpeed int NULL AFTER ifPromiscuousMode;
ALTER TABLE ports ADD ifHighSpeed_prev int NULL AFTER ifHighSpeed;
DROP TABLE service_templates;
[INFO] Detected Python Wrapper
[FAIL] We could not get memcached stats, it is possible that we cannot connect to your memcached server, please check
[FAIL] Missing PHP extension: memcached
[FIX]:
Please install memcached
[WARN] IPv6 is disabled on your server, you will not be able to add IPv6 devices.
[WARN] Your local git contains modified files, this could prevent automatic updates.
[FIX]:
You can fix this with ./scripts/github-remove
Modified Files:
html/images/librenms_logo_blue.svg
html/images/librenms_logo_dark.svg
html/images/librenms_logo_light.svg
html/images/librenms_logo_mono.svg
rrd/.gitignore
[FAIL] We have found some files that are owned by a different user than librenms, this will stop you updating automatically and / or rrd files being updated causing graphs to fail.
[FIX]:
sudo chown -R librenms:librenms /opt/librenms
sudo setfacl -d -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
sudo chmod -R ug=rwX /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/

Files:
/opt/librenms/.mysql_history

=============
Errors with the Fixes applied:

MariaDB [librenms]> ALTER TABLE ports ADD ifHighSpeed int NULL AFTER ifPromiscuousMode;
ERROR 1118 (42000): Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs

MariaDB [librenms]> ALTER TABLE ports ADD ifHighSpeed_prev int NULL AFTER ifHighSpeed;
ERROR 1054 (42S22): Unknown column ‘ifHighSpeed’ in ‘ports’

MariaDB [librenms]> DROP TABLE service_templates;
ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key constraint fails

====================
This is the fix that was suggested for the following error:
[FAIL] MySQL tables collation is wrong:
[FIX]:
Check http://bit.ly/2lAG9H8 for info on how to fix.
Tables:
service_templates_device utf8mb4 utf8mb4_unicode_ci
service_templates_device_group utf8mb4 utf8mb4_unicode_ci
port_group_port utf8mb4 utf8mb4_unicode_ci
service_templates utf8mb4 utf8mb4_unicode_ci
port_groups utf8mb4 utf8mb4_unicode_ci
[FAIL] MySQL column collation is wrong:
[FIX]:
Check https://t.libren.ms/-zdwk for info on how to fix.
Columns:
service_templates ip utf8mb4 utf8mb4_unicode_ci
service_templates type utf8mb4 utf8mb4_unicode_ci
service_templates dtype utf8mb4 utf8mb4_unicode_ci
service_templates drules utf8mb4 utf8mb4_unicode_ci
service_templates dgtype utf8mb4 utf8mb4_unicode_ci
service_templates dgrules utf8mb4 utf8mb4_unicode_ci
service_templates desc utf8mb4 utf8mb4_unicode_ci
service_templates param utf8mb4 utf8mb4_unicode_ci
service_templates name utf8mb4 utf8mb4_unicode_ci
port_groups name utf8mb4 utf8mb4_unicode_ci
port_groups desc utf8mb4 utf8mb4_unicode_ci

But this is the error I got when I tried to apply the command, provided at the weblink:

[email protected]:~# mysql -p -u librenms librenms < /opt/librenms/sql-schema/171.sql
Enter password:
ERROR 1146 (42S02) at line 2: Table ‘librenms.alert_map’ doesn’t exist
[email protected]:~#

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

Hi @nms @Jellyfrog @murrant ,

I request for your help in this regard.

Thanks,
Santosh Kotla

Hi San,

Please do the following:
ssh into your machine
change user to root (sudo su)
go to your LNMS directory (usually /opt/librenms)
change user to librenms (su librenms)
run:
git pull
./daily.sh
./validate.php

and post your validation again.

Good luck

Hi @kalamchi75

I tried a git pull and this is what it gave me.

[email protected]:~$ git pull
error: refs/remotes/origin/HEAD does not point to a valid object!
error: refs/remotes/origin/master does not point to a valid object!
error: refs/remotes/origin/HEAD does not point to a valid object!
error: refs/remotes/origin/master does not point to a valid object!
error: refs/remotes/origin/HEAD does not point to a valid object!
error: refs/remotes/origin/master does not point to a valid object!
error: refs/remotes/origin/HEAD does not point to a valid object!
error: refs/remotes/origin/master does not point to a valid object!
remote: Enumerating objects: 11187, done.
remote: Counting objects: 100% (7277/7277), done.
remote: Compressing objects: 100% (359/359), done.
remote: Total 11187 (delta 7037), reused 7070 (delta 6918), pack-reused 3910
Receiving objects: 100% (11187/11187), 13.94 MiB | 8.44 MiB/s, done.
error: object file .git/objects/e5/8e210672fa49528cb54e2068f28b25ba05cf75 is empty
fatal: cannot read existing object info e58e210672fa49528cb54e2068f28b25ba05cf75
fatal: index-pack failed

Thanks,
Santosh Kotla

You are on a very old version, you must have blocked updates somehow.

first fix permissions sudo chown -R librenms:librenms /opt/librenms
Then try to fix git.

git checkout master
git fetch
git reset --hard origin/master
./daily.sh
./validate.php

Hi Murrant,

This is what I ended up with:

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

[email protected]:~# sudo chown -R librenms:librenms /opt/librenms

[email protected]:~# git checkout master
Checking out files: 100% (6060/6060), done.
M html/images/librenms_logo_blue.svg
M html/images/librenms_logo_dark.svg
M html/images/librenms_logo_light.svg
M html/images/librenms_logo_mono.svg
D rrd/.gitignore
error: refs/remotes/origin/HEAD does not point to a valid object!
error: refs/remotes/origin/master does not point to a valid object!
Previous HEAD position was e2fb7ba63 Fix version compare (#12376)
Switched to branch ‘master’
Your branch is based on ‘origin/master’, but the upstream is gone.
(use “git branch --unset-upstream” to fixup)

[email protected]:~# git fetch
error: refs/remotes/origin/HEAD does not point to a valid object!
error: refs/remotes/origin/master does not point to a valid object!
error: refs/remotes/origin/HEAD does not point to a valid object!
error: refs/remotes/origin/master does not point to a valid object!
error: refs/remotes/origin/HEAD does not point to a valid object!
error: refs/remotes/origin/master does not point to a valid object!
error: refs/remotes/origin/HEAD does not point to a valid object!
error: refs/remotes/origin/master does not point to a valid object!
remote: Enumerating objects: 11187, done.
remote: Counting objects: 100% (7277/7277), done.
remote: Compressing objects: 100% (359/359), done.
remote: Total 11187 (delta 7037), reused 7070 (delta 6918), pack-reused 3910
Receiving objects: 100% (11187/11187), 13.94 MiB | 14.65 MiB/s, done.
error: object file .git/objects/e5/8e210672fa49528cb54e2068f28b25ba05cf75 is empty
fatal: cannot read existing object info e58e210672fa49528cb54e2068f28b25ba05cf75
fatal: index-pack failed

[email protected]:~# git branch --unset-upstream

[email protected]:~# git fetch
error: refs/remotes/origin/HEAD does not point to a valid object!
error: refs/remotes/origin/master does not point to a valid object!
error: refs/remotes/origin/HEAD does not point to a valid object!
error: refs/remotes/origin/master does not point to a valid object!
error: refs/remotes/origin/HEAD does not point to a valid object!
error: refs/remotes/origin/master does not point to a valid object!
error: refs/remotes/origin/HEAD does not point to a valid object!
error: refs/remotes/origin/master does not point to a valid object!
remote: Enumerating objects: 11187, done.
remote: Counting objects: 100% (6994/6994), done.
remote: Compressing objects: 100% (359/359), done.
remote: Total 11187 (delta 6753), reused 6787 (delta 6635), pack-reused 4193
Receiving objects: 100% (11187/11187), 13.92 MiB | 14.99 MiB/s, done.
error: object file .git/objects/e5/8e210672fa49528cb54e2068f28b25ba05cf75 is empty
fatal: cannot read existing object info e58e210672fa49528cb54e2068f28b25ba05cf75
fatal: index-pack failed

[email protected]:~# git reset --hard origin/master
fatal: Could not parse object ‘origin/master’.

[email protected]:~# git reset --hard master
HEAD is now at 84c1f1a0b Bump version to 1.63
[email protected]:~# ./daily.sh
Re-running /opt/librenms/daily.sh as librenms user
PHP Fatal error: Declaration of App\Exceptions\Handler::render($request, Exception $exception) must be compatible with Illuminate\Foundation\Exceptions\Handler::render($request, Throwable $e) in /opt/librenms/app/Exceptions/Handler.php on line 9
PHP Fatal error: Uncaught ReflectionException: Class App\Exceptions\Handler does not exist in /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php:809
Stack trace:
#0 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(809): ReflectionClass->__construct(‘App\Exceptions\…’)
#1 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(691): Illuminate\Container\Container->build(‘App\Exceptions\…’)
#2 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(796): Illuminate\Container\Container->resolve(‘App\Exceptions\…’, Array, false)
#3 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(269): Illuminate\Foundation\Application->resolve(‘App\Exceptions\…’, Array, false)
#4 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(805): Illuminate\Container\Container->Illuminate\Container{closure}(Object(App\Application), Array)
#5 /opt/librenms/vendor/laravel/framework/src in /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 811
PHP Fatal error: Declaration of App\Exceptions\Handler::render($request, Exception $exception) must be compatible with Illuminate\Foundation\Exceptions\Handler::render($request, Throwable $e) in /opt/librenms/app/Exceptions/Handler.php on line 9
PHP Fatal error: Uncaught ReflectionException: Class App\Exceptions\Handler does not exist in /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php:809
Stack trace:
#0 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(809): ReflectionClass->__construct(‘App\Exceptions\…’)
#1 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(691): Illuminate\Container\Container->build(‘App\Exceptions\…’)
#2 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(796): Illuminate\Container\Container->resolve(‘App\Exceptions\…’, Array, false)
#3 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(269): Illuminate\Foundation\Application->resolve(‘App\Exceptions\…’, Array, false)
#4 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(805): Illuminate\Container\Container->Illuminate\Container{closure}(Object(App\Application), Array)
#5 /opt/librenms/vendor/laravel/framework/src in /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 811
Updating to latest release FAIL
PHP Fatal error: Declaration of App\Exceptions\Handler::render($request, Exception $exception) must be compatible with Illuminate\Foundation\Exceptions\Handler::render($request, Throwable $e) in /opt/librenms/app/Exceptions/Handler.php on line 9
PHP Fatal error: Uncaught ReflectionException: Class App\Exceptions\Handler does not exist in /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php:809
Stack trace:
#0 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(809): ReflectionClass->__construct(‘App\Exceptions\…’)
#1 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(691): Illuminate\Container\Container->build(‘App\Exceptions\…’)
#2 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(796): Illuminate\Container\Container->resolve(‘App\Exceptions\…’, Array, false)
#3 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(269): Illuminate\Foundation\Application->resolve(‘App\Exceptions\…’, Array, false)
#4 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(805): Illuminate\Container\Container->Illuminate\Container{closure}(Object(App\Application), Array)
#5 /opt/librenms/vendor/laravel/framework/src in /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 811
error: refs/remotes/origin/HEAD does not point to a valid object!
error: refs/remotes/origin/master does not point to a valid object!
error: refs/remotes/origin/HEAD does not point to a valid object!
error: refs/remotes/origin/master does not point to a valid object!
error: refs/remotes/origin/HEAD does not point to a valid object!
error: refs/remotes/origin/master does not point to a valid object!
error: object file .git/objects/e5/8e210672fa49528cb54e2068f28b25ba05cf75 is empty
fatal: cannot read existing object info e58e210672fa49528cb54e2068f28b25ba05cf75
fatal: index-pack failed
PHP Fatal error: Declaration of App\Exceptions\Handler::render($request, Exception $exception) must be compatible with Illuminate\Foundation\Exceptions\Handler::render($request, Throwable $e) in /opt/librenms/app/Exceptions/Handler.php on line 9
PHP Fatal error: Uncaught ReflectionException: Class App\Exceptions\Handler does not exist in /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php:809
Stack trace:
#0 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(809): ReflectionClass->__construct(‘App\Exceptions\…’)
#1 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(691): Illuminate\Container\Container->build(‘App\Exceptions\…’)
#2 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(796): Illuminate\Container\Container->resolve(‘App\Exceptions\…’, Array, false)
#3 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(269): Illuminate\Foundation\Application->resolve(‘App\Exceptions\…’, Array, false)
#4 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(805): Illuminate\Container\Container->Illuminate\Container{closure}(Object(App\Application), Array)
#5 /opt/librenms/vendor/laravel/framework/src in /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 811
Updating Composer packages OK
Updating SQL-Schema OK
Updating submodules OK
Cleaning up DB OK
Fetching notifications OK
Caching PeeringDB data OK

[email protected]:~# su - librenms

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

In PackageManifest.php line 122:

Undefined index: name

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

Component Version
LibreNMS 1.63
DB Schema Not Connected (0)
PHP 7.3.25-1+ubuntu18.04.1+deb.sury.org+1
MySQL ?
RRDTool 1.7.0
SNMP NET-SNMP 5.7.3

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

[OK] Composer Version: 2.1.6
[OK] Dependencies up-to-date.
[email protected]:~$ git pull
error: refs/remotes/origin/HEAD does not point to a valid object!
error: refs/remotes/origin/master does not point to a valid object!
error: refs/remotes/origin/HEAD does not point to a valid object!
error: refs/remotes/origin/master does not point to a valid object!
error: refs/remotes/origin/HEAD does not point to a valid object!
error: refs/remotes/origin/master does not point to a valid object!
error: refs/remotes/origin/HEAD does not point to a valid object!
error: refs/remotes/origin/master does not point to a valid object!
remote: Enumerating objects: 11187, done.
remote: Counting objects: 100% (7277/7277), done.
remote: Compressing objects: 100% (359/359), done.
remote: Total 11187 (delta 7037), reused 7070 (delta 6918), pack-reused 3910
Receiving objects: 100% (11187/11187), 13.94 MiB | 13.98 MiB/s, done.
error: object file .git/objects/e5/8e210672fa49528cb54e2068f28b25ba05cf75 is empty
fatal: cannot read existing object info e58e210672fa49528cb54e2068f28b25ba05cf75
fatal: index-pack failed
[email protected]:~$ ./daily.sh

In PackageManifest.php line 122:

Undefined index: name

Updating SQL-Schema OK
Cleaning up DB OK

In PackageManifest.php line 122:

Undefined index: name

I am not sure but looks like the php is unhappy now and the database connection is lost.

The librenms site is no longer accessible.

@lucasv92

Hi there,

I got a similar issue to what you got. But can you please help me understand how we can drop and rebuild tables? Below is my output of lnms migrate.

[email protected]:~# su - librenms
[email protected]:~$ ./lnms migrate


  • Application In Production!     *
    

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

yes

Migrating: 2021_03_17_160729_service_templates_cleanup

In SchemaException.php line 86:

There is no column with name ‘type’ on table ‘service_templates’.

[email protected]:~$
[email protected]:~$
[email protected]:~$
[email protected]:~$

Your help to get over this is highly appreciated. My company uses this for monitoring of our network devices globally and they have given up on this tool. I am incharge of this tool and I’m pulling my hair to get out of this mess. :frowning:

Thanks in advance.

Santosh Kotla

Hi @santoshkotla . As far as i can see in the original post, you have more than one issue. if this happened after update an older version using ./daily.sh or trying to update PHP version, you must try to rollback the updates step by step using php artisan migrate:rollback --step=1 and run them manually one by one.

The db update process fails because it expects a table structure different than current ones.(In my case it was in the toner table). I dropped and recreated or modified the affected tables according to the github migrations. You can check it at librenms/database/migrations at master · librenms/librenms · GitHub

Hi @lucasv92 ,

Thanks for the response. There were multiple issues as I was on a very old version. But then I tried to do an upgrade and my git was also broken. Tony Murray helped me with fixing the git and then I ran the upgrade and it happened successfully to a point where tables were broken. Then I came across another person who came across the same issue and I had to drop and rebuild my database.

That took several hours but it finished successfully. I came across the toner issue and with the help of your post and a few others, I managed to get across it. Now I have the monitoring tool at the latest version but a few errors dangling here and there. Especially this one, I have no idea how to delete and rebuild tables as that is a solution as per another post.

Thanks,
Santosh Kotla

I’m glad to heard that you solved it :grinning:

About your doubts about use of mariadb take a look of this examples.

How to drop →
DROP TABLE IF EXISTS service_templates;

How to create
/*!40101 SET @saved_cs_client = @@character_set_client /;
/
!40101 SET character_set_client = utf8 /;
CREATE TABLE service_templates (
id int(10) unsigned NOT NULL AUTO_INCREMENT,
ip text COLLATE utf8mb4_unicode_ci,
type varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
dtype varchar(16) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT ‘static’,
dgtype varchar(16) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT ‘static’,
drules text COLLATE utf8mb4_unicode_ci,
dgrules text COLLATE utf8mb4_unicode_ci,
desc text COLLATE utf8mb4_unicode_ci,
param text COLLATE utf8mb4_unicode_ci,
ignore tinyint(1) NOT NULL DEFAULT ‘0’,
changed timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
disabled tinyint(1) NOT NULL DEFAULT ‘0’,
name varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/
!40101 SET character_set_client = @saved_cs_client */;

The table structure is available at github.

Thanks for the suggestion @lucasv92 . I will look at this solution.

Just a quick question, is the second line supposed to be “character_set_client = utf8 /;” OR “charatcter_ser_client = utf8mb4 /;”? As we have used utf8mb4 throughout…

Santosh Kotla

could be a typing error, always check the valid values here… :wink:
librenms/mysql-schema.dump at master · librenms/librenms · GitHub

Hi @lucasv92 ,

Thanks for all the support from your side. I am able to bring LibreNMS online with the latest version running. This is the latest that I see. I have run the commands but it doesn’t make the error go away. I have also done a manual update and it’s still the same.

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

Component Version
LibreNMS 21.8.0
DB Schema 2021_25_01_0129_isis_adjacencies_nullable (217)
PHP 7.3.25-1+ubuntu18.04.1+deb.sury.org+1
Python 3.6.9
MySQL 10.5.12-MariaDB-1:10.5.12+maria~bionic
RRDTool 1.7.0
SNMP NET-SNMP 5.7.3

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

[OK] Composer Version: 2.1.6
[OK] Dependencies up-to-date.
[OK] Database connection successful
[WARN] Your database schema has extra migrations (2020_06_24_155119_drop_ports_if_high_speed, 2021_08_26_093522_config_value_to_medium_text, 2021_25_01_0128_isis_adjacencies_add_admin_status, 2021_25_01_0129_isis_adjacencies_nullable). If you just switched to the stable release from the daily release, your database is in between releases and this will be resolved with the next release.
[OK] Database schema correct
[INFO] Detected Dispatcher Service
[FAIL] Missing PHP extension: memcached
[FIX]:
Please install memcached
[WARN] IPv6 is disabled on your server, you will not be able to add IPv6 devices.
[WARN] Your local git contains modified files, this could prevent automatic updates.
[FIX]:
You can fix this with ./scripts/github-remove
Modified Files:
config/database.php

Now my next challenge is to get the poller up and working and I have started working on that. But thanks again for helping me get my central server UP and working.

Hi Santosh,

The distributed poller should be easy, just make sure you grant access in the database (in your main LibreNMS) to accept connection form the ‘user’@‘your remote poller IP’ otherwise your remote poller won’t be able to access the database.
You also definitely want to fix this:

[FAIL] Missing PHP extension: memcached
[FIX]:
Please install memcached

You will need it in Master/Distributed poller scenario.

Good luck.

Thanks @kalamchi75

I have started the install on an existing ubuntu 18 instance. SNMPd is broken because it is asking me for an older package to be installed and somehow I can’t find it.

The weird part is I see this on my Validate.php on the poller instance.

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

Component Version
LibreNMS 21.8.0-29-geacca2ff9
DB Schema 2021_25_01_0129_isis_adjacencies_nullable (217)
PHP 7.4.23
Python 3.6.8
MySQL 10.5.12-MariaDB-1:10.5.12+maria~bionic
RRDTool 1.7.0
SNMP NET-SNMP 5.7.3

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

[OK] Composer Version: 2.1.6
[OK] Dependencies up-to-date.
[OK] Database connection successful
[FAIL] Time between this server and the mysql database is off
Mysql time 2021-09-07 14:00:58
PHP time 2021-09-07 13:58:16

[FAIL] Database: incorrect column (config/config_value)
[FAIL] Database: incorrect column (isis_adjacencies/port_id)
[FAIL] Database: incorrect column (isis_adjacencies/isisISAdjNeighSysType)
[FAIL] Database: incorrect column (isis_adjacencies/isisISAdjNeighSysID)
[FAIL] Database: incorrect column (isis_adjacencies/isisISAdjNeighPriority)
[FAIL] Database: incorrect column (isis_adjacencies/isisISAdjLastUpTime)
[FAIL] Database: incorrect column (isis_adjacencies/isisISAdjAreaAddress)
[FAIL] Database: incorrect column (isis_adjacencies/isisISAdjIPAddrType)
[FAIL] Database: incorrect column (isis_adjacencies/isisISAdjIPAddrAddress)
[FAIL] Database: missing column (isis_adjacencies/isisCircAdminState)
[FAIL] Database: extra column (ports/ifHighSpeed)
[FAIL] Database: extra column (ports/ifHighSpeed_prev)
[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 config CHANGE config_value config_value mediumtext NOT NULL ;
ALTER TABLE isis_adjacencies CHANGE port_id port_id int NULL ;
ALTER TABLE isis_adjacencies CHANGE isisISAdjNeighSysType isisISAdjNeighSysType varchar(128) NULL ;
ALTER TABLE isis_adjacencies CHANGE isisISAdjNeighSysID isisISAdjNeighSysID varchar(128) NULL ;
ALTER TABLE isis_adjacencies CHANGE isisISAdjNeighPriority isisISAdjNeighPriority varchar(128) NULL ;
ALTER TABLE isis_adjacencies CHANGE isisISAdjLastUpTime isisISAdjLastUpTime bigint unsigned NULL ;
ALTER TABLE isis_adjacencies CHANGE isisISAdjAreaAddress isisISAdjAreaAddress varchar(128) NULL ;
ALTER TABLE isis_adjacencies CHANGE isisISAdjIPAddrType isisISAdjIPAddrType varchar(128) NULL ;
ALTER TABLE isis_adjacencies CHANGE isisISAdjIPAddrAddress isisISAdjIPAddrAddress varchar(128) NULL ;
ALTER TABLE isis_adjacencies ADD isisCircAdminState varchar(16) NOT NULL DEFAULT ‘off’ AFTER isisISAdjIPAddrAddress;
ALTER TABLE ports DROP ifHighSpeed;
ALTER TABLE ports DROP ifHighSpeed_prev;
[INFO] Detected Dispatcher Service

When I try to run the commands in mysql this is what I get.

[email protected]:~# mysql -u librenms -p librenms
mysql: unknown variable ‘innodb_default_row_format=dynamic’

I have not installed mariadb on my poller instance.

Can you please point out to me where I am going wrong?

Thanks,
Santosh Kotla

Hi Santosh,

To start with, if I was you, I wouldn’t try to install on an already broken machine. That’s just gonna complicate things for you. If you can, do a clean Ubuntu install and start from there.

Please share the config.php file from your poller (you can hash out any passwords there).

You will need a running memcached and rrdcached instances on your main LibreNMS

Please see below sample configuration of the remote poller:

I have marked the important parts

Note how the Database connection, the memcached, and rrdcached connections are pointing to the master server, rather than the local machine.

Please follow the instructions provided in the documentation of librenms on how to install a distributed poller.

But take my advise, don’t waste your time trying to fix that broken Ubuntu. start afresh (if it’s possible for you).

Good luck man

You might want to investigate this.
Check the Timezone in your php.ini files both for Apache and Cli, and make sure it is set to the same timezone used by the system. I think MySQL uses the default system timezone (the one that was selected during installation).

Hi @kalamchi75

Thanks for the prompt response and highlighting the important parts of the config. I will have this instance reimaged tomorrow and will probably have a Ubuntu 18 or a CentOS 7.9 or 8.xx on it. Do we need to maintain the central server and the pollers on the same LINUX platforms?

I’m Just asking as I personally encountered more errors with Ubuntu when compared to CentOS and my central server runs on a Ubuntu 18 but there’s nothing I can do about it as it’s already handling about 1350 network devices.

I have test instances of CentOS 7.9 with some basic resources and I will try to establish a connection to the central server and see how that goes.

Following is the snippet of the .env on the poller

APP_KEY=base64:Ku5czycMjqVdONfORGSVTBYRDon9FqcRZihr+xbc+EM=

DB_HOST=10.69.176.104
DB_DATABASE=librenms
DB_USERNAME=xxxxxxx
DB_PASSWORD=xxxxxxx

REDIS_HOST=10.69.176.104
REDIS_PORT=6379
REDIS_DB=0
CACHE_DRIVER=redis

#APP_KEY=base64:Wkx0G7YuWZSzbUC4AgVyBYhrVAIZ4+209tQ4BelBUUc=

DB_HOST=10.69.176.104
DB_DATABASE=librenms
DB_USERNAME=xxxxx
DB_PASSWORD=xxxxx

#APP_URL=
NODE_ID=61373fcfac2ec
LIBRENMS_USER=librenms

I have the PHP timezones set to Etc and I don’t know why it still shows me a difference of 2 minutes. I have the same set everywhere including on the central server. Even though they sit at different global regions. Can we set them at their respective timezones?

Thanks,
Santosh Kotla

Hi Santosh,

Perhaps the LibreNMS team can answer better regarding different OS on the pollers.
Personally, I prefer Ubuntu always, and I don’t have that much experience with CentOS. That’s said, I don;t think it really matters what OS is running on the server, as long as the remote poller can access the database in the master one.
So you don’t have to break you master setup.

However, you will need to enable Distributed pollers in the master;s server configuration.
you will NEED mamceched in the master
you will NEED rrdcached in the master

the rest is really easy, and you point your remote poller to use those mentioned above in the master.

Get your machine ready, and I can assist with config examples.

Good luck man