Skip to content

fix(deploy): prevent double-prefix of logo URL in subdirectory deployments#39472

Merged
rusackas merged 2 commits into
apache:masterfrom
Abdulrehman-PIAIC80387:fix/subdirectory-logo-double-prefix-39432
May 12, 2026
Merged

fix(deploy): prevent double-prefix of logo URL in subdirectory deployments#39472
rusackas merged 2 commits into
apache:masterfrom
Abdulrehman-PIAIC80387:fix/subdirectory-logo-double-prefix-39432

Conversation

@Abdulrehman-PIAIC80387
Copy link
Copy Markdown
Contributor

@Abdulrehman-PIAIC80387 Abdulrehman-PIAIC80387 commented Apr 20, 2026

SUMMARY

When deploying Superset under a subdirectory (e.g. SUPERSET_APP_ROOT=/dashboards), the logo image returns a 404 because the URL is double-prefixed:

/dashboards/dashboards/static/assets/images/superset-logo-horiz.png

Root cause

Two independent mechanisms each add the app_root prefix:

  1. Backendsuperset/app.py (introduced in fix: add subdirectory deployment support for app icon and reports urls #35098) manually prefixes APP_ICON, brandLogoUrl, and brandLogoHref with app_root.
  2. FrontendensureStaticPrefix() in superset-frontend/src/utils/assetUrl.ts and ensureAppRoot() in src/utils/pathUtils.ts also prepend app_root to any path starting with / when rendering these values in Menu.tsx.

Since both mechanisms run independently, the prefix is applied twice.

Fix

Remove the manual backend prefixing block in superset/app.py. The frontend helpers already handle subdirectory deployments correctly:

  • brand.iconensureStaticPrefix (Menu.tsx)
  • theme.brandLogoUrlensureStaticPrefix (Menu.tsx)
  • theme.brandLogoHrefensureAppRoot (Menu.tsx)

Related issues


BEFORE / AFTER SCREENSHOTS OR ANIMATED GIF

Before — Logo is broken (404) when deployed under /dashboards. Network request shows .

before-logo

After — Logo loads correctly. Network request shows /dashboards/static/... (single prefix).

after-logo

TESTING INSTRUCTIONS

  1. Set APPLICATION_ROOT = "/dashboards" (or SUPERSET_APP_ROOT=/dashboards) in your config
  2. Start Superset
  3. Open http://localhost:8088/dashboards/
  4. Verify the Superset logo loads correctly (not a broken image)
  5. In DevTools → Network tab, confirm the logo request URL is /dashboards/static/assets/images/superset-logo-horiz.png (single /dashboards/ prefix)

ADDITIONAL INFORMATION

…logo to prevent double-prefix in subdirectory deployments

Fixes apache#39432

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review Bot commented Apr 20, 2026

Code Review Agent Run #c5c7e7

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: fd3e5ae..fd3e5ae
    • superset/app.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@dosubot dosubot Bot added the change:backend Requires changing the backend label Apr 20, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.49%. Comparing base (fbd0621) to head (708de55).

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #39472   +/-   ##
=======================================
  Coverage   64.49%   64.49%           
=======================================
  Files        2557     2557           
  Lines      133191   133182    -9     
  Branches    30935    30931    -4     
=======================================
  Hits        85897    85897           
+ Misses      45804    45795    -9     
  Partials     1490     1490           
Flag Coverage Δ
hive 39.88% <ø> (+<0.01%) ⬆️
mysql 60.50% <ø> (+<0.01%) ⬆️
postgres 60.59% <ø> (+<0.01%) ⬆️
presto 41.66% <ø> (+<0.01%) ⬆️
python 62.17% <ø> (+<0.01%) ⬆️
sqlite 60.22% <ø> (+<0.01%) ⬆️
unit 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 20, 2026

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 708de55
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/69e5ec1a52a6770008022dbe
😎 Deploy Preview https://deploy-preview-39472--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@Abdulrehman-PIAIC80387
Copy link
Copy Markdown
Contributor Author

Hi @rusackas @michael-s-molina @aminghadersohi — when you have a moment, mind taking a look? CI is green and the fix is small (just removes redundant backend prefixing since the frontend already handles it via ensureStaticPrefix/ensureAppRoot). Happy to address any feedback.

@onionhammer
Copy link
Copy Markdown

Getting an issue with RC2 specifying a URL to /static/assets/custom/my_logo.svg

i.e.

THEME_DEFAULT = {
    "token": {
        "brandLogoUrl": "/static/assets/custom/my_logo.svg"
    }
}

Causes error boostrapping the frontend

installHook.js:1 Unhandled error during app initialization TypeError: Cannot read properties of undefined (reading 'startsWith')
at n (8100.01fbde9ef08d98862d13.entry.js:8:21542)
at es (3264.df020978441f8a642d17.entry.js:735:950)
at ii (vendors.cba714126ad1ea16d814.entry.js:550:51407)
at c (vendors.cba714126ad1ea16d814.entry.js:554:21698)
at a3 (vendors.cba714126ad1ea16d814.entry.js:554:872)
at a4 (vendors.cba714126ad1ea16d814.entry.js:554:742)
at aY (vendors.cba714126ad1ea16d814.entry.js:552:11364)
at aq (vendors.cba714126ad1ea16d814.entry.js:552:8686)
at lg (vendors.cba714126ad1ea16d814.entry.js:554:19014)
at vendors.cba714126ad1ea16d814.entry.js:554:20399

@Abdulrehman-PIAIC80387
Copy link
Copy Markdown
Contributor Author

Thanks @onionhammer — this looks like a separate bug. Your crash is from theme.brandLogoHref being undefined (overriding THEME_DEFAULT in your config drops the default). This PR is a backend-only fix for the double-prefix issue, so it won't address yours.

Copy link
Copy Markdown
Member

@rusackas rusackas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@rusackas rusackas self-requested a review May 12, 2026 04:13
@rusackas rusackas merged commit fed29b3 into apache:master May 12, 2026
65 checks passed
qfcwell pushed a commit to qfcwell/superset that referenced this pull request May 12, 2026
…ments (apache#39472)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:backend Requires changing the backend size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Logo double-prefixed in subdirectory deploy Subdirectory deployment: logo double-prefixed when using SUPERSET_APP_ROOT

3 participants