Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

已关闭 适合新手
#809 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 4 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
85/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
冷清
技术栈
fastapi, python
领域
backend

调研方向

阅读 react_app 入口处的 burr/tracking/server/run.py,并检查第 341 行附近的 TemplateResponse 调用。使用 Starlette 1.0 或更高版本复现 tracking UI 故障,然后验证提供的 index.html 返回 HTTP 200;如果添加建议的 Starlette 最低版本,还要检查 burr[start] 的依赖配置。

由索引模型根据 Issue 内容生成。

描述

status/needs-triage

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:

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

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.

主要语言
Python
星标
2.6k
派生
209
平均合并
8 天 9 小时
30 天内合并 PR
26

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

apache/burr 的其他 Issue

查看 apache/burr 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。