wandb/openui · error · HTTPException

Asset not found: {full_path}

Error message

Asset not found: {full_path}

What it means

Raised by OpenUI's SPA catch-all route: when the requested path contains a dot (interpreted as a static asset request), the route checks whether the file exists in the built dist directory; if not, it raises HTTP 404 'Asset not found: {full_path}'. It means the frontend bundle or asset requested was not present in the deployed build output.

Source

Thrown at backend/openui/server.py:581

# we can serve our annotation iframe from the same domain in development
if config.ENV != config.Env.PROD:
    app.mount(
        "/openui",
        StaticFiles(directory=Path(__file__).parent / "dist" / "annotator", html=True),
        name="annotator",
    )


@app.get("/{full_path:path}", include_in_schema=False)
def spa(full_path: str):
    dist_dir = Path(__file__).parent / "dist"
    # TODO: hacky way to only serve index.html on root urls
    files = [entry.name for entry in dist_dir.iterdir() if entry.is_file()]
    if full_path in files:
        return FileResponse(dist_dir / full_path)
    if "." in full_path:
        raise HTTPException(status_code=404, detail=f"Asset not found: {full_path}")
    return HTMLResponse((dist_dir / "index.html").read_bytes())


base_url = "https://api.wandb.ai"
def check_wandb_auth():
    global base_url
    try:
        from wandb.cli.cli import _get_cling_api
        api = _get_cling_api()
        base_url = api.settings("base_url")
    except:
        base_url = "https://api.wandb.ai"
    auth = requests.utils.get_netrc_auth(base_url)
    key = None
    if auth:
        key = auth[-1]
    if os.getenv("WANDB_API_KEY"):
        key = os.environ["WANDB_API_KEY"]

View on GitHub (pinned to 42d7ab4ab6)

Solutions

  1. Rebuild the frontend (cd frontend && npm run build) and redeploy so dist contains the current hashed assets.
  2. Force clients to fetch fresh index.html (cache-bust or set no-cache on index.html) so they reference the new asset hashes.
  3. Purge CDN/browser caches of old index.html after deployments.
  4. Verify the requested asset path exists under backend/openui/dist; if the path is a real route without an extension, note the 404 only applies to dotted paths.

Example fix

# before (deploy without building -> dist missing assets)
docker build -t openui .
# after
cd frontend && npm ci && npm run build && cd ..
docker build -t openui .
Defensive patterns

Strategy: try-catch

Validate before calling

// client: detect missing chunk load and hard-reload once
window.addEventListener('error', (e) => {
  if (e.target?.tagName === 'SCRIPT' && !sessionStorage.getItem('reloaded')) {
    sessionStorage.setItem('reloaded', '1');
    location.reload(); // fetch fresh index.html with new hashes
  }
}, true);

Try / catch

try {
  const res = await fetch(assetUrl);
  if (res.status === 404) {
    await purgeAndRebuildIndex(); // refetch / to get new asset hashes
    return fetch(assetUrl); // retry with updated URL map
  }
  return res;
} catch (err) {
  showOfflineMessage();
}

Prevention

When it happens

Trigger: Requesting a static path like /assets/index-abc123.js or /favicon.ico that is not a file inside backend/openui/dist — typically after deploying a new build whose hashed filenames changed while the browser cached the old index.html, or serving the app without building the frontend.

Common situations: Stale cached index.html referencing old hashed JS/CSS chunks after a redeploy, skipping the frontend build (npm run build) so dist is empty or outdated, CDN caching old asset URLs, or typos in asset paths.

Related errors


AI-assisted analysis of wandb/openui@42d7ab4ab6 (2026-09-01). Data as JSON: /api/errors/82454d91a8ae231b. Report an issue: GitHub.