Ad Widget

Collapse

Zabbix 3.2 > 4.0 database upgrade

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • extremeeryan
    Junior Member
    • Jul 2019
    • 7

    #1

    Zabbix 3.2 > 4.0 database upgrade

    I'm upgrading Zabbix from 3.2 to 4.0 by migrating the database to a new VM and am getting the following error when I try to start zabbix-server after loading the database:

    5588:20190729:163045.319 using configuration file: /etc/zabbix/zabbix_server.conf
    5588:20190729:163045.328 current database version (mandatory/optional): 03050116/03050116
    5588:20190729:163045.328 required mandatory version: 03050162
    5588:20190729:163045.328 starting automatic database upgrade
    5588:20190729:163045.329 [Z3005] query failed: [1048] Column 'acknowledged' cannot be null [update problem set acknowledged=(select acknowledged from events where events.eventid=problem.eventid)]
    5588:20190729:163045.329 database upgrade failed

    This problem is identical to the one reported here:


    None of the acknowledged tables are NULL:

    mysql> select acknowledged from events where acknowledged != 0;
    Empty set (30.85 sec)

    mysql> select acknowledged from problem where acknowledged != 0;
    Empty set (2 min 20.71 sec)

    mysql> select acknowledged from problem where acknowledged is NULL;
    Empty set (0.01 sec)

    mysql> select acknowledged from events where acknowledged is NULL;
    Empty set (0.00 sec)

    I suspect that there's something wrong with the SELECT command:

    MariaDB [zabbix]> select acknowledged from events where events.eventid=problem.eventid;
    ERROR 1054 (42S22): Unknown column 'problem.eventid' in 'where clause'
    MariaDB [zabbix]> select acknowledged from problem where events.eventid=problem.eventid;
    ERROR 1054 (42S22): Unknown column 'events.eventid' in 'where clause'

    It seems like whichever table is not specified with FROM is unrecognized. I think that this results in "update problem set acknowledged" attempting to insert a NULL value. Specifying both tables makes acknowledged ambiguous:

    MariaDB [zabbix]> select acknowledged from events, problem where events.eventid=problem.eventid;
    ERROR 1052 (23000): Column 'acknowledged' in field list is ambiguous

    One relevant piece of information is that while the problems table contains entries, the events table is empty:

    MariaDB [zabbix]> select * from events;
    Empty set (0.000 sec)

    I'm using MariaDB (open-source MySQL) on the backend.

    Does anyone have any suggestions for getting around this?
  • hokiecolt67
    Junior Member
    • Aug 2019
    • 13

    #2
    extremeeryan - Did you ever find a solution to this? I'm having a similar issue.

    Comment

    • extremeeryan
      Junior Member
      • Jul 2019
      • 7

      #3
      I have not yet. My next attempt will be to upgrade from Zabbix 3.2 to 3.4 before going from 3.4 to 4.0.

      Comment

      • Sebatian
        Junior Member
        • Jan 2016
        • 5

        #4
        my solution in here:

        Comment

        • extremeeryan
          Junior Member
          • Jul 2019
          • 7

          #5
          I figured out that this was happening because of the database I was using for the import. I was originally trying to import a .sql file generated by zabbix_backup (https://github.com/maxhq/zabbix-back...er/zabbix-dump) but based on my understanding, zabbix_backup does not provide a full MySQL database dump.

          I ran mysqldump instead and imported that .sql file. I no longer encountered any of the null column issues.

          Comment

          Working...