Zabbix 4.0 Proxy Upgrade database issues

Posted on 06/10/2018 · Posted in Zabbix

Encountered a few Proxy Database upgrade issues while upgrading from Zabbix 3.4.x to 4.0. These issues are simple to fix, but require some database changes.

18576:20181006:140604.487 [Z3005] query failed: [1005] Can't create table `zabbix`.`#sql-4856_6` (errno: 121 "Duplicate key on write or update") [alter table `tag_filter` add constraint c_tag_filter_1 foreign key (`usrgrpid`) references `usrgrp` (`usrgrpid`) on delete cascade]
18576:20181006:140604.487 database upgrade failed

Fix: alter table tag_filter drop foreign key c_tag_filter_1;

17762:20181006:143448.133 [Z3005] query failed: [1060] Duplicate column name 'proxy_address' [alter table `hosts` add `proxy_address` varchar(255) default '' not null]
17762:20181006:143448.133 database upgrade failed

Fix: alter table hosts drop column proxy_address;