GitHub user dosubot[bot] added a comment to the discussion: Generating 
screenshots (thumbnails, PDFs, and images) is causing problems for certain 
tables and charts

<!-- Greeting -->
Hi @HerveBr! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the 
superset team.

<!-- Answer -->
This is a known issue in Superset 5.0.0: the screenshot/thumbnail/PDF/image 
generation Celery tasks have a hardcoded soft time limit of 300 seconds in the 
code, set directly in the task decorators (e.g., 
`@celery_app.task(name="cache_chart_thumbnail", soft_time_limit=300)`), which 
overrides any `task_soft_time_limit` you set in your `CELERY_CONFIG`. That's 
why you see `SoftTimeLimitExceeded` at 300s even if your config says 1000s 
[[source](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/tasks/thumbnails.py)].

Other common causes for screenshot failures include slow dashboard/chart 
rendering (like charts in hidden tabs or slow `/login/`), resource constraints, 
missing Chromium/Playwright in Docker images, or misconfigured session/cookie 
settings [[source](https://github.com/apache/superset/discussions/34297)].

To improve reliability:
- Make sure the relevant feature flags are enabled: 
`ENABLE_DASHBOARD_SCREENSHOT_ENDPOINTS` and 
`ENABLE_DASHBOARD_DOWNLOAD_WEBDRIVER_SCREENSHOT` (both default to False in 
5.0.0) [[source](https://github.com/apache/superset/pull/30755)].
- If dashboards/charts are slow to render, try increasing 
`SCREENSHOT_LOCATE_WAIT` and `SCREENSHOT_LOAD_WAIT` in your 
`superset_config.py` (this won't affect the 300s Celery limit, but can help if 
the page is just slow, not stuck) 
[[source](https://github.com/apache/superset/discussions/34092)].
- Check that Chromium/Playwright is present in your Docker image if you use 
Playwright for screenshots.
- For charts in hidden tabs or dashboards with no visible charts, 
Playwright/Selenium will time out waiting for the required DOM element, causing 
screenshot failure [[source](https://github.com/apache/superset/issues/33132)].

If you need to work around the 300s limit, you would have to patch the code to 
increase the `soft_time_limit` in the Celery task decorators. 

Let me know if you want more details on any of these troubleshooting steps or 
code locations.


<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*

---
<sup>How did I do? 
[Good](https://app.dosu.dev/response-feedback/66c9f230-c9d8-46fc-8753-25e098ebabe2?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/66c9f230-c9d8-46fc-8753-25e098ebabe2?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/66c9f230-c9d8-46fc-8753-25e098ebabe2?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/66c9f230-c9d8-46fc-8753-25e098ebabe2?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/66c9f230-c9d8-46fc-8753-25e098ebabe2?feedback_type=hallucination)
 | [Report 
šŸ›](https://app.dosu.dev/response-feedback/66c9f230-c9d8-46fc-8753-25e098ebabe2?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/66c9f230-c9d8-46fc-8753-25e098ebabe2?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat
 with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)&
 nbsp;[![Join 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share
 on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/discussions/34685)

GitHub link: 
https://github.com/apache/superset/discussions/34685#discussioncomment-14098563

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to