Ad Widget

Collapse

Cannot add or update a child row: a foreign key constraint fails

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • registration_is_lame
    Senior Member
    • Nov 2007
    • 148

    #1

    Cannot add or update a child row: a foreign key constraint fails

    Is this signaling a problem which can cause slowdowns or something normal?

    Code:
    377:20210706:173225.732 [Z3005] query failed: [1452] Cannot add or update a child row: a foreign key constraint fails (`zabbix`.`event_recovery`, CONSTRAINT `c_event_recovery_1` FOREIGN KEY (`eventid`) REFERENCES `events` (`eventid`) ON DELETE CASCADE) [insert into event_recovery (eventid,r_eventid,correlationid,c_eventid,userid) values (6927079,80,null,null,null),(175978,81,null,null,n ull),(4,82,null,null,null);
    ]
    419:20210706:173228.786 [Z3005] query failed: [1452] Cannot add or update a child row: a foreign key constraint fails (`zabbix`.`event_recovery`, CONSTRAINT `c_event_recovery_1` FOREIGN KEY (`eventid`) REFERENCES `events` (`eventid`) ON DELETE CASCADE) [insert into event_recovery (eventid,r_eventid,correlationid,c_eventid,userid) values (6927173,84,null,null,null);
    ]
    1256:20210706:173236.010 [Z3005] query failed: [1452] Cannot add or update a child row: a foreign key constraint fails (`zabbix`.`event_recovery`, CONSTRAINT `c_event_recovery_1` FOREIGN KEY (`eventid`) REFERENCES `events` (`eventid`) ON DELETE CASCADE) [insert into event_recovery (eventid,r_eventid,correlationid,c_eventid,userid) values (3,88,null,null,null),(175970,87,null,null,null);
    ]
    1114:20210706:173237.014 [Z3005] query failed: [1452] Cannot add or update a child row: a foreign key constraint fails (`zabbix`.`event_recovery`, CONSTRAINT `c_event_recovery_1` FOREIGN KEY (`eventid`) REFERENCES `events` (`eventid`) ON DELETE CASCADE) [insert into event_recovery (eventid,r_eventid,correlationid,c_eventid,userid) values (4,90,null,null,null),(175978,89,null,null,null);
    Zabbix version 4.0.1

    If it is a problem how can I fix it?

    I have found a similar thread where someone suggests:


    SET global foreign_key_checks = 0;

    I would like to however understand what this problem is.
Working...