You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "greg-om (via GitHub)" <gi...@apache.org> on 2026/10/22 17:15:23 UTC
[I] Chart and dashboard thumbnails ignore SUPERSET_APP_ROOT [superset]
greg-om opened a new issue, #45638:
URL: https://github.com/apache/superset/issues/45638
### Bug description
### Bug description
When Superset is served under a subdirectory with `SUPERSET_APP_ROOT` (for example `SUPERSET_APP_ROOT=/analytics`), chart and dashboard thumbnails are requested without the app root prefix. This affects:
- the chart list (card view)
- the dashboard list (card view)
- the "add chart" panel in dashboard edit mode
The page requests `/api/v1/chart/123/thumbnail/<digest>/` instead of `/analytics/api/v1/chart/123/thumbnail/<digest>/`. Behind a reverse proxy that only routes `/analytics` to Superset, the request goes to whatever serves `/`, so it 404s (or reaches the wrong backend) and every card shows the placeholder image.
**Steps to reproduce**
1. Enable the `THUMBNAILS` feature flag with a working thumbnail cache/worker.
2. Run Superset with `SUPERSET_APP_ROOT=/analytics` behind a proxy that only forwards `/analytics/*`.
3. Open the chart list or dashboard list in card view.
4. In the browser network tab, thumbnail requests go to `/api/v1/.../thumbnail/...` (no `/analytics` prefix) and fail.
**Expected:** thumbnail requests include the app root and the thumbnails render.
**Cause:** `ImageLoader` (`superset-frontend/packages/superset-ui-core/src/components/ListViewCard/ImageLoader.tsx`) loads images with a bare `fetch(src)`. The backend's `thumbnail_url` is a root-relative API path without the app root, which is the expected convention since #39925, but a bare `fetch` never goes through `SupersetClient`, so the prefix is never added. Other API calls on the same pages do get the prefix.
### Screenshots/recordings
_No response_
### Superset version
master / latest-dev
### Python version
3.11
### Node version
16
### Browser
Chrome
### 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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Chart and dashboard thumbnails ignore SUPERSET_APP_ROOT [superset]
Posted by "FrancescoCastaldi (via GitHub)" <gi...@apache.org>.
FrancescoCastaldi commented on issue #45638:
URL: https://github.com/apache/superset/issues/45638#issuecomment-6524018890
### Root Cause Analysis & Solution
In `superset-frontend/packages/superset-ui-core/src/components/ListViewCard/ImageLoader.tsx`, thumbnail requests are made using native `fetch`:
```typescript
fetch(src, { credentials: 'same-origin' })
```
When Superset is hosted under a subpath behind a reverse proxy (e.g. `SUPERSET_APP_ROOT = "/analytics"`), relative URLs such as `"/api/v1/chart/1/thumbnail/..."` do not include the application root prefix, resulting in HTTP 404 responses for card thumbnails.
#### Solution
Prepend the configured application root by composing the endpoint URL through `SupersetClient`:
```typescript
import { SupersetClient } from '@superset-ui/core';
const url = src.startsWith('http') ? src : SupersetClient.getUrl({ endpoint: src });
fetch(url, { credentials: 'same-origin' })
```
Verified with unit tests in `ImageLoader.test.tsx` and committed to branch `fix/community-unanswered-issues` (commit `2d8a057b7b6`) at https://github.com/FrancescoCastaldi/superset/tree/fix/community-unanswered-issues.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org