Skip to content

Thumbnail for dashboards w/o chart fails #33132

Closed
@felixb

Description

@felixb

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    alert-reportsNamespace | Anything related to the Alert & Reports featurerequires:validationA committer should validate the issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions