[ZBX-15145] Graphics Time Interval works only on first time Created: 2018 Nov 08  Updated: 2019 Jan 27  Resolved: 2018 Dec 27

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

Type: Incident report Priority: Minor
Reporter: Rodrigo Dewes Assignee: Unassigned
Resolution: Workaround proposed Votes: 0
Labels: frontend, graph, time
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Linux Server, Chrome on Linux


Attachments: PNG File Captura de tela de 2018-11-08 15-32-43.png    

 Description   

Steps to reproduce:

  1. Choose a Graph in Monitoring > Graphs
  2. Click on the new time period
  3. Click in one, for example, last 6 hours
  4. Now click on another, this month

Result:

It works when selecting the first of the time intervals but any other after that it will not work or update. After a page reload I can choose another, but it only works for the first selected.

Expected:
To work for every of the time intervals everytime.

 

 

Also, I get some JS errors:

jsLoader.php?ver=4.0.1&lang=pt_BR&showGuiMessaging=1&files[]=class.calendar.js&files[]=gtlc.js&files[]=flickerfreescreen.js&files[]=layout.mode.js&files[]=servercheck.js:1662 Uncaught TypeError: Cannot read property 'id' of undefined
at Object.refreshAll (jsLoader.php?ver=4.0.1&lang=pt_BR&showGuiMessaging=1&files[]=class.calendar.js&files[]=gtlc.js&files[]=flickerfreescreen.js&files[]=layout.mode.js&files[]=servercheck.js:1662)
at Object.<anonymous> (jsLoader.php?ver=4.0.1&lang=pt_BR&showGuiMessaging=1&files[]=class.calendar.js&files[]=gtlc.js&files[]=flickerfreescreen.js&files[]=layout.mode.js&files[]=servercheck.js:1196)
at Object.dispatch (jsLoader.php?ver=4.0.1&lang=pt_BR&showGuiMessaging=1:12133)
at Object.elemData.handle (jsLoader.php?ver=4.0.1&lang=pt_BR&showGuiMessaging=1:11804)
at Object.trigger (jsLoader.php?ver=4.0.1&lang=pt_BR&showGuiMessaging=1:12045)
at Object.<anonymous> (jsLoader.php?ver=4.0.1&lang=pt_BR&showGuiMessaging=1:12729)
at Function.each (jsLoader.php?ver=4.0.1&lang=pt_BR&showGuiMessaging=1:7695)
at init.each (jsLoader.php?ver=4.0.1&lang=pt_BR&showGuiMessaging=1:7304)
at init.trigger (jsLoader.php?ver=4.0.1&lang=pt_BR&showGuiMessaging=1:12728)
at Function.$.publish (jsLoader.php?ver=4.0.1&lang=pt_BR&showGuiMessaging=1&files[]=class.calendar.js&files[]=gtlc.js&files[]=flickerfreescreen.js&files[]=layout.mode.js&files[]=servercheck.js:767)

 



 Comments   
Comment by Aigars Kadikis [ 2018 Dec 06 ]

Hello Rodrigo,

Your dedicated scenario should work. Switching zoom does not require to reload page inside browser.

Please try crear browser cache. Make sure you do not have some extensions active in Chrome which can manage some scripting. Try guest/incognito mode. Try different browser.

Does your front-end version (on the bottom of screen) match with the version of zabbix daemon?

zabbix_server -V

Regards,

Comment by Sven Schiwek [ 2018 Dec 17 ]

Hi,
I have the same problem with Zabbix 4.0.2 (Zabbix packages installed from Debian testing)

Firefox 63.0.3 error message is:

TypeError: screen is undefined[Learn More]		jsLoader.php:1660:9
refreshAll		https://mydomain/zabbix/jsLoader.php:1660:9
<anonymous>		https://mydomain/zabbix/jsLoader.php:1194:3
dispatch		https://mydomain/zabbix/jsLoader.php:12132:15
add/elemData.handle	https://mydomain/zabbix/jsLoader.php:11804:6
trigger			https://mydomain/zabbix/jsLoader.php:12045:5
trigger/<		https://mydomain/zabbix/jsLoader.php:12729:4
each			https://mydomain/zabbix/jsLoader.php:7695:14
each			https://mydomain/zabbix/jsLoader.php:7304:10
trigger			https://mydomain/zabbix/jsLoader.php:12728:10
$.publish		https://mydomain/zabbix/jsLoader.php:757:3
success			https://mydomain/zabbix/jsLoader.php:981:6
fire			https://mydomain/zabbix/jsLoader.php:10086:10
fireWith		https://mydomain/zabbix/jsLoader.php:10198:7
done			https://mydomain/zabbix/jsLoader.php:15273:5
callback		https://mydomain/zabbix/jsLoader.php:15816:8

Also Apple Safari 12.0.2 throws the same error message.

Zabbix version:

# zabbix_server -V
zabbix_server (Zabbix) 4.0.2
Revision 87228 26 November 2018, compilation time: Dec  6 2018 02:57:56

Copyright (C) 2018 Zabbix SIA
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it according to
the license. There is NO WARRANTY, to the extent permitted by law.

Compiled with GnuTLS 3.5.19
Running with GnuTLS 3.5.19
Comment by Aigars Kadikis [ 2018 Dec 18 ]

Hello Sven,

Thanks for coming back. Now I start to wonder what can be the root cause. What exactly you meant by "Debian testing"?

Did you install Zabbix using repo?:

https://repo.zabbix.com/zabbix/4.0/debian/pool/main/z/zabbix-release/zabbix-release_4.0-2+stretch_all.deb

Can it be possible you have an HTTP proxy server between the client and Zabbix server? Any HA (High Availability) setup on the frontend.

Comment by Sven Schiwek [ 2018 Dec 19 ]

Hi Aigars,

We installed the Zabbix packages via the official Debian repositories (Testing release) with the normal Debian package manager "apt-get".
The Urls are:
http://ftp.us.debian.org/debian/pool/main/z/zabbix/zabbix-server-mysql_4.0.2%2bdfsg-1_amd64.deb
http://ftp.us.debian.org/debian/pool/main/z/zabbix/zabbix-agent_4.0.2%2bdfsg-1_amd64.deb
http://ftp.us.debian.org/debian/pool/main/z/zabbix/zabbix-frontend-php_4.0.2%2bdfsg-1_all.deb

In our environment we have no proxy or firewall between the Zabbix Server and the browser.
However our Zabbix server got migrated from time to time with the normal Zabbix migration documentation (I believe the initial setup version was a 2.2 version). Maybe there is a difference between a migrated and a fresh installed Zabbix Server ...

Comment by Sven Schiwek [ 2018 Dec 19 ]

Hi Aigars,

to verify my idea about a potential problem with the Zabbix migration process I created a new VMware instance an installed a fresh Debian 10 (alias Buster) and Zabbix (4.0.2).
The problem is also visible on this plain new installation without any modifications. Therefor it's not a migration problem.

Do you know if the PHP version could be a problem? Debian 10 (alias Buster) is shipped with version 7.3.0.

Comment by Aigars Kadikis [ 2018 Dec 27 ]

Hello Sven,

Thank you for investigation. Currently I am looking at the appliance version 4.0.3 of Zabbix which hosts on the top of Ubuntu (also Debian kind of distribution). I can see there is PHP version 7.0.32 used.

Hopefully, Zabbix will be supported on Debian 10 (Buster) when the Buster will come out stable somewhere in 2019.

Right now I will close the issue as Workaround proposed.

You can see currently supported Debian versions at:

https://www.zabbix.com/download?zabbix=4.0&os_distribution=debian&os_version=stretch&db=MySQL

Keep up the good work!

Comment by richlv [ 2018 Dec 27 ]

Zabbix requirements state that PHP "5.4.0 or later" is supported, thus one might expect PHP 7.3.0 to work.

It also seems that the cause for the problem has not been determined yet, is that correct?

Comment by Aigars Kadikis [ 2018 Dec 27 ]

Yes, richlv. We do not know the root cause yet.

Either not quite sure if it is safe to use packages from other sources than repo.zabbix.com.

Comment by richlv [ 2018 Dec 27 ]

It seems crucial that the official distribution packages of Zabbix work flawlessly.

Sven, to eliminate the possibility of Debian patches causing any issues, can you please try with a vanilla Zabbix frontend of the same version? You can grab it from the Zabbix sources or SVN, place in a separate directory and copy over the config file.

Comment by Mark Presling [ 2019 Jan 09 ]

For future reference: This is caused by the Debian packaging of the app replacing the source prototype.js (1.6.1) with the version provided by the Debian package libjs-prototype which is version 1.7.1. 

# ls -al `dpkg -L zabbix-frontend-php | grep prototype.js`
lrwxrwxrwx 1 root root 42 Dec 24 18:55 /usr/share/zabbix/js/vendors/prototype.js -> ../../../javascript/prototype/prototype.js

This appears to be for security/maintenance reasons.

@Aigars Kadikis, is there any chance that flickerfreescreen.js could be updated to loop through the "prototyped" Array object using Object.keys() so that it doesn't loop through all the functions as well? 'toJSON' is undefined, which causes it to blow up.

Here's an example of what does work:

Object.keys(window.flickerfreeScreen.screens).forEach((value, index) => {
    console.log(index, value, window.flickerfreeScreen.screens[value]);
})

I think there might be a few places where flickerfreescreen.js is using associative arrays (which don't really exist in JS) naively - but I'm not a Javascript person, so I can't be sure what the norm is these days.

Comment by Sven Schiwek [ 2019 Jan 27 ]

The prototype.js problem is fixed in Debian package version 4.0.3+dfsg-2 (see also https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=919496) and related bug ZBX-15040

# ls -al `dpkg -L zabbix-frontend-php | grep prototype.js`
-rw-r--r-- 1 root root 142414 Dec 20 05:24 /usr/share/zabbix/js/vendors/prototype.js

Graphics time interval works again.

Generated at Sun Apr 06 18:04:36 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.