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;
Thanks man, you help a lot. In my environment, occurs the following event:
[Z3005] query failed: [1060] Duplicate column name ‘query_fields’ [alter table `items` add `query_fields` varchar(2048) default ” not null]
I was solved with your fix:
alter table items drop column query_fields;
once more, Thanks!