Skip to content

Thumbnail for dashboards w/o chart fails #33132

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

Open
3 tasks done
felixb opened this issue Apr 15, 2025 · 1 comment
Open
3 tasks done

Thumbnail for dashboards w/o chart fails #33132

felixb opened this issue Apr 15, 2025 · 1 comment
Labels
alert-reports Namespace | Anything related to the Alert & Reports feature validation:required A committer should validate the issue

Comments

@felixb
Copy link

felixb commented Apr 15, 2025

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

  • 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.
Copy link

dosubot bot commented Apr 15, 2025

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

@dosubot dosubot bot added alert-reports Namespace | Anything related to the Alert & Reports feature validation:required A committer should validate the issue labels Apr 15, 2025
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 validation:required A committer should validate the issue
Projects
None yet
Development

No branches or pull requests

1 participant