Skip to content
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

[Reporting] Kibana normal PDF reports have cut visualizations and printable PDFs have cut labels #89555

Closed
dminovski0 opened this issue Jan 28, 2021 · 19 comments · Fixed by #98688
Labels
blocked bug Fixes for quality problems that affect the customer experience (Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. loe:small Small Level of Effort PR sent

Comments

@dminovski0
Copy link

dminovski0 commented Jan 28, 2021

Kibana version: 7.10.2

Elasticsearch version: 7.10.2

Server OS version: Managed by elastic.co, Azure

Browser version: Chrome 88.0.4324.104

Browser OS version: Windows 10 64-bit

Original install method (e.g. download page, yum, from source, etc.): apt-get from official documentation

*Describe the bug: Two bugs:

  1. The PDF normal reports' visualizations are cut towards the bottom if the dashboards are longer.
  2. When selecting a printing optimized report, if the labels of the visualizations are longer, they continue past their boundaries and break out of the page.*

Steps to reproduce:

  1. Go to the dashboard, click Share from the top menu -> PDF reports.
  2. For the first bug, leave Optimize for printing on OFF, for the second toggle it to be ON.
  3. Click Generate PDF.

Expected behavior: The reports in Stack Management -> Alerts and Insights -> Reporting -> should be whole and uncut.

*Screenshots (if relevant):
Cut visualizations in normal PDF printing, their titles are at the top of the images, but their bodies are below or missing.
Cut visualizations
Cut labels in printable optimized PDF printing, they overflow through the page's boundaries on the right side.
Cut labels in printable PDF

Errors in browser console (if relevant):

Provide logs and/or server output (if relevant):

*Any additional context: In Kibana's Status page, the Heap total is 1.42 GB and during the printing, the heap used went up to 200 MB.

@dminovski0 dminovski0 added the bug Fixes for quality problems that affect the customer experience label Jan 28, 2021
@dminovski0 dminovski0 changed the title Kibana normal PDF reports have cut visualization and printable PDF have cut labels Kibana normal PDF reports have cut visualization and printable PDFs have cut labels Jan 28, 2021
@dminovski0 dminovski0 changed the title Kibana normal PDF reports have cut visualization and printable PDFs have cut labels Kibana normal PDF reports have cut visualizations and printable PDFs have cut labels Jan 28, 2021
@tsullivan
Copy link
Member

Could be a duplicate of #85864 which was opened and fixed for 7.11

However, #85066 should not have been backported to 7.10, so I'm not sure how the issue would be present in 7.10

@dminovski0
Copy link
Author

dminovski0 commented Feb 5, 2021

@tsullivan
Thanks for the reply.
We are using a cluster on the cloud, and the latest version we can upgrade to is 7.10.2. There isn't an option for 7.11.

@tsullivan
Copy link
Member

Understood thanks.

I was not able to repro on a Linux server. I'll try Windows next.

@tsullivan tsullivan added (Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead Team:AppServices labels Feb 24, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-services (Team:AppServices)

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-reporting-services (Team:Reporting Services)

@tsullivan
Copy link
Member

Depends on #90496

@marekduciuc
Copy link

The user with thsi https://github.com/elastic/sdh-kibana/issues/1316 would thi to be fixed ASAP is there any ETA for fix?

@ppisljar
Copy link
Member

we need to build a new version of chromium, @tsullivan is working on it. @tsullivan do you think this is gonna make 7.13?

@tsullivan
Copy link
Member

@tsullivan do you think this is gonna make 7.13?

It's planned for 7.14

@tsullivan
Copy link
Member

tsullivan commented Mar 25, 2021

The new build will allow us to stop increasing the browser viewport size before capture, which causes rendering artifacts because the embeddables are forced to re-render (they have resize handlers). That is one cause of failures with large dashboards.

Another cause is that Chromium limits the size of a screenshot capture to 16384 pixels. Earlier code in Kibana (before we had Puppeteer) did have a solution for this: https://github.com/elastic/kibana/pull/21788/files#diff-9744794bc3db91c2ab0e7eecbbf1664cde77fa26e10b95ff981b6b2dc8f2f893L94. That code was removed - maybe there was a misunderstanding in thinking that Puppeteer provided that.

The two things that need to happen for this:

  • get a new build, update Chromium version, go back to resizing the viewport once
  • re-introduce the screenshotStitcher code from 6.4

@tsullivan
Copy link
Member

tsullivan commented Apr 23, 2021

This will be fixed along with #90496

@exalate-issue-sync exalate-issue-sync bot added impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort loe:medium Medium Level of Effort and removed loe:small Small Level of Effort labels Apr 26, 2021
@exalate-issue-sync exalate-issue-sync bot changed the title Kibana normal PDF reports have cut visualizations and printable PDFs have cut labels [Reporting] Kibana normal PDF reports have cut visualizations and printable PDFs have cut labels May 2, 2021
@exalate-issue-sync exalate-issue-sync bot added impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. and removed impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. labels May 2, 2021
@petrklapka petrklapka added the 1 label May 6, 2021
@petrklapka petrklapka added 1 and removed 1 labels May 6, 2021
@exalate-issue-sync exalate-issue-sync bot added loe:small Small Level of Effort and removed loe:medium Medium Level of Effort labels Dec 9, 2021
@dminovski0
Copy link
Author

@tsullivan Using Kibana 7.17.0, the medium-sized dashboards are getting their visualizations cut and partially grayed out again. Is this #90496 Puppeteer upgrade applied to 7.17.0, or only to 8.0?

@tsullivan
Copy link
Member

@dminovski0 sorry about this, but there is a newer issue (7.16+) regarding images in a PDF or PNG of a dashboard appearing stretched or blank. Can you check if your customer is facing this issue: https://github.com/elastic/sdh-kibana/issues/2510#

@dminovski0
Copy link
Author

dminovski0 commented Mar 7, 2022

@tsullivan The link leads to Page not found. Yes, some of the visualizations appear blank:
image

@tsullivan
Copy link
Member

@dminovski0

The link leads to Page not found

That's strange. Did maybe you try to access it in a non-logged-in browser?

Based on your screenshot it sounds like this is the same issue. I paste the same advice as stated in that issue:

  • (...) If they are running on a fairly low-resource machine they can consider upgrading CPU/RAM and see how this affects report generation
  • Canvas is generally a more reliable reporting tool since the sizes of elements are more stable (fixed page sizes). They can migrate their dashboard to this and continue generating reports from there instead

@dminovski0
Copy link
Author

@tsullivan I'm logged in.

image

I tried with 32GB RAM and Kibana 7.17.0 on Windows 10 Pro connected to the cloud cluster, and there are blank visualizations. But the location of the visualizations that get blank is different. With Windows Kibana, the blankness is in the top right half of the dashboard.
With Windows, setting the --max-old-space-size=32768 in node.options doesn't seem to increase the RAM in the app status page on the route http://localhost:5601/app/status. Adding this parameter to /bin/kibana.bat then shows the RAM as increased.

image

With Ubuntu Kibana and 4 GB RAM, the blankness appears in the bottom left half.

image

@dminovski0
Copy link
Author

I tried this with Kibana 8.1.1 hosted locally on Windows. The reporting job fails when printing a PDF or PNG with an error message Error: Max attempts (3) reached for job l14sirv90d8008096af87pf0. Failed with: Error: Protocol error (Page.captureScreenshot): Unable to capture screenshot.
The dashboard has Height in pixels 30668 px, Width in pixels 1904 px, and about 200 visualizations.
Printing an "Optimize for printing" PDF, it prints with a warning only the first two visualizations on a single PDF page, and there is only that page.
The RAM is set to 32 GB with --max-old-space-size=32768.
Kibana 8 1 1 PDF create report error info
.
image

@tsullivan
Copy link
Member

tsullivan commented Mar 31, 2022

The RAM is set to 32 GB with --max-old-space-size=32768.

@dminovski0 The system RAM is 32 GB? 32768 megabytes is 32 GB. If you have Node reserve all of the system's RAM, there won't be enough free RAM for the spawned Chromium process that needs to open the Kibana tab on the server.

@dminovski0
Copy link
Author

@tsullivan I tried setting the RAM to --max-old-space-size=4096, and 8192 and 16384, in kibana.bat, and nothing in node.options. This is Elastic and Kibana 8.1.1. The same message gets returned: Failed with: Error: Protocol error (Page.captureScreenshot): Unable to capture screenshot on Chrome and Firefox.

[2022-03-31T22:30:23.742+02:00][INFO ][plugins.screenshotting.screenshot] handled 150 page requests
[2022-03-31T22:30:38.687+02:00][INFO ][plugins.screenshotting.screenshot] timeRange: Mar 31, 1962 @ 22:30:24.835 to Mar 31, 2022 @ 22:30:24.835
[2022-03-31T22:30:38.689+02:00][INFO ][plugins.screenshotting.screenshot] taking screenshots
[2022-03-31T22:30:43.749+02:00][ERROR][plugins.reporting.runTask.printablePdfV2.printable_pdf_v2.execute-job.l1fgb8db04rk08096aaap4jc] Error: Protocol error (Page.captureScreenshot): Unable to capture screenshot
at D:\ELK\kibana-8.1.1-windows-x86_64\kibana-8.1.1\node_modules\puppeteer\lib\cjs\puppeteer\common\Connection.js:217:63
at new Promise ()
at CDPSession.send (D:\ELK\kibana-8.1.1-windows-x86_64\kibana-8.1.1\node_modules\puppeteer\lib\cjs\puppeteer\common\Connection.js:216:16)
at Page._screenshotTask (D:\ELK\kibana-8.1.1-windows-x86_64\kibana-8.1.1\node_modules\puppeteer\lib\cjs\puppeteer\common\Page.js:1958:43)
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)
[2022-03-31T22:30:43.754+02:00][ERROR][plugins.reporting.runTask] Error: Protocol error (Page.captureScreenshot): Unable to capture screenshot
at D:\ELK\kibana-8.1.1-windows-x86_64\kibana-8.1.1\node_modules\puppeteer\lib\cjs\puppeteer\common\Connection.js:217:63
at new Promise ()
at CDPSession.send (D:\ELK\kibana-8.1.1-windows-x86_64\kibana-8.1.1\node_modules\puppeteer\lib\cjs\puppeteer\common\Connection.js:216:16)
at Page._screenshotTask (D:\ELK\kibana-8.1.1-windows-x86_64\kibana-8.1.1\node_modules\puppeteer\lib\cjs\puppeteer\common\Page.js:1958:43)
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)
[2022-03-31T22:30:43.761+02:00][INFO ][plugins.reporting.runTask] Rescheduling task:l1fgb8db04rk08096aaap4jc to retry after error.
[2022-03-31T22:30:45.180+02:00][INFO ][plugins.reporting.runTask.printablePdfV2.printable_pdf_v2.execute-job.l1fgb8db04rk08096aaap4jc] Generating request for space: hmm4
[2022-03-31T22:30:45.180+02:00][INFO ][plugins.reporting.runTask.printablePdfV2.printable_pdf_v2.execute-job.l1fgb8db04rk08096aaap4jc] Request uses Space ID: hmm4
[2022-03-31T22:30:45.181+02:00][INFO ][plugins.reporting.runTask.printablePdfV2.printable_pdf_v2.execute-job.l1fgb8db04rk08096aaap4jc] Creating UI Settings Client for space: hmm4
[2022-03-31T22:30:45.188+02:00][INFO ][plugins.screenshotting.screenshot.browser-driver] Creating browser page driver
[2022-03-31T22:30:45.394+02:00][INFO ][plugins.screenshotting.screenshot] opening url http://localhost:5601/s/hmm4/app/reportingRedirect?forceNow=2022-03-31T20%3A30%3A18.905Z
[2022-03-31T22:30:45.790+02:00][ERROR][plugins.screenshotting.screenshot.browser-driver.headless-browser-console] Error in browser console: { message: "Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
", url: "http://localhost:5601/s/hmm4/app/reportingRedirect?forceNow=2022-03-31T20%3A30%3A18.905Z" }
[2022-03-31T22:30:47.427+02:00][INFO ][plugins.screenshotting.screenshot] handled 150 page requests
[2022-03-31T22:31:02.736+02:00][INFO ][plugins.screenshotting.screenshot] timeRange: Mar 31, 1962 @ 22:30:48.531 to Mar 31, 2022 @ 22:30:48.531
[2022-03-31T22:31:02.746+02:00][INFO ][plugins.screenshotting.screenshot] taking screenshots
[2022-03-31T22:31:07.845+02:00][ERROR][plugins.reporting.runTask.printablePdfV2.printable_pdf_v2.execute-job.l1fgb8db04rk08096aaap4jc] Error: Protocol error (Page.captureScreenshot): Unable to capture screenshot
at D:\ELK\kibana-8.1.1-windows-x86_64\kibana-8.1.1\node_modules\puppeteer\lib\cjs\puppeteer\common\Connection.js:217:63
at new Promise ()
at CDPSession.send (D:\ELK\kibana-8.1.1-windows-x86_64\kibana-8.1.1\node_modules\puppeteer\lib\cjs\puppeteer\common\Connection.js:216:16)
at Page._screenshotTask (D:\ELK\kibana-8.1.1-windows-x86_64\kibana-8.1.1\node_modules\puppeteer\lib\cjs\puppeteer\common\Page.js:1958:43)
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)
[2022-03-31T22:31:07.847+02:00][ERROR][plugins.reporting.runTask] Error: Protocol error (Page.captureScreenshot): Unable to capture screenshot
at D:\ELK\kibana-8.1.1-windows-x86_64\kibana-8.1.1\node_modules\puppeteer\lib\cjs\puppeteer\common\Connection.js:217:63
at new Promise ()
at CDPSession.send (D:\ELK\kibana-8.1.1-windows-x86_64\kibana-8.1.1\node_modules\puppeteer\lib\cjs\puppeteer\common\Connection.js:216:16)
at Page._screenshotTask (D:\ELK\kibana-8.1.1-windows-x86_64\kibana-8.1.1\node_modules\puppeteer\lib\cjs\puppeteer\common\Page.js:1958:43)
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)
[2022-03-31T22:31:07.847+02:00][INFO ][plugins.reporting.runTask] Rescheduling task:l1fgb8db04rk08096aaap4jc to retry after error.
[2022-03-31T22:31:09.257+02:00][INFO ][plugins.reporting.runTask.printablePdfV2.printable_pdf_v2.execute-job.l1fgb8db04rk08096aaap4jc] Generating request for space: hmm4
[2022-03-31T22:31:09.257+02:00][INFO ][plugins.reporting.runTask.printablePdfV2.printable_pdf_v2.execute-job.l1fgb8db04rk08096aaap4jc] Request uses Space ID: hmm4
[2022-03-31T22:31:09.258+02:00][INFO ][plugins.reporting.runTask.printablePdfV2.printable_pdf_v2.execute-job.l1fgb8db04rk08096aaap4jc] Creating UI Settings Client for space: hmm4
[2022-03-31T22:31:09.263+02:00][INFO ][plugins.screenshotting.screenshot.browser-driver] Creating browser page driver
[2022-03-31T22:31:09.471+02:00][INFO ][plugins.screenshotting.screenshot] opening url http://localhost:5601/s/hmm4/app/reportingRedirect?forceNow=2022-03-31T20%3A30%3A18.905Z
[2022-03-31T22:31:09.844+02:00][ERROR][plugins.screenshotting.screenshot.browser-driver.headless-browser-console] Error in browser console: { message: "Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
", url: "http://localhost:5601/s/hmm4/app/reportingRedirect?forceNow=2022-03-31T20%3A30%3A18.905Z" }
[2022-03-31T22:31:11.240+02:00][INFO ][plugins.screenshotting.screenshot] handled 151 page requests
[2022-03-31T22:31:26.710+02:00][INFO ][plugins.screenshotting.screenshot] timeRange: Mar 31, 1962 @ 22:31:12.528 to Mar 31, 2022 @ 22:31:12.528
[2022-03-31T22:31:26.712+02:00][INFO ][plugins.screenshotting.screenshot] taking screenshots
[2022-03-31T22:31:31.769+02:00][ERROR][plugins.reporting.runTask.printablePdfV2.printable_pdf_v2.execute-job.l1fgb8db04rk08096aaap4jc] Error: Protocol error (Page.captureScreenshot): Unable to capture screenshot
at D:\ELK\kibana-8.1.1-windows-x86_64\kibana-8.1.1\node_modules\puppeteer\lib\cjs\puppeteer\common\Connection.js:217:63
at new Promise ()
at CDPSession.send (D:\ELK\kibana-8.1.1-windows-x86_64\kibana-8.1.1\node_modules\puppeteer\lib\cjs\puppeteer\common\Connection.js:216:16)
at Page._screenshotTask (D:\ELK\kibana-8.1.1-windows-x86_64\kibana-8.1.1\node_modules\puppeteer\lib\cjs\puppeteer\common\Page.js:1958:43)
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)
[2022-03-31T22:31:31.774+02:00][ERROR][plugins.reporting.runTask] Error: Max attempts (3) reached for job l1fgb8db04rk08096aaap4jc. Failed with: Error: Protocol error (Page.captureScreenshot): Unable to capture screenshot
at Object.run (D:\ELK\kibana-8.1.1-windows-x86_64\kibana-8.1.1\x-pack\plugins\reporting\server\lib\tasks\execute_report.js:423:58)
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at TaskManagerRunner.run (D:\ELK\kibana-8.1.1-windows-x86_64\kibana-8.1.1\x-pack\plugins\task_manager\server\task_running\task_runner.js:296:22)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked bug Fixes for quality problems that affect the customer experience (Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. loe:small Small Level of Effort PR sent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants