Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-20165

Database upgrade failed, Zabbix v. 5.0. Specified key was too long; max key length is 767 bytes

XMLWordPrintable

    • Icon: Documentation task Documentation task
    • Resolution: Fixed
    • Icon: Trivial Trivial
    • 6.0.0alpha7, 6.0 (plan)
    • 5.0.17
    • Documentation (D)
    • Amazon Linux 2, mysql Ver 14.14 Distrib 5.6.51
    • Sprint 82 (Nov 2021)
    • 0.1

      I encountered the below error when trying to upgrade Zabbix from 4.4 version to 5.0. The front end upgrade went fine however the database one did not. The error is not mentioned in the documentation.

      3862:20211102:180329.033 Starting Zabbix Server. Zabbix 5.0.17 (revision 0a4ac3dabc).
      3862:20211102:180329.033 ****** Enabled features ******
      3862:20211102:180329.033 SNMP monitoring: YES
      3862:20211102:180329.033 IPMI monitoring: YES
      3862:20211102:180329.033 Web monitoring: YES
      3862:20211102:180329.033 VMware monitoring: YES
      3862:20211102:180329.033 SMTP authentication: YES
      3862:20211102:180329.033 ODBC: YES
      3862:20211102:180329.033 SSH support: YES
      3862:20211102:180329.033 IPv6 support: YES
      3862:20211102:180329.033 TLS support: YES
      3862:20211102:180329.033 ******************************
      3862:20211102:180329.033 using configuration file: /etc/zabbix/zabbix_server.conf
      3862:20211102:180329.036 current database version (mandatory/optional): 04050003/04050003
      3862:20211102:180329.036 required mandatory version: 05000000
      3862:20211102:180329.036 optional patches were found
      3862:20211102:180329.036 starting automatic database upgrade
      3862:20211102:180329.036 [Z3005] query failed: [1071] Specified key was too long; max key length is 767 bytes [create index items_1 on items (hostid,key_(1021))]
      3862:20211102:180329.036 database upgrade failed

      mysql Ver 14.14 Distrib 5.6.51, for Linux (x86_64) using EditLine wrapper

      mysql> select @@innodb_page_size;
      --------------------

      @@innodb_page_size

      --------------------

      16384

      --------------------
      1 row in set (0.00 sec)

      mysql> show table status in zabbix;
      -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

      Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment

      -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

      acknowledges InnoDB 10 Compact 23 712 16384 0 49152 0 NULL 2021-10-15 19:18:37 NULL NULL utf8_bin NULL    
      actions InnoDB 10 Compact 5 3276 16384 0 32768 0 NULL 2021-10-15 19:18:37 NULL NULL utf8_bin NULL    

      ...

      mysql> select @@innodb_large_prefix;
      -----------------------

      @@innodb_large_prefix

      -----------------------

      0

      -----------------------
      1 row in set (0.00 sec)

      items CREATE TABLE `items` (
      `itemid` bigint(20) unsigned NOT NULL,
      ............
      CONSTRAINT `c_items_5` FOREIGN KEY (`master_itemid`) REFERENCES `items` (`itemid`) ON DELETE CASCADE
      ) *ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin
      *

            mgeneralova Marina Generalova
            *ChrisM* Krzysztof
            Team D
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: