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

Unable to Download(pdf and image) superset dashboard #30866

Closed
3 tasks done
krishanthvs opened this issue Nov 7, 2024 · 24 comments
Closed
3 tasks done

Unable to Download(pdf and image) superset dashboard #30866

krishanthvs opened this issue Nov 7, 2024 · 24 comments
Labels
need:more-info Requires more information from author

Comments

@krishanthvs
Copy link

Bug description

2024-11-07 18:31:29,234:INFO:superset.utils.screenshots:Attempting to get from cache: e82a8cd667ff78eb64d379e72b7b77e0
2024-11-07 18:31:29,234:INFO:superset.utils.screenshots:Failed at getting from cache: e82a8cd667ff78eb64d379e72b7b77e0
2024-11-07 18:31:29,241:DEBUG:superset.stats_logger:[stats_logger] (incr) DashboardRestApi.screenshot.warning
2024-11-07 18:31:29,242:DEBUG:superset.stats_logger:[stats_logger] (timing) DashboardRestApi.screenshot.time | 9.657113812863827
2024-11-07 18:31:29,242:INFO:werkzeug:106.51.85.80 - - [07/Nov/2024 18:31:29] "GET /api/v1/dashboard/1/screenshot/e82a8cd667ff78eb64d379e72b7b77e0/?download_format=pdf HTTP/1.1" 404 -
I have installed superset in ec2 machine. I am getting this error in the logs.

Screenshots/recordings

No response

Superset version

master / latest-dev

Python version

3.11

Node version

I don't know

Browser

Chrome

Additional context

No response

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
@krishanthvs
Copy link
Author

@rusackas can you please check on this

@dosubot dosubot bot added the dashboard:export Related to exporting dashboards label Nov 7, 2024
Copy link

dosubot bot commented Nov 7, 2024

It looks like you're encountering a 404 error when trying to download the Superset dashboard as a PDF or image. This issue often arises because the image is not ready yet when the system attempts to fetch it. The function fetchImageWithRetry is designed to retry fetching the image, but if it's still not ready after the maximum number of retries, the download fails [1].

Common reasons for a screenshot not being ready include the page not being fully loaded, chart containers not rendered, or unexpected errors on the page. Ensuring the page is fully loaded and adjusting wait times for elements to render can help mitigate these issues [2].

In an EC2 environment, make sure you have the necessary configurations and dependencies set up, such as enabling the "ALERT_REPORTS" feature flag, configuring Celery, and installing a headless browser like Chrome or Firefox [3].

Since you've already reached out to @rusackas, it might be helpful for them to take a look at this issue as well.

To continue talking to Dosu, mention @dosu.

@krishanthvs
Copy link
Author

@rusackas can you please help me on this. I am able to download the charts but when i am downloading the dashboard its not downloading

@krishanthvs
Copy link
Author

@dosu can you please assign some one for the same

Copy link

dosubot bot commented Nov 8, 2024

A maintainer has already been looped in.

To continue talking to Dosu, mention @dosu.

@krishanthvs
Copy link
Author

@rusackas can you please help me on this

@rusackas
Copy link
Member

Not sure why you're calling me out personally on this one so often... I have no idea, and there's certainly not enough info on this ticket to say if it's a reproducible bug, rather than a config issue. You don't say how you installed Superset, what steps you followed, or where docs fell short.

I would join slack and try the #deloying-superset channel, or even #ask-ai. Alternatively, you can sidestep the problem by using a hosted solution.

@rusackas rusackas added need:more-info Requires more information from author and removed dashboard:export Related to exporting dashboards labels Nov 12, 2024
@krishanthvs
Copy link
Author

@rusackas Whenever i ask for help from a maintainer the dosu bot throws your id.. So tagged you here. I have installed superset on EC2 machine and when i am trying to download the dashboard this error is showing in the logs:
2024-11-07 18:31:29,234:INFO:superset.utils.screenshots:Attempting to get from cache: e82a8cd667ff78eb64d379e72b7b77e0
2024-11-07 18:31:29,234:INFO:superset.utils.screenshots:Failed at getting from cache: e82a8cd667ff78eb64d379e72b7b77e0
2024-11-07 18:31:29,241:DEBUG:superset.stats_logger:[stats_logger] (incr) DashboardRestApi.screenshot.warning
2024-11-07 18:31:29,242:DEBUG:superset.stats_logger:[stats_logger] (timing) DashboardRestApi.screenshot.time | 9.657113812863827
2024-11-07 18:31:29,242:INFO:werkzeug:106.51.85.80 - - [07/Nov/2024 18:31:29] "GET /api/v1/dashboard/1/screenshot/e82a8cd667ff78eb64d379e72b7b77e0/?download_format=pdf HTTP/1.1" 404 -
superset_download_issue

@krishanthvs
Copy link
Author

@michael-s-molina can you please help me on this.

@michael-s-molina
Copy link
Member

Hi @krishanthvs. Given that this seems like a configuration issue, I can point you to some resources that might help:

  • Read this PR to understand the difference between sync and async screenshot generation
  • Make sure you're using the sync version (ENABLE_DASHBOARD_SCREENSHOT_ENDPOINTS and ENABLE_DASHBOARD_DOWNLOAD_WEBDRIVER_SCREENSHOT are False)
  • Use a stable release 4.1.1 instead of master

@krishanthvs
Copy link
Author

Hi @michael-s-molina I changed the feature flags true still its showing the same error

@krishanthvs
Copy link
Author

2024-12-06 16:29:49,351:INFO:superset.dashboards.api:Triggering screenshot ASYNC
2024-12-06 16:29:49,558:INFO:superset.utils.screenshots:Attempting to get from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:29:49,559:INFO:superset.utils.screenshots:Failed at getting from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:29:52,783:INFO:superset.utils.screenshots:Attempting to get from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:29:52,783:INFO:superset.utils.screenshots:Failed at getting from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:29:55,909:INFO:superset.utils.screenshots:Attempting to get from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:29:55,910:INFO:superset.utils.screenshots:Failed at getting from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:29:59,055:INFO:superset.utils.screenshots:Attempting to get from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:29:59,055:INFO:superset.utils.screenshots:Failed at getting from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:30:02,238:INFO:superset.utils.screenshots:Attempting to get from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:30:02,239:INFO:superset.utils.screenshots:Failed at getting from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:30:05,363:INFO:superset.utils.screenshots:Attempting to get from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:30:05,363:INFO:superset.utils.screenshots:Failed at getting from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:30:08,510:INFO:superset.utils.screenshots:Attempting to get from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:30:08,511:INFO:superset.utils.screenshots:Failed at getting from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:30:11,640:INFO:superset.utils.screenshots:Attempting to get from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:30:11,640:INFO:superset.utils.screenshots:Failed at getting from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:30:14,776:INFO:superset.utils.screenshots:Attempting to get from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:30:14,777:INFO:superset.utils.screenshots:Failed at getting from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:30:17,945:INFO:superset.utils.screenshots:Attempting to get from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:30:17,945:INFO:superset.utils.screenshots:Failed at getting from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:30:21,078:INFO:superset.utils.screenshots:Attempting to get from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:30:21,079:INFO:superset.utils.screenshots:Failed at getting from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:30:24,224:INFO:superset.utils.screenshots:Attempting to get from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:30:24,225:INFO:superset.utils.screenshots:Failed at getting from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:30:27,651:INFO:superset.utils.screenshots:Attempting to get from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:30:27,651:INFO:superset.utils.screenshots:Failed at getting from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:30:30,790:INFO:superset.utils.screenshots:Attempting to get from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:30:30,790:INFO:superset.utils.screenshots:Failed at getting from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:30:33,907:INFO:superset.utils.screenshots:Attempting to get from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:30:33,907:INFO:superset.utils.screenshots:Failed at getting from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:30:37,058:INFO:superset.utils.screenshots:Attempting to get from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:30:37,058:INFO:superset.utils.screenshots:Failed at getting from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:30:40,187:INFO:superset.utils.screenshots:Attempting to get from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:30:40,187:INFO:superset.utils.screenshots:Failed at getting from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:30:43,319:INFO:superset.utils.screenshots:Attempting to get from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:30:43,319:INFO:superset.utils.screenshots:Failed at getting from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:30:46,456:INFO:superset.utils.screenshots:Attempting to get from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:30:46,457:INFO:superset.utils.screenshots:Failed at getting from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:30:49,622:INFO:superset.utils.screenshots:Attempting to get from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:30:49,622:INFO:superset.utils.screenshots:Failed at getting from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:30:52,738:INFO:superset.utils.screenshots:Attempting to get from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:30:52,738:INFO:superset.utils.screenshots:Failed at getting from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:30:55,888:INFO:superset.utils.screenshots:Attempting to get from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:30:55,888:INFO:superset.utils.screenshots:Failed at getting from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:30:58,979:INFO:superset.utils.screenshots:Attempting to get from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:30:58,979:INFO:superset.utils.screenshots:Failed at getting from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:31:02,122:INFO:superset.utils.screenshots:Attempting to get from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:31:02,122:INFO:superset.utils.screenshots:Failed at getting from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:31:05,271:INFO:superset.utils.screenshots:Attempting to get from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:31:05,271:INFO:superset.utils.screenshots:Failed at getting from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:31:08,406:INFO:superset.utils.screenshots:Attempting to get from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:31:08,406:INFO:superset.utils.screenshots:Failed at getting from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:31:11,534:INFO:superset.utils.screenshots:Attempting to get from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:31:11,534:INFO:superset.utils.screenshots:Failed at getting from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:31:14,658:INFO:superset.utils.screenshots:Attempting to get from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:31:14,658:INFO:superset.utils.screenshots:Failed at getting from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:31:17,820:INFO:superset.utils.screenshots:Attempting to get from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:31:17,820:INFO:superset.utils.screenshots:Failed at getting from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:31:20,970:INFO:superset.utils.screenshots:Attempting to get from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:31:20,971:INFO:superset.utils.screenshots:Failed at getting from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:31:24,563:INFO:superset.utils.screenshots:Attempting to get from c ache: 3e2d616d80b472d33efc0d2bf905bd47
2024-12-06 16:31:24,563:INFO:superset.utils.screenshots:Failed at getting from c ache: 3e2d616d80b472d33efc0d2bf905bd47

@krishanthvs
Copy link
Author

@michael-s-molina Its doing download in async. How to do it in sync.

@michael-s-molina
Copy link
Member

@michael-s-molina Its doing download in async. How to do it in sync.

Make sure you're using the sync version (ENABLE_DASHBOARD_SCREENSHOT_ENDPOINTS and ENABLE_DASHBOARD_DOWNLOAD_WEBDRIVER_SCREENSHOT are False)

👆🏼

@michael-s-molina
Copy link
Member

Hi @michael-s-molina I changed the feature flags true still its showing the same error

The feature flags should be FALSE not true

@krishanthvs
Copy link
Author

@michael-s-molina I have set this to false. Still getting the same error

@michael-s-molina
Copy link
Member

2024-12-06 16:29:49,351:INFO:superset.dashboards.api:Triggering screenshot ASYNC

@krishanthvs If the above line is in your logs, it means that there's something wrong with your configuration and the feature flag is not being applied.

@sundar68
Copy link

@krishanthvs
I am also facing the same issue, have you found any solution for this?

@krishanthvs
Copy link
Author

@dosu I have changed the feature flag as suggested by the maintainer. Still getting the same error

Copy link

dosubot bot commented Jan 3, 2025

If you're still encountering issues with the feature flags not being applied correctly, here are a few things to check:

  1. Configuration in superset_config.py: Ensure that the FEATURE_FLAGS dictionary in your superset_config.py file correctly sets ENABLE_DASHBOARD_SCREENSHOT_ENDPOINTS and ENABLE_DASHBOARD_DOWNLOAD_WEBDRIVER_SCREENSHOT to False. This should override the default settings [1].

  2. Environment Variables: Check if there are any environment variables prefixed with SUPERSET_FEATURE_ that might be overriding your configuration. These can affect the feature flags if set incorrectly.

  3. Custom Functions: If you have custom functions like GET_FEATURE_FLAGS_FUNC or IS_FEATURE_ENABLED_FUNC, verify that they are not altering the feature flags unexpectedly.

  4. Frontend Initialization: Ensure that the frontend is correctly initializing the feature flags. If uiCore.initFeatureFlags() is not called or is called with incorrect values, the feature flags might not be set as expected in the frontend environment [2].

  5. Merging Logic: Double-check the merging logic between DEFAULT_FEATURE_FLAGS and FEATURE_FLAGS to ensure it is functioning as intended.

If these steps don't resolve the issue, it might be helpful to review the logs for any errors or exceptions that could indicate why the feature flags are not being applied.

A maintainer has already been looped in.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@krishanthvs
Copy link
Author

@michael-s-molina this the superset_config.py at my end. Is there any error in this setup
SECRET_KEY='Kumar-FSMK0521'
WTF_CSRF_ENABLED = False
TALISMAN_ENABLED = True
ALERT_REPORTS = True
DASHBOARD_VIRTUALIZATION = True
LOGO_RIGHT_TEXT = ""
APP_NAME = ''
APP_ICON='/static/assets/images/logo_1.png'
APP_ICON_WIDTH = 200
DASHBOARD_RBAC= True
FEATURE_FLAGS = {

"DASHBOARD_RBAC": True,
"EMBEDDED_SUPERSET": True,
"ENABLE_DASHBOARD_SCREENSHOT_ENDPOINTS": False,
"ENABLE_DASHBOARD_DOWNLOAD_WEBDRIVER_SCREENSHOT": False
}

DISPLAY_MAX_ROW = 50000

CELERY_TASK_EAGER_PROPAGATES = True
CELERY_TASK_ALWAYS_EAGER = True

@krishanthvs
Copy link
Author

@michael-s-molina any updates on this

@krishanthvs
Copy link
Author

@sundar68 Reinstall superset with latest pull of git. Its working for me now

@ElijahKyule
Copy link

@michael-s-molina any updates on this

Hi @krishanthvs I experienced a similar issue. Do you have a scrollable table in your dashboard? try removing it and see if it works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need:more-info Requires more information from author
Projects
None yet
Development

No branches or pull requests

5 participants