Host OS: Ubuntu 18.04 LTS
MySQL Version: 5.7.30
When attempting to upgrade the server from 4.4.8 to 5.0, we get the following error in the Zabbix Server logs:
I'm no MySQL expert, so I really don't want to go poking too hard at the database in an attempt to fix this. As best as I can tell, this is telling me that we can't alter the "items" table to add a foreign key constraint because an item is missing... but I don't know how to fix that.
Any ideas/suggestions? Additional information that would help with troubleshooting?
MySQL Version: 5.7.30
When attempting to upgrade the server from 4.4.8 to 5.0, we get the following error in the Zabbix Server logs:
Code:
3738:20200629:173032.939 Starting Zabbix Server. Zabbix 5.0.1 (revision c2a0b03480). 3738:20200629:173032.939 ****** Enabled features ****** 3738:20200629:173032.939 SNMP monitoring: YES 3738:20200629:173032.939 IPMI monitoring: YES 3738:20200629:173032.939 Web monitoring: YES 3738:20200629:173032.939 VMware monitoring: YES 3738:20200629:173032.939 SMTP authentication: YES 3738:20200629:173032.939 ODBC: YES 3738:20200629:173032.939 SSH support: YES 3738:20200629:173032.939 IPv6 support: YES 3738:20200629:173032.939 TLS support: YES 3738:20200629:173032.939 ****************************** 3738:20200629:173032.939 using configuration file: /etc/zabbix/zabbix_server.conf 3738:20200629:173032.947 current database version (mandatory/optional): 04050004/04050004 3738:20200629:173032.947 required mandatory version: 05000000 3738:20200629:173032.947 starting automatic database upgrade 3738:20200629:173033.077 [Z3005] query failed: [1452] Cannot add or update a child row: a foreign key constraint fails (`zabbix`.`#sql-74b_c4e7b`, CONSTRAINT `c_items_1` FOREIGN KEY (`hostid`) REFERENCES `hosts` (`hostid`) ON DELETE CASCADE) [alter table `items` add constraint c_items_1 foreign key (`hostid`) references `hosts` (`hostid`) on delete cascade] 3738:20200629:173033.077 database upgrade failed
Any ideas/suggestions? Additional information that would help with troubleshooting?
Comment