Skip to content

Dashboard Thumbnails couldn't show at the Dashboard page, but in Home and Chart pages shows them correctly #30287

Closed

Description

@mpolatcan

Bug description

When I visiting Home and Charts page, I can see thumbnails correctly, but when I visit Dashboard page I can't see thumbnails. I configured S3 caching for thumbnails like below in superset_config.py:

def init_thumbnail_cache(app, config, cache_args, cache_options) -> S3Cache:
    return S3Cache("superset-result-backend-cache", 'thumbnails/')


THUMBNAIL_CACHE_CONFIG = {'CACHE_TYPE': 'superset_config.init_thumbnail_cache'}
THUMBNAIL_SELENIUM_USER = get_env("THUMBNAIL_SELENIUM_USER", default="Admin")
THUMBNAIL_EXECUTE_AS = [ExecutorType.SELENIUM]

At the behind, I am seeing logs like below:

2024-09-16 14:45:23,017:WARNING:superset.common.utils.query_cache_manager:force_cached (QueryContext): value not found for key 9e7535a0f4d4bd1307c7e630a3756c0e
2024-09-16 14:48:42,882:INFO:superset.utils.screenshots:Attempting to get from cache: aa065c951be3dedba518d13eac81976d
2024-09-16 14:48:42,893:INFO:superset.utils.screenshots:Attempting to get from cache: 318a398cd116f164114f22aca987c5e9
2024-09-16 14:48:43,262:INFO:superset.utils.screenshots:Attempting to get from cache: 96feaa217625a1c02d3c42b62841287b
/home/superset/superset/venv/lib/python3.11/site-packages/_distutils_hack/__init__.py:31: UserWarning: Setuptools is replacing distutils. Support for replacing an already imported distutils is deprecated. In the future, this condition will fail. Register concerns at https://github.com/pypa/setuptools/issues/new?template=distutils-deprecation.yml
  warnings.warn(
2024-09-16 14:48:44,990:ERROR:superset.utils.json:JSON is not valid Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
  File "/home/superset/superset/venv/lib/python3.11/site-packages/superset/utils/json.py", line 244, in loads
    return simplejson.loads(
           ^^^^^^^^^^^^^^^^^
  File "/home/superset/superset/venv/lib/python3.11/site-packages/simplejson/__init__.py", line 514, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/superset/superset/venv/lib/python3.11/site-packages/simplejson/decoder.py", line 386, in decode
    obj, end = self.raw_decode(s)
               ^^^^^^^^^^^^^^^^^^
  File "/home/superset/superset/venv/lib/python3.11/site-packages/simplejson/decoder.py", line 416, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
2024-09-16 14:48:45,108:ERROR:superset.utils.json:JSON is not valid Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
  File "/home/superset/superset/venv/lib/python3.11/site-packages/superset/utils/json.py", line 244, in loads
    return simplejson.loads(
           ^^^^^^^^^^^^^^^^^
  File "/home/superset/superset/venv/lib/python3.11/site-packages/simplejson/__init__.py", line 514, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/superset/superset/venv/lib/python3.11/site-packages/simplejson/decoder.py", line 386, in decode
    obj, end = self.raw_decode(s)
               ^^^^^^^^^^^^^^^^^^
  File "/home/superset/superset/venv/lib/python3.11/site-packages/simplejson/decoder.py", line 416, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
2024-09-16 14:48:45,244:ERROR:superset.utils.json:JSON is not valid Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
  File "/home/superset/superset/venv/lib/python3.11/site-packages/superset/utils/json.py", line 244, in loads
    return simplejson.loads(
           ^^^^^^^^^^^^^^^^^
  File "/home/superset/superset/venv/lib/python3.11/site-packages/simplejson/__init__.py", line 514, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/superset/superset/venv/lib/python3.11/site-packages/simplejson/decoder.py", line 386, in decode
    obj, end = self.raw_decode(s)
               ^^^^^^^^^^^^^^^^^^
  File "/home/superset/superset/venv/lib/python3.11/site-packages/simplejson/decoder.py", line 416, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

How to reproduce the bug

  1. Go to Dashboard page
  2. Check thumbnails on page

Screenshots/recordings

Screenshot 2024-09-16 at 17 48 40
Screenshot 2024-09-16 at 17 48 46

Superset version

master / latest-dev

Python version

3.11

Node version

16

Browser

Chrome

Additional context

I am using Apache Superset 4.1.0rc2 version :)

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.

Activity

  1. added
    dashboardNamespace | Anything related to the Dashboard
    global:errorRelated to global errors affecting the platform
    infra:cachingInfra setup and configuration related to caching
    on Sep 16, 2024
  2. dosubot commented on Sep 16, 2024

    @dosubot

    @mpolatcan Hello! I'm here to help you with any bugs, questions, or contributions.

    I found some similar issues that might help you:

    1. [Question] Are dashboard thumbnails generated periodically? (Closed)

      • Solution: The issue was closed as stale. If the problem persists in current versions, it was suggested to reopen the issue or raise a new one with updated context.
      • Link to issue [1]
    2. [chart] "Unexpected error" in Dashboard thumbnails (Superset 1.0.1) (Closed)

      • Solution: Adding "can read on Chart" permission resolved the issue.
      • Link to issue [2]
    3. Why does only the thumbnail function in the chart work? The dashboard does not appear. (Closed)

      • Solution: A regression on the master branch caused dashboard thumbnails to fail, which was fixed by a specific pull request.
      • Link to issue [3]

    Regarding your specific issue, the problem might be related to the caching logic for the Dashboard thumbnails. Ensure that the cache_dashboard_thumbnail function is being triggered correctly and that the thumbnail_cache is properly configured and accessible. Check the logs for any warnings or errors related to the caching process, as indicated by the logging statements in the code:

    if not thumbnail_cache:
        logging.warning("No cache set, refusing to compute")
        return

    If the cache is not set, the function will refuse to compute the thumbnail, which could explain why the thumbnails are not appearing on the Dashboard page [4].

    Additionally, there are specific differences in how the Home, Chart, and Dashboard pages handle thumbnail caching and retrieval. The DashboardScreenshot class has specific configurations for handling thumbnails, including different default window and thumbnail sizes, URL modifications, and cache key parameters [5][6][7][4][8].

    Ensure that your S3 cache is correctly configured and accessible, and verify that the cache_dashboard_thumbnail function is being called as expected.

    To continue talking to Dosu, mention @dosu.

  3. rusackas commented on Sep 16, 2024

    @rusackas
    Member

    Assigning to @geido , but also CC-ing @yousoph / @kasiazjc - not sure how long this has gone unreported, but that makes me wonder about the utility/discoverability of the thumbnail views.

  4. assigned and unassigned on Nov 12, 2024
  5. iercan commented on Jan 17, 2025

    @iercan
    Contributor

    We are facing the same issue on 4.1.1 despite using Redis cache.

  6. ryepezb1 commented on Jan 22, 2025

    @ryepezb1

    Alguien pudo solucionar el problema??? sigo sin poder solucionarlo

  7. JustGui commented on Mar 13, 2025

    @JustGui

    Using version 5.0.0rc1 with Redis for cache, Firefox & Playwright to generate screenshots, we also can see the screenshots in tabs Home & Charts but nothing on the tab Dashboards
    Looking at the network console I can see that the thumbnails are just not called by the interface on the tab Dashboards, when they are called for the tabs Home & Charts

  8. pang-wu commented on Mar 24, 2025

    @pang-wu

    +1 here, on 5.0.0rc1 thumbnails are just not called by the interface on the tab Dashboards

  9. pellepelle3 commented on Apr 17, 2025

    @pellepelle3

    +1

  10. romankevich commented on May 6, 2025

    @romankevich

    +1
    4.1.2

  11. moved this from New to Non-blockers in Apache Superset 5.0.0on May 13, 2025
  12. rad-pat commented on May 16, 2025

    @rad-pat
    Contributor

    This seems to have been since #28609.

    Adding the thumbnail_url into the list of columns retrieved seems to fix the issue in my local build, though I don't understand the PR comment wrt thumbnail_url @dpgaspar

  13. rad-pat commented on May 16, 2025

    @rad-pat
    Contributor

    OK, I get it now. Calculating the digest can take some time for lots of dashboards. Anyway it somehow seems that, since that change, a request is made to each dashboard by id to get the thumbnail_url, but the setThumbnailUrl doesn't appear to request the thumbnail blob.

  14. moved this from Non-blockers to Cherried in Apache Superset 5.0.0on Jun 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

dashboardNamespace | Anything related to the Dashboardglobal:errorRelated to global errors affecting the platforminfra:cachingInfra setup and configuration related to caching

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions