[ZBX-22180] Unable to generate graph preview when using depend items Created: 2023 Jan 08  Updated: 2024 Apr 10  Resolved: 2023 Aug 22

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 6.0.12
Fix Version/s: None

Type: Problem report Priority: Trivial
Reporter: Pr2 Assignee: Zabbix Development Team
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File Zabbix-Graph-Preview-issue.txt     PNG File image-2023-01-19-14-18-00-729.png     PNG File image-2023-01-19-14-18-29-987.png    
Issue Links:
Duplicate
duplicates ZBX-18288 Undefined offset runtime error in Gra... Closed
Team: Team C
Sprint: Sprint 103 (Aug 2023)

 Description   

Steps to reproduce:

  1. Create a template with a discovery rule
  2. Create an item that retrieve a Json object (test.here.message_ALL_last1day{#CUSTOMER}
  3. Based on this items create dependent item that extract a value for:
  4.  
  5.  

Result:
See screenshot...
See log file...
See memory dump...
Expected:
See screenshot....
See attached patch file...



 Comments   
Comment by Pr2 [ 2023 Jan 08 ]

Sorry posted too fast:

 

Zabbix 6.0.12 LTS

Steps to reproduce:

Create a template with a discovery rule
Create an item that retrieve a Json object (test.here.message_ALL_last1day{#CUSTOMER}
Based on this items create dependent item that extract a value for: test.here.Test"{#CUSTOMER}" with a preprocessing:
$JSONPATH $.MyValue
Now create a Graph Prototype to display this dependent items: test.here.Test"{#CUSTOMER}"

{#CUSTOMER}{#CUSTOMERTYPE} Test value to display

Press Preview on it you will get an error:

[Sun Jan 08 11:18:54.622502 2023] [php7:notice] [pid 931660] [client 172.123.123.123:49106] PHP Notice:  Undefined offset: 439000 in /opt/local/share/httpd/htdocs/zabbix/include/classes/graphdraw/CLineGraphDraw.php on line 2034, referer: http://zabbix.internal.local/graphs.php?form=update&parent_discoveryid=267980&graphid=88242&context=template
[Sun Jan 08 11:18:54.622755 2023] [php7:notice] [pid 931660] [client 172.123.123.123:49106] PHP Notice:  Trying to access array offset on value of type null in /opt/local/share/httpd/htdocs/zabbix/include/classes/graphdraw/CLineGraphDraw.php on line 2036, referer: http://zabbix.internal.local/graphs.php?form=update&parent_discoveryid=267980&graphid=88242&context=template
[Sun Jan 08 11:18:54.622794 2023] [php7:notice] [pid 931660] [client 172.123.123.123:49106] PHP Notice:  Trying to access array offset on value of type null in /opt/local/share/httpd/htdocs/zabbix/include/classes/graphdraw/CLineGraphDraw.php on line 2037, referer: http://zabbix.internal.local/graphs.php?form=update&parent_discoveryid=267980&graphid=88242&context=template
  

Result:

No graph preview is displayed and the graph itself doesn't work neither.

Expected:

The graph should work.

 

 

Comment by Pr2 [ 2023 Jan 08 ]

Correction only graph preview failed the graph itself is displayed fine.

Comment by Edgars Melveris [ 2023 Jan 10 ]

I could not reproduce the issue on a clean installation - graph is displayed (empty of course as there is no data) and no errors are displayed.

Can you reproduce the issue on a new clean installation? What OS and web server are you using?

Comment by Pr2 [ 2023 Jan 10 ]

Hi,

Thanks for taking by bug report into consideration.

 

I am running Zabbix 6.0.12 (homebuild) on SmartOS running php 7.4, it is a migrated version a few month ago of a Zabbix 4 LTS installation.

Migration went fine and Zabbix is running really fine.

 

I don't have this problem with all the graph preview only on some of them, the fact is the item to display were formerly of type Zabbix active (which was behind it calling a custom script that launch a SQL query),  I change the type from Zabbix Active to Dependent item with JSONpath since I now get all the data from one SQL query that return a JSON object.So by doing this keeping the item name and changing the type I don't lose the item history.

 

The graph itself is displaying really fine it's just the preview of it the doesn't work.

I already tried to discard the graph and create it again and same preview issue. So i guess that it is with the item definition that it has a problem.

Here is the debug output, I hope you will find more information out of it:

 

Zabbix-Graph-Preview-issue.txt

 

Regards

Comment by Pr2 [ 2023 Jan 10 ]

information added.

Comment by Pr2 [ 2023 Jan 19 ]

Why do you set it back into NEED INFO?  I gave you the INFO.

Comment by Edgars Melveris [ 2023 Jan 19 ]

Indeed looks like dependent items cause this.

It can be reproduced with default "Linux by Zabbix agent" template:

"{#DEVNAME}: Disk average waiting time" doesn't use dependent items and is displayed normally.
But other two that use dependent items show an error:

 

Comment by Janis Freibergs [ 2023 Aug 22 ]

Problem was already fixed in ZBX-18288, confirmed does not reproduce on v6.0.21rc1.

Generated at Sat Apr 19 04:48:41 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.