[ZBX-12060] query failed: [1452] Created: 2017 Apr 18  Updated: 2024 Apr 10  Resolved: 2017 May 02

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 3.2.5rc1
Fix Version/s: None

Type: Incident report Priority: Trivial
Reporter: Anderson Oliveira Assignee: Unassigned
Resolution: Won't fix Votes: 0
Labels: database, items
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

CentOS 6.8; MySQL 5.7


Team: Team B
Sprint: Sprint 6, Sprint 7

 Description   

After upgrade to 3.2.5rc this error appears many times in log

731:20170418:001726.283 [Z3005] query failed: [1452] Cannot add or update a child row: a foreign key constraint fails (`zabbix`.`functions`, CONSTRAINT `c_functions_1` FOREIGN KEY (`itemid`) REFERENCES `items` (`itemid`) ON DELETE CASCADE) [insert into functions (functionid,itemid,triggerid,function,parameter) values (48904,127334,42075,'diff','0'),(48905,127335,42076,'diff','0'),(48906,127336,42077,'diff','0'),(48907,127337,42078,'diff','0'),(48908,127338,42079,'diff','0'),(48909,127339,42080,'diff','0'),(48910,127340,42081,'diff','0');
]
731:20170418:001726.300 [Z3005] query failed: [1452] Cannot add or update a child row: a foreign key constraint fails (`zabbix`.`graphs_items`, CONSTRAINT `c_graphs_items_2` FOREIGN KEY (`itemid`) REFERENCES `items` (`itemid`) ON DELETE CASCADE) [insert into graphs_items (gitemid,graphid,itemid,drawtype,sortorder,color,yaxisside,calc_fnc,type) values (45930,23662,127327,5,0,'00AA00',0,2,0),(45931,23662,127348,5,1,'3333FF',0,2,0),(45932,23663,127328,5,0,'00AA00',0,2,0),(45933,23663,127349,5,1,'3333FF',0,2,0),(45934,23664,127329,5,0,'00AA00',0,2,0),(45935,23664,127350,5,1,'3333FF',0,2,0),(45936,23665,127330,5,0,'00AA00',0,2,0),(45937,23665,127351,5,1,'3333FF',0,2,0),(45938,23666,127331,5,0,'00AA00',0,2,0),(45939,23666,127352,5,1,'3333FF',0,2,0),(45940,23667,127332,5,0,'00AA00',0,2,0),(45941,23667,127353,5,1,'3333FF',0,2,0),(45942,23668,127333,5,0,'00AA00',0,2,0),(45943,23668,127354,5,1,'3333FF',0,2,0);



 Comments   
Comment by Alexander Vladishev [ 2017 Apr 19 ]

What version you used before 3.2.5rc1?
Do you have other SQL errors in log file?

Comment by Hsu Mon [ 2017 May 02 ]

I am facing this error too. My OS is Ubuntu 16.04 LTS, MySQL 5.7.14. Moreover, the following errors are also repeatedly found in server log.

query failed: [1062] Duplicate entry '10154-ifAdminStatus[Internal]' for key 'items_1' [insert into items (itemid,n
ame,key_,hostid,type,value_type,data_type,delay,delay_flex,history,trends,status,trapper_hosts,units,multiplier,delta,formula,logtimefmt,valuemapid,pa
rams,ipmi_sensor,snmp_community,snmp_oid,port,snmpv3_securityname,snmpv3_securitylevel,snmpv3_authprotocol,snmpv3_authpassphrase,snmpv3_privprotocol,s
nmpv3_privpassphrase,authtype,username,password,publickey,privatekey,description,interfaceid,flags,snmpv3_contextname) values (35835,'Admin status of
interface $1','ifAdminStatus[dmz]',10154,4,3,0,60,'',7,365,0,'','',0,0,'1','',11,'','','{$SNMP_COMMUNITY}','IF-MIB::ifAdminStatus.1','','',0,0,'',0,'',0,'','','','','The desired state of the interface.',48,4,''),(35836,'Admin status of interface $1','ifAdminStatus[wan1]',10154,4,3,0,60,'',7,365,0,'','',0,0,'1','',11,'','','{$SNMP_COMMUNITY}','IF-MIB::ifAdminStatus.2','','',0,0,'',0,'',0,'','','','','The desired state of the interface.',48,4,''),(35837,'Admin status of interface $1','ifAdminStatus[wan2]',10154,4,3,0,60,'',7,365,0,'','',0,0,'1','',11,'','','{$SNMP_COMMUNITY}','IF-MIB::ifAdminStatus.3','','',0,0,'',0,'',0,'','','','','The desired state of the interface.',48,4,''),

Comment by Alexander Vladishev [ 2017 May 02 ]

Hsu Mon, your database is not configured as case-sensitive. You need use utf8_bin collate instead of *_ci.

Comment by Anderson Oliveira [ 2017 May 02 ]

Problem solved; I deleted the entry manually

Comment by Alexander Vladishev [ 2017 May 02 ]

Closed as "Won't Fix"

Generated at Wed Jun 18 07:55:51 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.