New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When using Realtime, race conditions between browser and function loading can occur #3538
Comments
You must have a problem with file permissions. Check the realtime.js is readable by the browser. You did not indicate your Cacti version as well. Suggest you update to 1.2.12 if that is not the version you are running. |
Sorry, I did leave out the versioning. This started to happen after upgrading to 1.2.12. We were on 1.2.10 prior and it was working fine. It is only Chrome based browsers and it is happening across various OS platforms, users, and PCs. We use Cacti heavily for work and my entire team is having this issue. It is only on pop-out, not inline. It's happening on Win10, MacOS, and Ubuntu linux when using Chrome based browsers. Firefox works on all of the above. If it's a permissions thing, then it is happening at a common level like Chrome based browsers. Not sure what to check and how to check. |
OK, so you are using realtime in popup mode and that experiences the above error in the console? I'll give it a try on my basic setup and see if I get the same. |
So here is the breakdown which concurs with what @TheWitness said earlier, something is blocking access to the realtime.js script. Whether that is file permissions or browser security, you'd have to investigate but basically realtime.js is included by |
Btw, just for reference, |
I think it has to be something else. Here are 3 things I've just tried.
I've scoured through our anti-virus and other security tools and disabled them and don't see anything in their logs. I see the same results on an Ubuntu 19.04 box, fresh OS install, running Chrome doesn't work; Firefox does. Some other weirdness I see is once the realtime popup window comes up, it doesn't load as we know. If I change any of the drop-downs or check the thumbnails checkbox it refreshes the window, I see the graph now with data but it's not not auto refreshing. If I check the thumbnails checkbox or change a drop down again, the graphs refreshes once again with new/good data, but doesn't auto refresh. It just sits there. So, I threw in an alert in the imageOptionsChanged() function to see when it was being fired. The only time I get an alert is when I'm manually checking the dropdowns/thumbnails checkbox at the top. I don't see it firing when I first load the popup window. I'm not going against what you guys are saying, I'm just stumped and want to see what is needed to fix it even if it's something on my side. |
Automatic refresh works off setTimeout so that should work unless chrome seems that the source is a long running script. Do you see any other errors or warning s? |
Another quick update. I've commented out the imageOptionsChanged function in the jQuery onload function and now realtime is working in the popup for Chrome. I don't get the graph initially, it does load after the first timer (5 seconds in this case). I'm assuming that's because the imageOptionsChanged('init') function didn't run. |
Thanks I’ll take a look and see whether I can See why |
Testing the code change for the window onload from #3587 is working for me now. Tested on a few of our 'troubled' PCs and all are good now. I had the thought that the jQuery onload was loading before realtime.js was fully loaded. Wasn't sure exactly how to test that. |
When doing real-time in a new window, the graph does not render. Looks to be jquery based as there is a error in the console regarding "ImageOptionsChanged is not defined".
Chrome version 81
Edge version 81
Firefox - works in any version
I've tried clearing the cacti realtime cache directory.
I've tried clearing browser cache (all options, cleared for all time)
Realtime inline in the browser works fine, only affected from New Window realtime window.
The text was updated successfully, but these errors were encountered: