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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to