Please help with librenms db migration

Let me preface I have no idea what I’m doing but really like LibreNMS and trying to show management how much better LibreNMS is (reliable) over stupid bloatware Solarwinds.

librenms:/opt/librenms$ ./validate.php
====================================
Component | Version
--------- | -------
LibreNMS  | 21.10.0-63-g8254d0108
DB Schema | 2020_06_24_155119_drop_ports_if_high_speed (213)
PHP       | 7.4.21
Python    | 3.8.10
MySQL     | 10.5.10-MariaDB-1:10.5.10+maria~focal
RRDTool   | 1.7.2
SNMP      | NET-SNMP 5.9
====================================

[OK]    Composer Version: 2.1.6
[OK]    Dependencies up-to-date.
[OK]    Database connection successful
[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.
[FAIL]  /var/run/rrdcached.sock doesn't appear to exist, rrdcached test failed
librenms:/opt/librenms$ 
librenms:/opt/librenms$ 
librenms:/opt/librenms$ 
librenms:/opt/librenms$ 
librenms:/opt/librenms$ ./lnms migrate
**************************************
*     Application In Production!     *
**************************************

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

Migrating: 2021_07_28_102443_plugins_add_version_and_settings
Migrated:  2021_07_28_102443_plugins_add_version_and_settings (17.29ms)
Migrating: 2021_08_04_102914_add_syslog_indexes

In Connection.php line 703:
                                                                                                                                                                       
  SQLSTATE[HY000]: General error: 1799 Creating index 'syslog_device_id_program_index' required more than 'innodb_online_alter_log_max_size' bytes of modification lo  
  g. Please try again (SQL: alter table `syslog` add index `syslog_device_id_program_index`(`device_id`, `program`))                                                   
                                                                                                                                                                       

In Exception.php line 18:
                                                                                                                                                                       
  SQLSTATE[HY000]: General error: 1799 Creating index 'syslog_device_id_program_index' required more than 'innodb_online_alter_log_max_size' bytes of modification lo  
  g. Please try again                                                                                                                                                  
                                                                                                                                                                       

In PDOStatement.php line 117:
                                                                                                                                                                       
  SQLSTATE[HY000]: General error: 1799 Creating index 'syslog_device_id_program_index' required more than 'innodb_online_alter_log_max_size' bytes of modification lo  
  g. Please try again   

I use portioner.io (2.5.1) on a CentOS 8 Linux Server with 750GB HDD and 24GB RAM to manage/host the docker instance.

I have resources available on host device:

# df -h /
Filesystem           Size  Used Avail Use% Mounted on
/dev/mapper/cl-root  744G  512G  233G  69% /

Since the command (./lnms migrate) eventually fails (after about an hour of trying) I found the suggestion to use ./lnms migrate -pretend which spits out the SQL commands:

librenms:/opt/librenms$ ./lnms migrate --pretend
**************************************
*     Application In Production!     *
**************************************

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

AddSyslogIndexes: alter table `syslog` add index `syslog_device_id_program_index`(`device_id`, `program`)
AddSyslogIndexes: alter table `syslog` add index `syslog_device_id_priority_index`(`device_id`, `priority`)
ConfigValueToMediumText: ALTER TABLE config CHANGE config_value config_value MEDIUMTEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`
CreatePushSubscriptionsTable: create table `push_subscriptions` (`id` bigint unsigned not null auto_increment primary key, `subscribable_type` varchar(255) not null, `subscribable_id` bigint unsigned not null, `endpoint` varchar(500) not null, `public_key` varchar(255) null, `auth_token` varchar(255) null, `content_encoding` varchar(255) null, `description` varchar(255) null, `created_at` timestamp null, `updated_at` timestamp null) default character set utf8mb4 collate 'utf8mb4_unicode_ci'
CreatePushSubscriptionsTable: alter table `push_subscriptions` add index `push_subscriptions_subscribable_type_subscribable_id_index`(`subscribable_type`, `subscribable_id`)
CreatePushSubscriptionsTable: alter table `push_subscriptions` add unique `push_subscriptions_endpoint_unique`(`endpoint`)
CreateHrSystemTable: create table `hrSystem` (`hrSystem_id` int unsigned not null auto_increment primary key, `device_id` int unsigned not null, `hrSystemNumUsers` int not null default '0', `hrSystemProcesses` int not null default '0', `hrSystemMaxProcesses` int not null default '0') default character set utf8mb4 collate 'utf8mb4_unicode_ci'
CreateHrSystemTable: alter table `hrSystem` add index `hrsystem_device_id_index`(`device_id`)
AddDeviceOutagesIndex: select column_name as `column_name` from information_schema.columns where table_schema = ? and table_name = ?
AddDeviceOutagesIndex: alter table `device_outages` add `id` bigint unsigned not null auto_increment primary key first
UpdateHrSystemTable: failed to dump queries. This may be due to changing database columns using Doctrine, which is not supported while pretending to run migrations.
DisableExamplePlugin: update `plugins` set `plugin_active` = ? where (`plugin_name` = ? and `version` = ?)
IncreaseLengthOfAttribTypeColumn: ALTER TABLE devices_attribs CHANGE attrib_type attrib_type VARCHAR(64) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`
IsisAdjacenciesAddAdminStatus: alter table `isis_adjacencies` add `isisCircAdminState` varchar(16) not null default 'off'
IsisAdjacenciesNullable: ALTER TABLE isis_adjacencies CHANGE port_id port_id INT DEFAULT NULL, CHANGE isisISAdjNeighSysType isisISAdjNeighSysType VARCHAR(128) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE isisISAdjNeighSysID isisISAdjNeighSysID VARCHAR(128) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE isisISAdjNeighPriority isisISAdjNeighPriority VARCHAR(128) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE isisISAdjLastUpTime isisISAdjLastUpTime BIGINT UNSIGNED DEFAULT NULL, CHANGE isisISAdjAreaAddress isisISAdjAreaAddress VARCHAR(128) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE isisISAdjIPAddrType isisISAdjIPAddrType VARCHAR(128) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE isisISAdjIPAddrAddress isisISAdjIPAddrAddress VARCHAR(128) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`
librenms:/opt/librenms$

Then I connect to the librenms_db container and have tried running the following without luck:

    root@2926209e5c1d:/# mysql
    Welcome to the MariaDB monitor.  Commands end with ; or \g.
    Your MariaDB connection id is 10764
    Server version: 10.5.10-MariaDB-1:10.5.10+maria~focal mariadb.org binary distribution

    Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

    MariaDB [(none)]> USE librenms;
    Reading table information for completion of table and column names
    You can turn off this feature to get a quicker startup with -A

    Database changed
    MariaDB [librenms]> alter table `syslog` add index `syslog_device_id_program_index`(`device_id`, `program`);
    ERROR 1799 (HY000): Creating index 'syslog_device_id_program_index' required more than 'innodb_online_alter_log_max_size' bytes of modification log. Please try again
    MariaDB [librenms]>   

Again, I apologize if this is a stupid support request but I really have no idea on how to move forward and appreciate any advice, tips or solutions.

Thank you in advance.

Tried again and no luck. If I run validate it says you need to migrate your database but I can’t seem to do that.

Any help is appreciated

Hello. I have recently gone through the same thing. I had about 20 or 30 such errors. I was able to solve all such errors by logging into my LibreNMS box as root MySQL user and running commands there to correct the issues. My commands were specifically for my issues but try googling the error and focus on MySQL fixes.

mysql –u root -p

show databases;

use librenms;

Thanks and I tried that but no luck.

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