apache / apache/burr

Tracking UI returns HTTP 500 on all pages with Starlette ≥1.0 (TemplateResponse signature)

Open Beginner friendly
#809 2 comments 0 reactions 0 assignees View on GitHub
status/needs-triage
Dominant language
Python
Stars
2.5k
Forks
195
Avg merge
6d 10h
Merged PRs (30d)
17

Description

## Summary
The tracking UI server (`burr` / `burr-admin-server`) returns HTTP 500 on every page when Starlette ≥1.0 is installed. The JSON API is unaffected — only the served React app (`index.html`) fails. Because `burr[start]` doesn't pin Starlette (it arrives transitively via an unpinned `fastapi`), a fresh `pip install "burr[start]"` resolves to a current Starlette and the UI is broken out of the box.

## Environment
- burr 0.40.2 (via `burr[start]`)
- starlette 1.3.0, jinja2 3.1.6, fastapi 0.136.3
- Reproduced on Python 3.13 and 3.14 (version-independent)

## Root cause
`burr/tracking/server/run.py:341` uses the pre-1.0 Starlette signature:

```python
return templates.TemplateResponse("index.html", {"request": req})
```

Starlette 0.29 made `request` the first positional argument and 1.0 removed the old form, so `"index.html"` binds to `request` and the context dict binds to `name`; Jinja2 then tries to load a template whose name is a dict and raises `TypeError: unhashable type: 'dict'`. (Same break FastAPI hit in fastapi/fastapi#15198.)

## Fix

```python
return templates.TemplateResponse(request=req, name="index.html")
```

This is the only `TemplateResponse` call site in the package; with it the UI renders (HTTP 200) on Python 3.14 + Starlette 1.3.0. Verified locally. Worth pairing with a `starlette>=0.29` floor, since the keyword form requires it.

## Traceback

```
File ".../burr/tracking/server/run.py", line 341, in react_app
return templates.TemplateResponse("index.html", {"request": req})
File ".../starlette/templating.py", line 148, in TemplateResponse
template = self.get_template(name)
File ".../jinja2/environment.py", line 1016, in get_template
return self._load_template(name, globals)
TypeError: unhashable type: 'dict'
```

Happy to send a PR if useful.

Contributor guide

Open the contributing guide

Research direction

Read burr/tracking/server/run.py at the react_app entry point and inspect the TemplateResponse call around line 341. Reproduce the tracking UI failure with Starlette 1.0 or newer, then verify that the served index.html returns HTTP 200; also check the burr[start] dependency configuration if adding the suggested Starlette floor.

Written by the indexing model from the issue text.

Assessment

Tech stack
fastapi, python
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
85/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.