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

Zabbix Upgrade 4.4 => 5.4 sql schema not fitting

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Commercial support required
    • Icon: Trivial Trivial
    • None
    • 5.4.4
    • Server (S)
    • None

      Abstract

      I am testing an upgrade from Zabbix 4.4 to 5.4 but get several problems regarding Maria/MySQL-DB. I made a dump with mydumper and restored it on the new test machine. The upgrade 4.4 => 5.0 => 5.2 went fine. The problems starts with 5.4.

      Environment:

      • Old
        • Debian 9
        • MariaDB 10.0.38
        • Zabbix 4.4.10
      • New
        • Debian 10
        • MariaDB  10.3.29
        • Zabbix 5.4.4

      Process and Result

      • Provisioned the machine with MariadB 10.3
      • Restored the DB-Dump.
      • Provisioned the machine with Zabbix-Server (5.4):

      Immediately after Zabbix-Server 5.4 starts I get the in the logs:
      {{}}

      5415:20210827:093746.369 starting automatic database upgrade 5415:20210827:093746.370 [Z3005] query failed: [1364] Field 'confirmation' doesn't have a default value [insert into scripts (scriptid,name,command,description,type,execute_on,scope,port,authtype,username,password,publickey,privatekey) values (4,'Script 1','/usr/lib/zabbix/externalscripts/onbattery_dcs1','',0,1,1,'',0,'','','','')] 5415:20210827:093746.371 database upgrade failed

      {{}}
      I can heal this by the statement:

      {{}}

      
      

      ALTER TABLE scripts ALTER confirmation SET DEFAULT '';{{}}

       

      When this is fixed (prior upgrade) I get a nice server startup with db-update, except a

       

      Got signal [signal:15(SIGTERM),sender_pid:5890,sender_uid:0,reason:0]. Exiting ...

       

      as shown in the attachment. After this the upgrade process works until 100%.

      Starting from the first login I get the failure:

      {{}}

      SQL statement execution has failed "INSERT INTO auditlog (userid,clock,ip,action,resourcetype,note,auditid) VALUES ('1','1630067308','10.22.2.3','3','0','Login failed.','19879')".

      {{}}I could also solve this:

       

      {{}}

      ALTER TABLE auditlog ALTER resourcename SET DEFAULT '';

      {{}}

       

      When adding a new new user I get the failure:

      {{}}

      Error in query [INSERT INTO users (username,name,surname,url,autologin,autologout,theme,refresh,rows_per_page,lang,timezone,roleid,passwd,userid) VALUES ('NewUser','','','','0','0','default','30s','50','default','default','2','$2y$10$7mtqOMfmqtKtBfDCgG','24')] [Field 'attempt_ip' doesn't have a default value]

      }}{{This I could solve by:

       

      {{}}

      ALTER TABLE users ALTER attempt_ip SET DEFAULT '';

      {{}}

       

      Besides this I can not login with local users, only AD. At this point I get:

       

      Incorrect user name or password or account is temporarily blocked

      Username and password is double checked. This maybe only a side effect. 

       

      I guess something went wrong during the db-upgrade and that all problems have the same source. I am suspicious about the Sigterm in the log. I could rerun some steps of my process with the snapshots I made of my vm.

      Expected Result

      • None of these issues

       

       

            atocko Andrey Tocko
            vstoppe Volker Stoppe
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: