[ZBX-9169] Zabbix Proxy Upgrade from 2.2 to 2.4 failed Created: 2014 Dec 25  Updated: 2017 May 30  Resolved: 2015 Jan 06

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Proxy (P)
Affects Version/s: 2.4.3
Fix Version/s: 2.4.4rc1, 2.5.0

Type: Incident report Priority: Minor
Reporter: Domi Barton Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: discovery, discoveryrule, upgrade
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Debian 7.7



 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


 Comments   
Comment by richlv [ 2014 Dec 25 ]

could it be that proxy connected to 2.2 server ?

Comment by Domi Barton [ 2014 Dec 25 ]

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

Comment by Alexander Vladishev [ 2015 Jan 05 ]

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

Comment by Alexander Vladishev [ 2015 Jan 06 ]

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

Comment by Aleksandrs Saveljevs [ 2015 Jan 06 ]

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.

Comment by Alexander Vladishev [ 2015 Jan 06 ]

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

Generated at Fri Apr 26 23:24:50 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.