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

Dashboard generated via report scheduling is truncated #13097

Closed
DRavikanth opened this issue Feb 12, 2021 · 20 comments · Fixed by #13157
Closed

Dashboard generated via report scheduling is truncated #13097

DRavikanth opened this issue Feb 12, 2021 · 20 comments · Fixed by #13157
Labels
alert-reports Namespace | Anything related to the Alert & Reports feature

Comments

@DRavikanth
Copy link

A clear and concise description of what the bug is.

Bug is related to scheduling email part. There is a huge dashboard with 25 visuals that requires scrolling the dashboard. When an email is sent for this dashboard, the image is truncated to only first screen(everything that needs to be scrolled is getting skipped). I have tried increasing the WEBDRIVER_WINDOW but still the same issue.

Expected results

The dashboard screenshot that user receives in email should have the entire dashboard instead of truncated image.

Actual results

Image gets truncated after the first page. Anything that needs to be scrolled is not presented in the email

How to reproduce the bug

  1. Create a big dashboard that needs scrolling to view the entire dashboard
  2. Schedule it in Alerts & Reports
  3. observe the sent email to see the truncated image of the dashboard

Environment

  • superset version: 1.0.1
  • python version: 3.6

Checklist

Make sure to follow these steps before submitting your issue - thank you!

  • [ Y] I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • [ Y] I have reproduced the issue with at least the latest released version of superset.
  • [ Y] I have checked the issue tracker for the same issue and I haven't found one similar.
@DRavikanth DRavikanth added the #bug Bug report label Feb 12, 2021
@nytai
Copy link
Member

nytai commented Feb 12, 2021

@DRavikanth You're using the new version of alerts and reports right? I don't think it's using that config value unfortunately, it's currently using hardcoded values

window_size: WindowSize = (1600, int(1600 * 0.75))

@DRavikanth
Copy link
Author

That's unfortunate.

@nytai
Copy link
Member

nytai commented Feb 12, 2021

We should change this to use the config values. I can open a PR but I'm not set up to test this at the moment.

@junlincc junlincc added alert-reports Namespace | Anything related to the Alert & Reports feature and removed #bug Bug report labels Feb 12, 2021
@iercan
Copy link
Contributor

iercan commented Feb 16, 2021

I observed same issue too. New alerts and reports does not use WEBDRIVER_WINDOW. I will fix it if I can and open PR

@iercan
Copy link
Contributor

iercan commented Feb 16, 2021

I sent PR

@DRavikanth
Copy link
Author

@iercan, Thanks for the PR. Is there a way we can avoid driving it by configuration. Instead load the dashboard dynamically according to the size of it? I am not a Python guy and not sure how web driver works but I think loading the dashboard dynamically will be more elegant.

@iercan
Copy link
Contributor

iercan commented Feb 16, 2021

Not sure if there is a way to get dashboard size

@nytai
Copy link
Member

nytai commented Feb 16, 2021

I'm not really familiar with webdriver. You can probably query the dom for the size of each div, that's significantly more effort though. One of the issues we might hit is that the screenshot module is also used for generating thumbnails for the dashboard/chart card views, so changing the aspect ratios may cause issues.

@DRavikanth
Copy link
Author

@nytai, Thanks for that.

@iercan , Can you confirm which release the fix is intended to?

@iercan
Copy link
Contributor

iercan commented Feb 16, 2021

Unfortunately I can't because I'm not the one who gonna decide that. I'm just a regular contributor :)

@DRavikanth
Copy link
Author

I see. Thanks for confirming. I will keep watching the PR. :)

@nytai
Copy link
Member

nytai commented Feb 16, 2021

@DRavikanth not sure about release, they always take a while. Once the PR is merged the code should be available as a docker image under the latest and latest-dev tag (docker-compose in the repo is using this) so you can always go that route if you can't wait for an official release.

@dpgaspar
Copy link
Member

@DRavikanth, @iercan, @nytai, after the PR is merged we can tag it for the next release (probably 1.1.0)

@DRavikanth
Copy link
Author

@dpgaspar thanks for confirming

@jawabuu
Copy link
Contributor

jawabuu commented May 1, 2021

Hey @dpgaspar @iercan @nytai
I'm using superset version 1.1.0
My settings

WEBDRIVER_TYPE = 'chrome'
WEBDRIVER_WINDOW = {"dashboard": (2400, 1800), "slice": (2400, 1800)}

My logs

[2021-05-01 06:30:00,450: INFO/ForkPoolWorker-3] Init selenium driver
[2021-05-01 06:30:01,488: DEBUG/ForkPoolWorker-3] POST http://127.0.0.1:33265/session {"capabilities": {"firstMatch": [{}], "alwaysMatch": {"browserName": "chrome", "platformName": "any", "goog:chromeOptions":{"extensions": [], "args": ["--window-size=2400,1800", "--force-device-scale-factor=2.0", "--high-dpi-support=2.0", "--headless", "--disable-gpu", "--disable-dev-shm-usage"]}}}, "desiredCapabilities": {"browserName": "chrome", "version": "", "platform": "ANY", "goog:chromeOptions": {"extensions": [], "args": ["--window-size=2400,1800", "--force-device-scale-factor=2.0", "--high-dpi-support=2.0", "--headless", "--disable-gpu", "--disable-dev-shm-usage"]}}}
[2021-05-01 06:30:01,491: DEBUG/ForkPoolWorker-3] Starting new HTTP connection (1): 127.0.0.1:33265
[2021-05-01 06:30:02,116: DEBUG/ForkPoolWorker-3] http://127.0.0.1:33265 "POST /session HTTP/1.1" 200 715
[2021-05-01 06:30:02,117: DEBUG/ForkPoolWorker-3] Finished Request
[2021-05-01 06:30:02,118: DEBUG/ForkPoolWorker-3] POST http://127.0.0.1:33265/session/e0b17bb03b8e0aa04b1c90704eaa16d9/url {"url": "http://superset:8088/login/"}
[2021-05-01 06:30:04,843: DEBUG/ForkPoolWorker-3] http://127.0.0.1:33265 "POST /session/e0b17bb03b8e0aa04b1c90704eaa16d9/url HTTP/1.1" 200 14
[2021-05-01 06:30:04,843: DEBUG/ForkPoolWorker-3] Finished Request
[2021-05-01 06:30:04,846: DEBUG/ForkPoolWorker-3] POST http://127.0.0.1:33265/session/e0b17bb03b8e0aa04b1c90704eaa16d9/cookie {"cookie": {"name": "session", "value": ".eJwlzjEOwzAIQNG7MGcwGIzJZSJjsNo1aaaqd2-lHuA__Tcc68zrAfvrvHOD4xmwQzdaunLSROlVWivTB1biGERIktg0m7inRFbj4N6GMv-Cop4FWdG6yWqkP0W64_ASWUr0JBef5s5JNjTr1F7JwoKKYM6SnWGD-8rzP4Pw-QJpBS6n.YIz1bA.VXjURneZDdRWXgvmUNyEmAD4iy4"}}
[2021-05-01 06:30:04,852: DEBUG/ForkPoolWorker-3] http://127.0.0.1:33265 "POST /session/e0b17bb03b8e0aa04b1c90704eaa16d9/cookie HTTP/1.1" 200 14
[2021-05-01 06:30:04,853: DEBUG/ForkPoolWorker-3] Finished Request
[2021-05-01 06:30:04,853: DEBUG/ForkPoolWorker-3] POST http://127.0.0.1:33265/session/e0b17bb03b8e0aa04b1c90704eaa16d9/window/rect {"x": null, "y": null, "width": 2400, "height": 1800}
[2021-05-01 06:30:04,959: DEBUG/ForkPoolWorker-3] http://127.0.0.1:33265 "POST /session/e0b17bb03b8e0aa04b1c90704eaa16d9/window/rect HTTP/1.1" 200 50
[2021-05-01 06:30:04,959: DEBUG/ForkPoolWorker-3] Finished Request
[2021-05-01 06:30:04,960: DEBUG/ForkPoolWorker-3] POST http://127.0.0.1:33265/session/e0b17bb03b8e0aa04b1c90704eaa16d9/url {"url": "http://superset:8088/superset/dashboard/1/"}
[2021-05-01 06:30:09,285: DEBUG/ForkPoolWorker-3] http://127.0.0.1:33265 "POST /session/e0b17bb03b8e0aa04b1c90704eaa16d9/url HTTP/1.1" 200 14
[2021-05-01 06:30:09,286: DEBUG/ForkPoolWorker-3] Finished Request
[2021-05-01 06:30:12,290: DEBUG/ForkPoolWorker-3] POST http://127.0.0.1:33265/session/e0b17bb03b8e0aa04b1c90704eaa16d9/element {"using": "css selector", "value": ".grid-container"}
[2021-05-01 06:30:12,901: DEBUG/ForkPoolWorker-3] http://127.0.0.1:33265 "POST /session/e0b17bb03b8e0aa04b1c90704eaa16d9/element HTTP/1.1" 200 88
[2021-05-01 06:30:12,903: DEBUG/ForkPoolWorker-3] Finished Request
[2021-05-01 06:30:12,904: DEBUG/ForkPoolWorker-3] POST http://127.0.0.1:33265/session/e0b17bb03b8e0aa04b1c90704eaa16d9/elements {"using": "css selector", "value": ".loading"}
[2021-05-01 06:30:14,569: DEBUG/ForkPoolWorker-3] http://127.0.0.1:33265 "POST /session/e0b17bb03b8e0aa04b1c90704eaa16d9/elements HTTP/1.1" 200 90
[2021-05-01 06:30:14,570: DEBUG/ForkPoolWorker-3] Finished Request
[2021-05-01 06:30:15,071: DEBUG/ForkPoolWorker-3] POST http://127.0.0.1:33265/session/e0b17bb03b8e0aa04b1c90704eaa16d9/elements {"using": "css selector", "value": ".loading"}
[2021-05-01 06:30:15,410: DEBUG/ForkPoolWorker-3] http://127.0.0.1:33265 "POST /session/e0b17bb03b8e0aa04b1c90704eaa16d9/elements HTTP/1.1" 200 12
[2021-05-01 06:30:15,413: DEBUG/ForkPoolWorker-3] Finished Request
Taking a PNG screenshot or url http://superset:8088/superset/dashboard/1/

My report is still truncated

data

Is there anything else I need to adjust?

@jawabuu
Copy link
Contributor

jawabuu commented May 1, 2021

For anyone experiencing this;
I disabled this --force-device-scale-factor=2.0 to resolve the issue

WEBDRIVER_OPTION_ARGS = [
            # "--force-device-scale-factor=2.0",
            "--high-dpi-support=2.0",
            "--headless",
            "--disable-gpu",
            "--disable-dev-shm-usage",
            # This is required because our process runs as root (in order to install pip packages)
            # "--no-sandbox",
            # "--disable-setuid-sandbox",
            # "--disable-extensions",
        ]

@iercan
Copy link
Contributor

iercan commented May 1, 2021

@jawabuu Yeah for some reason this option need to be removed if you using chrome 90 or above

@jawabuu
Copy link
Contributor

jawabuu commented May 1, 2021

Thanks @iercan. This should probably be documented.
Also I have been unable to get firefox driver to work.
Would you have an example configuration?

@code-marcin
Copy link

Hello All,
I am using the chrome browser SnapShot in the reports is not covering the Whole Dashboard, any config i need to check for this, as Full Screenshot is not coming

@eschutho
Copy link
Member

The Firefox gecko driver does a better job at capturing full page (height) reports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alert-reports Namespace | Anything related to the Alert & Reports feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants