[ZBX-20765] Empty PDF file is generated by Scheduled Reports Created: 2022 Mar 18 Updated: 2024 Sep 19 Resolved: 2024 Mar 01 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Frontend (F), Server (S) |
Affects Version/s: | 6.0.6 |
Fix Version/s: | 6.0.28rc1, 6.4.13rc1, 7.0.0beta1, 7.0 (plan) |
Type: | Problem report | Priority: | Major |
Reporter: | Takashi Yoshihara | Assignee: | Andrejs Verza |
Resolution: | Fixed | Votes: | 11 |
Labels: | None | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified | ||
Environment: |
Zabbix 6.0.0 |
Attachments: |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
||||||||||||||||||||||||||||||||
Issue Links: |
|
||||||||||||||||||||||||||||||||
Team: | |||||||||||||||||||||||||||||||||
Sprint: | Sprint 91 (Aug 2022), Sprint 92 (Sep 2022), Sprint 93 (Oct 2022), Sprint 94 (Nov 2022), Sprint 95 (Dec 2022), Sprint 96 (Jan 2023), Sprint 97 (Feb 2023), Sprint 98 (Mar 2023), Sprint 99 (Apr 2023), Sprint 100 (May 2023), Sprint 101 (Jun 2023), Sprint 102 (Jul 2023), Sprint 103 (Aug 2023), Sprint 104 (Sep 2023), Sprint 105 (Oct 2023), Sprint 106 (Nov 2023), Sprint candidates, S2401-1, S2401-2 | ||||||||||||||||||||||||||||||||
Story Points: | 0.5 |
Description |
Sometimes an empty PDF is created. Steps to reproduce:
Result: One succeeds, the other fails. |
Comments |
Comment by Nathan Slusher [ 2022 Jun 23 ] |
We are also experiencing this issue. Most of the time reports are sent with correct PDFs but sometimes they are blank. We have tried increasing the timeout value to the max of 30 seconds in /etc/zabbix/zabbix_web_service.conf but it has not fixed the issue. |
Comment by Nathan Slusher [ 2022 Jun 23 ] |
I believe this issue is caused by the way the web service is waiting for the page to load. In the source code for the web service there is this comment in the pdf_report_creator.go file:
// This comment is taken from the proof of concept example // // waitFor blocks until eventName is received. // Examples of events you can wait for: // init, DOMContentLoaded, firstPaint, // firstContentfulPaint, firstImagePaint, // firstMeaningfulPaintCandidate, // load, networkAlmostIdle, firstMeaningfulPaint, networkIdle // // This is not super reliable, I've already found incidental cases where // networkIdle was sent before load. It's probably smart to see how // puppeteer implements this exactly. func waitFor(ctx context.Context, eventNames []string) error { ...
The code is currently only listening for the "networkIdle" event but there may be a case where that event fires but the page is not fully loaded yet. I have modified the code to listen for both the "networkIdle" and "load" events before creating the report to hopefully fix this issue. I uploaded my modified version of the pdf_report_creator.go file to this ticket. I am not a GO programmer so the implementation may not be best practice. |
Comment by Nathan Slusher [ 2022 Jun 27 ] |
Unfortunately waiting for both the "networkIdle" and "load" events did not resolve the issue - when the issue happens the PDF is no longer blank but the dashboard widgets were not fully loaded. The log for that report did indicate that the "networkIdle" event fired before the "load" event: 2022/06/25 00:00:06.230499 received report request from 127.0.0.1:38314 2022/06/25 00:00:06.230907 making chrome headless request with parameters url: https://www.website.com/zabbix.php?action=dashboard.print&dashboardid=68&from=2022-06-24%2000%3A00%3A00&to=2022-06-25%2000%3A00%3A00, width: 1920, height: 572 for report request from 127.0.0.1:38314 2022/06/25 00:00:07.463019 fired networkAlmostIdle event 2022/06/25 00:00:07.463187 fired networkIdle event 2022/06/25 00:00:07.463199 hit expected networkIdle event 2022/06/25 00:00:07.464102 fired init event 2022/06/25 00:00:07.769960 fired load event 2022/06/25 00:00:07.769993 hit expected load event 2022/06/25 00:00:07.770002 hit all expected events 2022/06/25 00:00:07.921801 writing response for report request from 127.0.0.1:38314 A different implementation will be needed to account for this behavior. |
Comment by Frantisek [ 2023 Jan 02 ] |
Hello, would it be possible to please move the solution and not just move it six months to the next sprint? I would appreciate if this functionality would be functional. Thank you so much |
Comment by dimir [ 2023 Dec 08 ] |
Looks like the same issue as described here: ZBX-23634 Currently there is no mechanism in Dashboard widget framework to tell some widget is fully loaded. Basically, the browser opens a specific widget using URL and then takes a screenshot. And there is no way to tell if it is fully loaded or not. Such functionality must be implemented in Dashboard widget framework. |
Comment by Vladislavs Sokurenko [ 2023 Dec 08 ] |
This is because networkIdle is used, see: Should we add WaitVisible functionality ? |
Comment by Connor McBrine-Ellis [ 2023 Dec 20 ] |
I would like Zabbix to prioritize this one as it means Scheduled Reports are basically useless since you can never be sure if it will generate properly or if the report will be empty. |
Comment by Mihails Prihodko [ 2023 Dec 20 ] |
mcbrineellis, this task is in progress now. |
Comment by Andrejs Verza [ 2024 Jan 26 ] |
Available in versions:
|