[ZBX-10666] Misleading lld warning "item with the same key already exists" when not all macro defined Created: 2016 Apr 15  Updated: 2017 May 30  Resolved: 2016 Apr 18

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

Type: Incident report Priority: Trivial
Reporter: Dmitry Sytsko Assignee: Unassigned
Resolution: Won't fix Votes: 0
Labels: lld, warning
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates ZBX-9100 LLD - Cannot create item: item with t... Closed

 Description   

Short story before:
I need to monitor count different http response codes for url provided by my application.
For this case I want to create lld rule which will create following items prototypes:

 - url.counter.response[{#GOOD_CODE}]
 - url.counter.response[{#BAD_CODE}] + trigger prototype

So my lld rule reply looks like:

 {"data":[
{"{#GOOD_CODE}": "200", "{#BAD_CODE}": "403"},
{"{#BAD_CODE}": "404"}]}

But since second json object doesn't have {#GOOD_CODE}" macro, zabbix show error:

Cannot create item: item with the same key "url.counter.response[{#GOOD_CODE}]" already exists.

I found this error message very misleading and think that it shouldn't be shown because:

items like key_name[{#MACRO}] are created by default in lld rule, and items (in my case) url.counter.response[200], url.counter.response[403], url.counter.response[404] were successfully created too



 Comments   
Comment by Aleksandrs Saveljevs [ 2016 Apr 18 ]

The error message is correct: since there was no {#GOOD_CODE} macro, it was left unexpanded in "url.counter.response[{#GOOD_CODE}]". When Zabbix tried to create this item, the key coincided with that of the item prototype, so Zabbix could not create it. It might be that the error message could be improved by saying that "... item prototype with the same key ...", but not sure it is worth the effort.

In your particular case, you might wish to use two LLD rules instead of one: a rule for good codes and a rule for bad codes. However, that is better discussed at https://www.zabbix.org/wiki/Getting_help . Therefore, closing as "Won't fix".

Generated at Wed Jun 03 19:55:57 EEST 2026 using Jira 10.3.18#10030018-sha1:5642e4ad348b6c2a83ebdba689d04763a2393cab.