Bug description
superset-worker throws the following stack trace when trying to create a thumbnail of a dashboard which has no chart directly visible.
[2025-04-15 09:51:53,982: ERROR/ForkPoolWorker-2] Timed out waiting for chart containers to draw at url https://superset.[..]/superset/dashboard/113/?standalone=3
Traceback (most recent call last):
File "/app/superset/utils/webdriver.py", line 191, in get_screenshot
slice_container_locator.first.wait_for()
File "/usr/local/lib/python3.10/site-packages/playwright/sync_api/_generated.py", line 17907, in wait_for
self._sync(self._impl_obj.wait_for(timeout=timeout, state=state))
File "/usr/local/lib/python3.10/site-packages/playwright/_impl/_sync_base.py", line 115, in _sync
return task.result()
File "/usr/local/lib/python3.10/site-packages/playwright/_impl/_locator.py", line 685, in wait_for
await self._frame.wait_for_selector(
File "/usr/local/lib/python3.10/site-packages/playwright/_impl/_frame.py", line 323, in wait_for_selector
await self._channel.send("waitForSelector", locals_to_params(locals()))
File "/usr/local/lib/python3.10/site-packages/playwright/_impl/_connection.py", line 61, in send
return await self._connection.wrap_api_call(
File "/usr/local/lib/python3.10/site-packages/playwright/_impl/_connection.py", line 528, in wrap_api_call
raise rewrite_error(error, f"{parsed_st['apiName']}: {error}") from None
playwright._impl._errors.TimeoutError: Locator.wait_for: Timeout 30000ms exceeded.
Call log:
- waiting for locator(".chart-container").first to be visible
This particular dashboard holds tabs and the first tab is only showing some markdown text. The other tabs not visible when opening the dashboard show charts.
The problem is, that the <div />
with css class chart-container
is not visible when opening the dashboard hence error message.
Examining the DOM within a browser verifies the problem. You can't scroll to the <div />
w/o selecting a tab holding a chart first.
I've configured thumbnails with playwright:
FEATURE_FLAGS = {
'THUMBNAILS': True,
'THUMBNAILS_SQLA_LISTENERS': True,
'PLAYWRIGHT_REPORTS_AND_THUMBNAILS': True,
}
Screenshots/recordings
No response
Superset version
4.1.2
Python version
3.10
Node version
I don't know
Browser
Not applicable
Additional context
No response
Checklist
- [x] I have searched Superset docs and Slack and didn't find a solution to my problem.
- [x] I have searched the GitHub issue tracker and didn't find a similar bug report.
- [x] 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.
Comment From: dosubot[bot]
Hello @felixb! I'm Dosu, a bot here to help you with bugs, answer questions, and guide you on your journey as a contributor. I'm ready to assist you while you wait for a human maintainer. How can I help you today?
I found a similar solved discussion that might help you address the issue with the TimeoutError when generating thumbnails for dashboards without visible chart containers. In the discussion titled "Selenium timed out waiting for chart containers to draw," it was suggested to increase the timeout duration in the superset_config.py
file:
SCREENSHOT_LOCATE_WAIT = 30
SCREENSHOT_LOAD_WAIT = 60
Additionally, ensure that your Playwright configuration is correctly set up. The default timeout for Playwright in Superset is 30,000 milliseconds (or 30 seconds), which might need to be adjusted if your dashboard takes longer to load [1][2].
These adjustments should help in resolving the timeout issue by allowing more time for the dashboard elements to load, even if they initially contain only markdown text.
To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other
Comment From: hxtmdev
Fixed in #33107? Should work in 5.0.0rc2.
Comment From: rusackas
Agreed, fix is in! Marking as resolved, though it still awaits official release.