Your database is out of date!

Hello,

After having updated my librenms server from ubuntu 18.04 to 20.04, i have had several errors with the librenms updates.

I’m now stuck there :

[email protected]:/opt/librenms$ ./validate.php

Component Version
LibreNMS 21.9.0-24-gb934d0c92
DB Schema 2021_25_01_0129_isis_adjacencies_nullable (216)
PHP 7.3.30-1+ubuntu18.04.1+deb.sury.org+1
Python 3.8.10
MySQL 10.6.4-MariaDB-1:10.6.4+maria~focal
RRDTool 1.7.2
SNMP NET-SNMP 5.8

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

[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

[email protected]:/opt/librenms$ ./lnms migrate


  • Application In Production!     *
    

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

yes

Migrating: 2021_02_09_122930_migrate_to_utf8mb4

In Connection.php line 692:

SQLSTATE[HY000]: General error: 1709 Index column size too large. The maximum column size is 767 bytes (SQL: ALTER TABLE device_groups
MODIFY name
varchar(255)
CHARACTER SET utf8mb4
COLLATE utf8mb4_unicode_ci
NOT NULL DEFAULT ‘’:wink:

In Exception.php line 18:

SQLSTATE[HY000]: General error: 1709 Index column size too large. The maximum column size is 767 bytes

In PDOConnection.php line 53:

SQLSTATE[HY000]: General error: 1709 Index column size too large. The maximum column size is 767 bytes

I ve read about everywhere that this was resolved with the latest version of mariadb… problem is that i have the latest version allready…

I ve tried the --pretend option :

[email protected]:/opt/librenms$ ./lnms migrate --pretend


  • Application In Production!     *
    

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

yes

MigrateToUtf8mb4: ALTER SCHEMA librenms DEFAULT CHARACTER SET utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;
MigrateToUtf8mb4: select TABLE_NAME from information_schema.tables where table_schema = ?
MigrateToUtf8mb4: select * from information_schema.columns where table_schema = ? and CHARACTER_SET_NAME is not null and COLLATION_NAME is not null and (CHARACTER_SET_NAME != ? or COLLATION_NAME != ?)

but when i do the migrate manually, i have a message about SQL syntax error with the ? at the end of 2nd line…

I don’t know what to do more and i feel like i am about to reinstall from scratch…

If someone has any tips, that would be great.

Thank you !

There is a 100 tickets about this already, did you try the search?

Hi Jellyfrog,

I allready did the :

ALTER TABLE `config`  ROW_FORMAT=DYNAMIC;

And i have latest mariadb version… i still got this error.

Regards.

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 config ROW_FORMAT=DYNAMIC;
Query OK, 0 rows affected (0.027 sec)
Records: 0 Duplicates: 0 Warnings: 0

MariaDB [librenms]> exit

Migrating: 2021_02_09_122930_migrate_to_utf8mb4

In Connection.php line 692:

SQLSTATE[HY000]: General error: 1709 Index column size too large. The maximum column size is 767 bytes (SQL: ALTER TABLE device_groups
MODIFY name
varchar(255)
CHARACTER SET utf8mb4
COLLATE utf8mb4_unicode_ci
NOT NULL DEFAULT ‘’:wink:

In Exception.php line 18:

SQLSTATE[HY000]: General error: 1709 Index column size too large. The maximum column size is 767 bytes

In PDOConnection.php line 53:

SQLSTATE[HY000]: General error: 1709 Index column size too large. The maximum column size is 767 bytes

[email protected]:/opt/librenms$ ./validate.php

Component Version
LibreNMS 21.9.0-27-gbfa200f3f
DB Schema 2021_25_01_0129_isis_adjacencies_nullable (216)
PHP 7.3.30-1+ubuntu18.04.1+deb.sury.org+1
Python 3.8.10
MySQL 10.6.4-MariaDB-1:10.6.4+maria~focal
RRDTool 1.7.2
SNMP NET-SNMP 5.8

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

[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

OK,
i have an other problem now, but for those who are in the same situation, you have to :

ALTER TABLE xxxNameOfTheProblematicTablexxx ROW_FORMAT=DYNAMIC;

Each table name that you see here :

SQLSTATE[HY000]: General error: 1709 Index column size too large. The maximum column size is 767 bytes (SQL: ALTER TABLE **users**

I had to do it for like 10 tables and then each time launch the ./lms migrate

2 Likes

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