[ZBX-8612] duplicate hosts may be created when using auto-registration via a proxy Created: 2014 Aug 13  Updated: 2025 Mar 21

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

Type: Incident report Priority: Trivial
Reporter: Oleg Ivanivskyi Assignee: Unassigned
Resolution: Unresolved Votes: 3
Labels: autoregistration
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Zabbix server
Zabbix proxy (active)
Zabbix agent


Attachments: PNG File db.png     PNG File image-2025-03-21-19-32-05-831.png     PNG File two_hosts.png     PNG File via_proxy.png     PNG File via_server.png    
Issue Links:
Duplicate

 Description   

How to reproduce:
1) configure "ServerActive=server_IP,proxy_IP" in a zabbix_agentd.conf, restart agent
2) enable host auto registration (e.g. create a new action; Event source: Auto registration: without conditions; with operations - Add to host groups: Linux servers, Link to templates: Template OS Linux)
3) wait 5-10 minutes



 Comments   
Comment by Oleg Ivanivskyi [ 2014 Aug 13 ]

Duplicates could be created also. How to reproduce:
1) delete auto registered host
2) wait
3) repeat step "1)" if necessary.

Note, that agent is installed on the proxy server.

Comment by Oleksii Zagorskyi [ 2014 Aug 13 ]

I'm not sure this is a bug.

Note that in ZBXNEXT-1267 we did a change that the same IP (host) discovered by different proxy will create additional host monitored by the proxy.

Comment by Oleg Ivanivskyi [ 2014 Aug 13 ]

Thanks for the details. You're right. The bug is that Zabbix may create duplicates.

Comment by Alexander Vladishev [ 2014 Aug 22 ]

Similar issue: ZBX-4973

Comment by Juris Miščenko (Inactive) [ 2014 Aug 22 ]

This bug manifests itself when two, very closely timed, connections are made to the servers trappers - one from the host and the other from the proxy.

When the two trapper processes query the database for information regarding the host, they both receive empty results, as the host does not exist at that point, both processes proceed with adding the host and thus the host is duplicated, once as monitored via a proxy and a second time where it's monitored directly.

Unfortunately, for the time being, we cannot correct this.

A possible solution would be setting a lock on the database before reading it and releasing it after the entry has been added, so that during the registration, the other process has to wait for the database to become available for reading where it will discover the entry added by the first process and will modify it rather than add its own entry. The downside of this is a very severe execution time penalty as concurrent operations, on at least the table, will become impossible. The issue noted by Alexander addresses this same bug on the API side where it is possible for this to occur when there is a request to add an entry to the database by two separate connections.

An effort at mitigation is being discussed.

Comment by Juan Pablo [ 2022 Jul 05 ]

I can confirm that this still happen on version 6.0.6.

I understand that is difficult to solve but meanwhile is there any query or utility to find this duplicates? something like this https://www.zabbix.com/forum/zabbix-troubleshooting-and-problems/46895-autodiscovery-duplicate-hosts but inside zabbix, like housekeeper or something like that

Generated at Thu Apr 17 00:15:33 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.