-
Incident report
-
Resolution: Fixed
-
Major
-
2.0.0
cat upgrades/dbpatches/2.0/mysql/patch.sql | mysql zabbix
the following error accures:
ERROR 1452 (23000) at line 104: Cannot add or update a child row: a foreign key constraint fails (`zabbix`.<result 2 when explaining filename '#sql-7d6d_2'>, CONSTRAINT `c_config_2` FOREIGN KEY (`discovery_groupid`) REFERENCES `groups` (`groupid`))
Whereas "discovery_groupid" column modified to NOT NULL, then executes the next query:
UPDATE config SET discovery_groupid=NULL WHERE NOT discovery_groupid IN (SELECT groupid FROM groups);
The "discovery_groupid" column can not be NULL.
The problem may happen when discovery_groupid references to non exist groupid.