ZABBIX BUGS AND ISSUES
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-9169

Zabbix Proxy Upgrade from 2.2 to 2.4 failed

    Details

      Description

      Got an error after upgrading the proxy from 2.2 to 2.4:

      /var/log/zabbix/zabbix_proxy.log
      18213:20141225:010557.027 Duplicate data "" for field "name" is found in table "drules". Remove it manually and restart the process.
      18213:20141225:010557.027 database upgrade failed
      
      MySQL table on proxy
      mysql> select * from drules;
      +---------+--------------+------+------------------+-------+------------+--------+
      | druleid | proxy_hostid | name | iprange          | delay | nextcheck  | status |
      +---------+--------------+------+------------------+-------+------------+--------+
      |       3 |         NULL |      | 10.10.10.100-199 |  1800 | 1419466067 |      0 |
      |       4 |         NULL |      | 10.10.20.100-199 |  1800 | 1419466067 |      0 |
      |       5 |         NULL |      | 10.10.90.100-199 |  1800 | 1419466066 |      0 |
      |       6 |         NULL |      | 10.10.30.100-199 |  1800 | 1419466066 |      0 |
      +---------+--------------+------+------------------+-------+------------+--------+
      4 rows in set (0.00 sec)
      
      MySQL table on server
      mysql> select * from drules;
      +---------+--------------+-----------+------------------+-------+------------+--------+
      | druleid | proxy_hostid | name      | iprange          | delay | nextcheck  | status |
      +---------+--------------+-----------+------------------+-------+------------+--------+
      |       3 |        10105 | VLAN 1010 | 10.10.10.100-199 |  1800 | 1419472982 |      0 |
      |       4 |        10105 | VLAN 1020 | 10.10.20.100-199 |  1800 | 1419472982 |      0 |
      |       5 |        10105 | VLAN 1090 | 10.10.90.100-199 |  1800 | 1419472982 |      0 |
      |       6 |        10105 | VLAN 1030 | 10.10.30.100-199 |  1800 | 1419472982 |      0 |
      +---------+--------------+-----------+------------------+-------+------------+--------+
      

      It seems that the discovery rule names were not transferred from the server to the proxy. So I had to update them by hand:

      MySQL queries which fixed the errors
      mysql> update drules set name="VLAN 1010" where druleid=3;
      Query OK, 1 row affected (0.01 sec)
      Rows matched: 1  Changed: 1  Warnings: 0
      
      mysql> update drules set name="VLAN 1020" where druleid=4;
      Query OK, 1 row affected (0.00 sec)
      Rows matched: 1  Changed: 1  Warnings: 0
      
      mysql> update drules set name="VLAN 1090" where druleid=5;
      Query OK, 1 row affected (0.01 sec)
      Rows matched: 1  Changed: 1  Warnings: 0
      
      mysql> update drules set name="VLAN 1060" where druleid=6;
      Query OK, 1 row affected (0.01 sec)
      Rows matched: 1  Changed: 1  Warnings: 0
      

        Activity

        Hide
        richlv added a comment -

        could it be that proxy connected to 2.2 server ?

        Show
        richlv added a comment - could it be that proxy connected to 2.2 server ?
        Hide
        Domi Barton added a comment -

        yes, the whole shebang was on 2.2.
        then I've upgraded the server to 2.4, afterwards the proxy to 2.4.

        Show
        Domi Barton added a comment - yes, the whole shebang was on 2.2. then I've upgraded the server to 2.4, afterwards the proxy to 2.4.
        Hide
        Alexander Vladishev added a comment -

        drules.name synchronization between server and proxy was added in version 2.4.0.

        Show
        Alexander Vladishev added a comment - drules.name synchronization between server and proxy was added in version 2.4.0.
        Hide
        Alexander Vladishev added a comment -

        Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-9169

        Show
        Alexander Vladishev added a comment - Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-9169
        Hide
        Aleksandrs Saveljevs added a comment -

        The chosen solution is to execute "update drules set name=druleid" on the proxy side before adding a unique index for "drules.name", therefore making that name unique.

        Show
        Aleksandrs Saveljevs added a comment - The chosen solution is to execute "update drules set name=druleid" on the proxy side before adding a unique index for "drules.name", therefore making that name unique.
        Hide
        Alexander Vladishev added a comment -

        Fixed in pre-2.4.4 r51398 and pre-2.5.0 (trunk) r51399.

        Show
        Alexander Vladishev added a comment - Fixed in pre-2.4.4 r51398 and pre-2.5.0 (trunk) r51399.

          People

          • Assignee:
            Unassigned
            Reporter:
            Domi Barton
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: