[ZBX-24091] User macros are no longer resolved in function part of error message for triggers and calculated items Created: 2024 Feb 14  Updated: 2024 Apr 10  Resolved: 2024 Apr 02

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 6.4.12rc1, 7.0.0beta2
Fix Version/s: 6.4.14rc1, 7.0.0beta3, 7.0 (plan)

Type: Problem report Priority: Trivial
Reporter: Sergejs Olonkins Assignee: Dmitrijs Goloscapovs
Resolution: Fixed Votes: 0
Labels: errormessage, macro, resolution
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: JPEG File Ekrānuzņēmums 2024-03-19 161132.jpg     PNG File image-2024-02-14-13-55-27-943.png     PNG File image-2024-02-14-14-03-12-381.png     PNG File screenshot-1.png    
Team: Team A
Sprint: S24-W10/11, S24-W12/13
Story Points: 0.3

 Description   

Problem description: User macros are no longer resolved in function part of error messages that occur when something is wrong in trigger expression or calculated item formula.

For example, there's a host with 2 user macros "{$A}" and "{$B}" that have some values. The same host has a trapper item and a trigger with the following expression: 
find(/test/trap,{$B},"eq",{$A})=0
Let's imagine that one of these macros has a type-o in it's value, then the error message that would be displayed is the following:

From this error message it is not clear which macro has the wrong value, because user macros are not resolved in the function part of this error message.

In 6.0 the behavior is different - the macros are expanded both in function part and the error part of the error message:

Steps to reproduce:

  1. Create a host with the following 2 User macros:
    1. {$A} = 1q
    2. {$B} = 1h
  2. Create a trapper item with value type numeric(unsigned) for this host
  3. Create a trigger for this host with the following expression: find(/test/trap,{$B},"eq",{$A})=0
  4. Send any numeric value to the created trapper item
  5. Check the error message displayed for the trigger in Data collection => Hosts => <Created host> => Triggers

Result: In the error message, macros are not resolved in the trigger function part and it's unclear from the error message which macro value caused the error.
Expected: Same as in 6.0, macros should be resolved in the function part of the error message



 Comments   
Comment by Dmitrijs Goloscapovs [ 2024 Mar 28 ]

Available in versions:

Generated at Fri May 02 01:47:57 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.