[ZBX-18432] Tag filter with empty name and value does not show problems without tags Created: 2020 Sep 30 Updated: 2025 Mar 24 Resolved: 2025 Feb 17 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | API (A) |
Affects Version/s: | 5.0.3 |
Fix Version/s: | 6.0.39rc1, 7.0.10rc1, 7.2.4rc1, 7.4.0alpha1 |
Type: | Problem report | Priority: | Major |
Reporter: | Christian Anton | Assignee: | Deniels Pankins |
Resolution: | Fixed | Votes: | 1 |
Labels: | None | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | 2h | ||
Original Estimate: | Not Specified | ||
Environment: |
Ubuntu |
Attachments: |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
||||||||
Issue Links: |
|
||||||||
Team: | |||||||||
Sprint: | S25-W6/7, S25-W8/9 | ||||||||
Story Points: | 0.5 |
Description |
Steps to reproduce:
Result: In the documentation (https://www.zabbix.com/documentation/current/manual/config/users_and_usergroups/usergroup), it's stated in another way, which also makes more sense as the behavior that currently takes place: If both tag name and value fields are left blank but host group selected, corresponding user group will see all problems for selected host group Expected: |
Comments |
Comment by Andrei Gushchin (Inactive) [ 2020 Oct 01 ] |
Hello Christian, I cannot reproduce that. I've created user group with permissions to two hostgroups one read second write, and tags as you mentioned without any value. |
Comment by Andrei Gushchin (Inactive) [ 2020 Oct 01 ] |
Comment by Christian Anton [ 2020 Oct 06 ] |
I can confirm it works fine if you have "all tags" tag filter permissions for both groups. In my case, I was testing with tag filter permissions with a defined tag name (or tag name AND tag value) for one of the groups, and "all tags" for the other group. In such case, the user will only see those problems either matching the defined tag filter that haves at least a tag name defined or, for the other group, those that have ANY tag defined, but not those without tags. Check the following screenshots: 01: Here you see all problems currently existing, viewed as Super Admin. Spread over two host groups, two of the three problems have tags defined, one not. 02: Permissions for the group where one user is in, read write permissions for both groups: 03: tag filters for this user group: "all tags" for one group, "defined tag name" for the other group: 04: problems seen by the user being part of that group: missing the problem which has no tag defined: 05: changing the tag filters to be as in your example, both set to "all tags" (which in fact is useless, because it is the same as actually not defining any tag filters at all): 06: now the user sees all three problems
The use case we want to achieve is:
|
Comment by Christian Anton [ 2020 Oct 08 ] |
+++++ Does the above explanation help you to reproduce the bug? |
Comment by Christian Anton [ 2020 Nov 04 ] |
could someone please look into this? This issue is still in "needs info" even though I have supplied exact info on 6th of October! |
Comment by Alexander Vladishev [ 2025 Feb 11 ] |
This happens due to an incorrect condition in the SQL query when there is a combination of a tag filter with specified tags and without them. In this case, a JOIN is performed with the "problem_tag" table, which contains no records for events without tags. Replacing the condition with a LEFT JOIN should resolve the issue. SELECT DISTINCT p.eventid,p.objectid,p.clock,p.ns,p.name,p.severity,p.cause_eventid - FROM problem p,functions f,items i,host_hgset hh,permission pp,hosts_groups hg,problem_tag pt + FROM problem p LEFT JOIN problem_tag pt WHERE p.eventid=pt.eventid,functions f,items i,host_hgset hh,permission pp,hosts_groups hg WHERE p.source=0 AND p.object=0 AND p.objectid=f.triggerid AND f.itemid=i.itemid AND i.hostid=hh.hostid AND hh.hgsetid=pp.hgsetid AND pp.ugsetid=2 AND NOT EXISTS ( SELECT NULL FROM functions f1 JOIN items i1 ON f1.itemid=i1.itemid JOIN host_hgset hh1 ON i1.hostid=hh1.hostid LEFT JOIN permission pp1 ON hh1.hgsetid=pp1.hgsetid AND pp1.ugsetid=pp.ugsetid WHERE p.objectid=f1.triggerid AND pp1.permission IS NULL ) AND i.hostid=hg.hostid - AND p.eventid=pt.eventid AND ((hg.groupid='2' AND pt.tag='component' AND pt.value='system') OR hg.groupid=4) AND NOT EXISTS ( SELECT NULL FROM event_suppress es WHERE es.eventid=p.eventid ) AND p.cause_eventid IS NULL AND (p.r_eventid IS NULL OR p.r_clock>1739257010) ORDER BY p.eventid DESC LIMIT 1001 |
Comment by Alexander Vladishev [ 2025 Feb 11 ] |
This issue has been forwarded to the development team. |