Ad Widget

Collapse

Erro após atualizar para a versão 5.2.1

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DaniBoy_PF
    Junior Member
    • Nov 2020
    • 2

    #1

    Erro após atualizar para a versão 5.2.1

    Boa tarde senhores, sou aprendiz ainda do zabbix, mas vamos lá.

    Tinha a versão 3.4 instalada funcionando tudo certinho, migrei para a 5.2.1 e após isso não mais conecta com o banco.

    Conectei uma vez e após reiniciar o PC não mais conecta e aparece os erros e Logs abaixo:

    Envio tb um print dos usuarios e bancos do MySQL onde mostra o banco que fala que não existe:

    23087:20201125:134153.323 Starting Zabbix Server. Zabbix 5.2.1 (revision 4d0d532fb0).
    23087:20201125:134153.323 ****** Enabled features ******
    23087:20201125:134153.324 SNMP monitoring: YES
    23087:20201125:134153.324 IPMI monitoring: YES
    23087:20201125:134153.324 Web monitoring: YES
    23087:20201125:134153.325 VMware monitoring: YES
    23087:20201125:134153.325 SMTP authentication: YES
    23087:20201125:134153.325 ODBC: YES
    23087:20201125:134153.325 SSH support: YES
    23087:20201125:134153.326 IPv6 support: YES
    23087:20201125:134153.326 TLS support: YES
    23087:20201125:134153.326 ******************************
    23087:20201125:134153.326 using configuration file: /etc/zabbix/zabbix_server.conf
    23087:20201125:134153.343 current database version (mandatory/optional): 05010052/05010052
    23087:20201125:134153.344 required mandatory version: 05020000
    23087:20201125:134153.344 starting automatic database upgrade
    23087:20201125:134153.345 [Z3005] query failed: [1050] Table 'role' already exists [create table role (
    `roleid` bigint unsigned not null,
    `name` varchar(255) default '' not null,
    `type` integer default '0' not null,
    `readonly` integer default '0' not null,
    primary key (roleid)
    ) engine=innodb]
    23087:20201125:134153.345 database upgrade failed

    25236:20201124:150702.019 [Z3001] connection to database 'zabbixbroto' failed: [0] could not connect to server: Connection refused
    25236:20201124:150712.019 [Z3001] connection to database 'zabbixbroto' failed: [0] could not connect to server: Connection refused
    25236:20201124:150722.020 [Z3001] connection to database 'zabbixbroto' failed: [0] could not connect to server: Connection refused
    25236:20201124:150732.020 [Z3001] connection to database 'zabbixbroto' failed: [0] could not connect to server: Connection refused
    25236:20201124:150742.021 [Z3001] connection to database 'zabbixbroto' failed: [0] could not connect to server: Connection refused
    25236:20201124:150751.671 [Z3001] connection to database 'zabbixbroto' failed: [0] could not connect to server: Connection refused
    25690:20201124:150752.007 [Z3001] connection to database 'zabbixbroto' failed: [0] FATAL: database "zabbixbroto" does not exist
    25690:20201124:150802.037 [Z3001] connection to database 'zabbixbroto' failed: [0] FATAL: database "zabbixbroto" does not exist
    25690:20201124:150812.067 [Z3001] connection to database 'zabbixbroto' failed: [0] FATAL: database "zabbixbroto" does not exist
    25690:20201124:150822.097 [Z3001] connection to database 'zabbixbroto' failed: [0] FATAL: database "zabbixbroto" does not exist
    25690:20201124:150832.127 [Z3001] connection to database 'zabbixbroto' failed: [0] FATAL: database "zabbixbroto" does not exist
    25690:20201124:150842.157 [Z3001] connection to database 'zabbixbroto' failed: [0] FATAL: database "zabbixbroto" does not exist

    +--------------------+
    | Database |
    +--------------------+
    | information_schema |
    | mysql |
    | performance_schema |
    | sys |
    | zabbixbroto |
    | zabbixpf |
    +--------------------+
    6 rows in set (0.03 sec)

    mysql> SELECT user FROM mysql.user;
    +------------------+
    | user |
    +------------------+
    | zabbix |
    | debian-sys-maint |
    | mysql.session |
    | mysql.sys |
    | root |
    | zabbixpf |
    +------------------+

    Alguma solução?

  • dom_b
    Junior Member
    • Jul 2021
    • 6

    #2
    I have this same issue upgrading and am also on database version 05010052. Did anyone resolve this? I have the same issue on 5.2 and 5.4. I also can't roll back to 5.0 as it seems to have half updated some tables, but not others.

    Code:
     17503:20210703:132132.763 Starting Zabbix Server. Zabbix 5.4.2 (revision 4c8f9aabe1).
    17503:20210703:132132.763 ****** Enabled features ******
    17503:20210703:132132.763 SNMP monitoring: YES
    17503:20210703:132132.763 IPMI monitoring: YES
    17503:20210703:132132.763 Web monitoring: YES
    17503:20210703:132132.763 VMware monitoring: YES
    17503:20210703:132132.763 SMTP authentication: YES
    17503:20210703:132132.763 ODBC: YES
    17503:20210703:132132.764 SSH support: YES
    17503:20210703:132132.764 IPv6 support: YES
    17503:20210703:132132.764 TLS support: YES
    17503:20210703:132132.764 ******************************
    17503:20210703:132132.764 using configuration file: /etc/zabbix/zabbix_server.conf
    17503:20210703:132133.027 Unsupported DB! MySQL version is 50651 which is smaller than minimum of 50728
    17503:20210703:132133.192 current database version (mandatory/optional): 05010052/05010052
    17503:20210703:132133.192 required mandatory version: 05040000
    17503:20210703:132133.192 starting automatic database upgrade
    17503:20210703:132133.227 [Z3005] query failed: [1050] Table 'role' already exists [create table role (
    `roleid` bigint unsigned not null,
    `name` varchar(255) default '' not null,
    `type` integer default '0' not null,
    `readonly` integer default '0' not null,
    primary key (roleid)
    ) engine=innodb]
    17503:20210703:132133.246 database upgrade failed

    Comment

    • dom_b
      Junior Member
      • Jul 2021
      • 6

      #3
      I eventually solved this. For some reason it looks like the database updates happen for 5010052 and 5010053, but the version doesn't incremement.

      https://github.com/zabbix/zabbix/blo...upgrade_5010.c

      i had to do the following:

      udate versuoin to 05010053 becuase role already exists, restart the server
      Code:
      UPDATE `dbversion` SET `mandatory`=05010053,`optional`=05010053  WHERE 1

      i then had to drop the role_1 index from roles and restart the server again:

      Code:
      DROP INDEX role_1 ON role;
      I then ran into this bug. https://www.zabbix.com/forum/zabbix-...-upgrade-error. Run the below and restart the server once more. Database upgrades successfully and the service starts.

      Code:
      ALTER TABLE opcommand DROP FOREIGN KEY c_opcommand_2; ALTER TABLE `opcommand` CHANGE `scriptid` `scriptid` BIGINT(20) UNSIGNED NOT NULL; ALTER TABLE `opcommand` ADD CONSTRAINT `c_opcommand_2` FOREIGN KEY (`scriptid`) REFERENCES `scripts`(`scriptid`) ON DELETE RESTRICT ON UPDATE RESTRICT;
      Last edited by dom_b; 04-07-2021, 23:09.

      Comment

      Working...