[ZBX-5860] DB error occurs hostgroup.massupdate method with duplicate hostid Created: 2012 Nov 16  Updated: 2017 May 30  Resolved: 2012 Nov 23

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: API (A)
Affects Version/s: 2.0.3
Fix Version/s: 2.0.4, 2.1.0

Type: Incident report Priority: Major
Reporter: Kodai Terashima Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: api
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate

 Description   

DB error occurs hostgroup.massupdate with duplicate hostid.

MySQL error:

Error in query [INSERT INTO hosts_groups (hostgroupid, hostid, groupid) VALUES (100100000173493, 100100000027416, 100100000000252)] [Duplicate entry '100100000027416-100100000000252' for key 'hosts_groups_1']18:49:13 SQL: INSERT INTO hosts_groups (hostgroupid, hostid, groupid) VALUES (100100000173493, 100100000027416, 100100000000252)



 Comments   
Comment by Eduards Samersovs (Inactive) [ 2012 Nov 21 ]

Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-5860

Comment by Oleg Egorov (Inactive) [ 2012 Nov 22 ]

API REQUEST:

{
"hosts": [
            {
                "hostid": "10120"
            },
            {
                "hostid": "10120"
            }
],
"groups": [
            {
                "groupid": "5"
            }
],
        "status": 0
}

RESULT:
SQL statement execution has failed \"INSERT INTO hosts_groups (hostid,groupid,hostgroupid) VALUES ('10120','5','136');

If use native group or only one host, then OK.

This issue exist only for host.massupdate

CLOSED

Comment by Oleg Egorov (Inactive) [ 2012 Nov 23 ]

TESTED!

Comment by Eduards Samersovs (Inactive) [ 2012 Nov 23 ]

Fixed in versions pre-2.1.0 (beta) r31653, pre-2.0.4rc1 r31651

Comment by Oleksii Zagorskyi [ 2013 Feb 05 ]

This change caused a regression, reported in ZBX-6214

Generated at Thu Apr 25 06:31:13 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.