Skip to content

[Trixie/Python 3.13] TypeError: unhashable type: 'dict' in acpu_web/pages/app.py #1

@dzhengg

Description

@dzhengg

After connecting to the access point, the web interface fails to load with a 500 Internal Server Error. I am running a fresh install of the latest versions: accesspopup 0.9, 22nd March 2026 installconfig.sh 1.0, 22nd March 2026

Environment

Raspberry Pi Zero 2W

OS

> cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 13 (trixie)"
NAME="Debian GNU/Linux"
VERSION_ID="13"
VERSION="13 (trixie)"
VERSION_CODENAME=trixie
DEBIAN_VERSION_FULL=13.2
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

Python

Version

> python3 --version
Python 3.13.5

Packages

> /usr/local/bin/acpu_web/venv/bin/pip list
Package              Version
-------------------- ---------
annotated-doc        0.0.4
annotated-types      0.7.0
anyio                4.13.0
certifi              2026.2.25
charset-normalizer   3.4.7
click                8.3.2
dnspython            2.8.0
email-validator      2.3.0
fastapi              0.135.3
fastapi-cli          0.0.24
fastapi-cloud-cli    0.16.1
fastar               0.10.0
h11                  0.16.0
httpcore             1.0.9
httptools            0.7.1
httpx                0.28.1
idna                 3.11
Jinja2               3.1.6
markdown-it-py       4.0.0
MarkupSafe           3.0.3
mdurl                0.1.2
pip                  25.1.1
pydantic             2.12.5
pydantic_core        2.41.5
pydantic-extra-types 2.11.2
pydantic-settings    2.13.1
Pygments             2.20.0
python-dotenv        1.2.2
python-multipart     0.0.26
pyusb                1.3.1
PyYAML               6.0.3
requests             2.33.1
rich                 14.3.4
rich-toolkit         0.19.7
rignore              0.7.6
sentry-sdk           2.57.0
shellingham          1.5.4
starlette            1.0.0
typer                0.24.1
typing_extensions    4.15.0
typing-inspection    0.4.2
urllib3              2.6.3
uvicorn              0.44.0
uvloop               0.22.1
watchfiles           1.1.1
websockets           16.0

Traceback

> sudo journalctl -u acpu_web_app.service --no-pager --no-full -l
Apr 11 22:46:31 pi uvicorn[5406]: After sock.recv
Apr 11 22:46:31 pi uvicorn[5406]: Receive Try:
Apr 11 22:46:31 pi uvicorn[5406]: Receive Loop
Apr 11 22:46:31 pi uvicorn[5406]: Msg Returned: {'code': 'UPDT', 'args': 0}
Apr 11 22:46:31 pi uvicorn[5406]: After sock.recv
Apr 11 22:46:31 pi uvicorn[5406]: Receive Try:
Apr 11 22:46:31 pi uvicorn[5406]: Receive Loop
Apr 11 22:46:31 pi uvicorn[5406]: Msg Returned: {'code': 'WIAC', 'args': [['AccessPopup', 'wlan0', 'AccessPopup', '88:A2:9E:42:7B:94', 'ap', '192.168.50.5/24']]}
Apr 11 22:46:31 pi uvicorn[5406]: After sock.recv
Apr 11 22:46:31 pi uvicorn[5406]: Receive Try:
Apr 11 22:46:31 pi uvicorn[5406]: Receive Loop
Apr 11 22:46:31 pi uvicorn[5406]: Msg Returned: {'code': 'WIPL', 'args': ['MyNetwork']}
Apr 11 22:46:31 pi uvicorn[5406]: After sock.recv
Apr 11 22:46:31 pi uvicorn[5406]: Receive Try:
Apr 11 22:46:31 pi uvicorn[5406]: Receive Loop
Apr 11 22:46:31 pi uvicorn[5406]: Msg Returned: {'code': 'LANP', 'args': [{'type': 'eth', 'name': 'USB Gadget (shared)', 'autocon': '10', 'active': 'yes', 'devname': 'usb0', 'state': 'activated', 'conip': '10.12.194.1/28'}, {'type': 'eth', 'name': 'USB Gadget (client)', 'autocon': '100', 'active': 'no', 'devname': ''}, {'type': 'eth', 'name': 'netplan-eth0', 'autocon': '0', 'active': 'no', 'devname': ''}]}
Apr 11 22:46:32 pi uvicorn[5406]: After sock.recv
Apr 11 22:46:32 pi uvicorn[5406]: Receive Try:
Apr 11 22:46:32 pi uvicorn[5406]: Receive Loop
Apr 11 22:46:32 pi uvicorn[5406]: Msg Returned: {'code': 'APPL', 'args': [['AccessPopup', 'AccessPopup', 'wlan0', 'wlan0']]}
Apr 11 22:46:32 pi uvicorn[5406]: After sock.recv
Apr 11 22:46:32 pi uvicorn[5406]: Receive Try:
Apr 11 22:46:32 pi uvicorn[5406]: Receive Loop
Apr 11 22:46:32 pi uvicorn[5406]: Msg Returned: {'code': 'HOST', 'args': 'pi\n'}
Apr 11 22:46:32 pi uvicorn[5406]: Active_wifi is: [['AccessPopup', 'wlan0', 'AccessPopup', '88:A2:9E:42:7B:94', 'ap', '192.168.50.5/24']]
Apr 11 22:46:32 pi uvicorn[5406]: Lan Returned: [{'type': 'eth', 'name': 'USB Gadget (shared)', 'autocon': '10', 'active': 'yes', 'devname': 'usb0', 'state': 'activated', 'conip': '10.12.194.1/28'}, {'type': 'eth', 'name': 'USB Gadget (client)', 'autocon': '100', 'active': 'no', 'devname': ''}, {'type': 'eth', 'name': 'netplan-eth0', 'autocon': '0', 'active': 'no', 'devname': ''}]
Apr 11 22:46:32 pi uvicorn[5406]: INFO:     192.168.50.248:56109 - "GET / HTTP/1.1" 500 Internal Server Error
Apr 11 22:46:32 pi uvicorn[5406]: ERROR:    Exception in ASGI application
Apr 11 22:46:32 pi uvicorn[5406]: Traceback (most recent call last):
Apr 11 22:46:32 pi uvicorn[5406]:   File "/usr/local/bin/acpu_web/venv/lib/python3.13/site-packages/uvicorn/protocols/http/httptools_impl.py", line 420, in run_asgi
Apr 11 22:46:32 pi uvicorn[5406]:     result = await app(  # type: ignore[func-returns-value]
Apr 11 22:46:32 pi uvicorn[5406]:              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Apr 11 22:46:32 pi uvicorn[5406]:         self.scope, self.receive, self.send
Apr 11 22:46:32 pi uvicorn[5406]:         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Apr 11 22:46:32 pi uvicorn[5406]:     )
Apr 11 22:46:32 pi uvicorn[5406]:     ^
Apr 11 22:46:32 pi uvicorn[5406]:   File "/usr/local/bin/acpu_web/venv/lib/python3.13/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
Apr 11 22:46:32 pi uvicorn[5406]:     return await self.app(scope, receive, send)
Apr 11 22:46:32 pi uvicorn[5406]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Apr 11 22:46:32 pi uvicorn[5406]:   File "/usr/local/bin/acpu_web/venv/lib/python3.13/site-packages/fastapi/applications.py", line 1163, in __call__
Apr 11 22:46:32 pi uvicorn[5406]:     await super().__call__(scope, receive, send)
Apr 11 22:46:32 pi uvicorn[5406]:   File "/usr/local/bin/acpu_web/venv/lib/python3.13/site-packages/starlette/applications.py", line 90, in __call__
Apr 11 22:46:32 pi uvicorn[5406]:     await self.middleware_stack(scope, receive, send)
Apr 11 22:46:32 pi uvicorn[5406]:   File "/usr/local/bin/acpu_web/venv/lib/python3.13/site-packages/starlette/middleware/errors.py", line 186, in __call__
Apr 11 22:46:32 pi uvicorn[5406]:     raise exc
Apr 11 22:46:32 pi uvicorn[5406]:   File "/usr/local/bin/acpu_web/venv/lib/python3.13/site-packages/starlette/middleware/errors.py", line 164, in __call__
Apr 11 22:46:32 pi uvicorn[5406]:     await self.app(scope, receive, _send)
Apr 11 22:46:32 pi uvicorn[5406]:   File "/usr/local/bin/acpu_web/venv/lib/python3.13/site-packages/starlette/middleware/exceptions.py", line 63, in __call__
Apr 11 22:46:32 pi uvicorn[5406]:     await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
Apr 11 22:46:32 pi uvicorn[5406]:   File "/usr/local/bin/acpu_web/venv/lib/python3.13/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
Apr 11 22:46:32 pi uvicorn[5406]:     raise exc
Apr 11 22:46:32 pi uvicorn[5406]:   File "/usr/local/bin/acpu_web/venv/lib/python3.13/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
Apr 11 22:46:32 pi uvicorn[5406]:     await app(scope, receive, sender)
Apr 11 22:46:32 pi uvicorn[5406]:   File "/usr/local/bin/acpu_web/venv/lib/python3.13/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
Apr 11 22:46:32 pi uvicorn[5406]:     await self.app(scope, receive, send)
Apr 11 22:46:32 pi uvicorn[5406]:   File "/usr/local/bin/acpu_web/venv/lib/python3.13/site-packages/starlette/routing.py", line 660, in __call__
Apr 11 22:46:32 pi uvicorn[5406]:     await self.middleware_stack(scope, receive, send)
Apr 11 22:46:32 pi uvicorn[5406]:   File "/usr/local/bin/acpu_web/venv/lib/python3.13/site-packages/starlette/routing.py", line 680, in app
Apr 11 22:46:32 pi uvicorn[5406]:     await route.handle(scope, receive, send)
Apr 11 22:46:32 pi uvicorn[5406]:   File "/usr/local/bin/acpu_web/venv/lib/python3.13/site-packages/starlette/routing.py", line 276, in handle
Apr 11 22:46:32 pi uvicorn[5406]:     await self.app(scope, receive, send)
Apr 11 22:46:32 pi uvicorn[5406]:   File "/usr/local/bin/acpu_web/venv/lib/python3.13/site-packages/fastapi/routing.py", line 134, in app
Apr 11 22:46:32 pi uvicorn[5406]:     await wrap_app_handling_exceptions(app, request)(scope, receive, send)
Apr 11 22:46:32 pi uvicorn[5406]:   File "/usr/local/bin/acpu_web/venv/lib/python3.13/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
Apr 11 22:46:32 pi uvicorn[5406]:     raise exc
Apr 11 22:46:32 pi uvicorn[5406]:   File "/usr/local/bin/acpu_web/venv/lib/python3.13/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
Apr 11 22:46:32 pi uvicorn[5406]:     await app(scope, receive, sender)
Apr 11 22:46:32 pi uvicorn[5406]:   File "/usr/local/bin/acpu_web/venv/lib/python3.13/site-packages/fastapi/routing.py", line 120, in app
Apr 11 22:46:32 pi uvicorn[5406]:     response = await f(request)
Apr 11 22:46:32 pi uvicorn[5406]:                ^^^^^^^^^^^^^^^^
Apr 11 22:46:32 pi uvicorn[5406]:   File "/usr/local/bin/acpu_web/venv/lib/python3.13/site-packages/fastapi/routing.py", line 674, in app
Apr 11 22:46:32 pi uvicorn[5406]:     raw_response = await run_endpoint_function(
Apr 11 22:46:32 pi uvicorn[5406]:                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Apr 11 22:46:32 pi uvicorn[5406]:     ...<3 lines>...
Apr 11 22:46:32 pi uvicorn[5406]:     )
Apr 11 22:46:32 pi uvicorn[5406]:     ^
Apr 11 22:46:32 pi uvicorn[5406]:   File "/usr/local/bin/acpu_web/venv/lib/python3.13/site-packages/fastapi/routing.py", line 328, in run_endpoint_function
Apr 11 22:46:32 pi uvicorn[5406]:     return await dependant.call(**values)
Apr 11 22:46:32 pi uvicorn[5406]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Apr 11 22:46:32 pi uvicorn[5406]:   File "/usr/local/bin/acpu_web/pages/app.py", line 149, in index
Apr 11 22:46:32 pi uvicorn[5406]:     return templates.TemplateResponse("index.html", {"context":get_nm_update(),"request":request})
Apr 11 22:46:32 pi uvicorn[5406]:            ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Apr 11 22:46:32 pi uvicorn[5406]:   File "/usr/local/bin/acpu_web/venv/lib/python3.13/site-packages/starlette/templating.py", line 148, in TemplateResponse
Apr 11 22:46:32 pi uvicorn[5406]:     template = self.get_template(name)
Apr 11 22:46:32 pi uvicorn[5406]:   File "/usr/local/bin/acpu_web/venv/lib/python3.13/site-packages/starlette/templating.py", line 115, in get_template
Apr 11 22:46:32 pi uvicorn[5406]:     return self.env.get_template(name)
Apr 11 22:46:32 pi uvicorn[5406]:            ~~~~~~~~~~~~~~~~~~~~~^^^^^^
Apr 11 22:46:32 pi uvicorn[5406]:   File "/usr/local/bin/acpu_web/venv/lib/python3.13/site-packages/jinja2/environment.py", line 1016, in get_template
Apr 11 22:46:32 pi uvicorn[5406]:     return self._load_template(name, globals)
Apr 11 22:46:32 pi uvicorn[5406]:            ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
Apr 11 22:46:32 pi uvicorn[5406]:   File "/usr/local/bin/acpu_web/venv/lib/python3.13/site-packages/jinja2/environment.py", line 964, in _load_template
Apr 11 22:46:32 pi uvicorn[5406]:     template = self.cache.get(cache_key)
Apr 11 22:46:32 pi uvicorn[5406]:   File "/usr/local/bin/acpu_web/venv/lib/python3.13/site-packages/jinja2/utils.py", line 477, in get
Apr 11 22:46:32 pi uvicorn[5406]:     return self[key]
Apr 11 22:46:32 pi uvicorn[5406]:            ~~~~^^^^^
Apr 11 22:46:32 pi uvicorn[5406]:   File "/usr/local/bin/acpu_web/venv/lib/python3.13/site-packages/jinja2/utils.py", line 515, in __getitem__
Apr 11 22:46:32 pi uvicorn[5406]:     rv = self._mapping[key]
Apr 11 22:46:32 pi uvicorn[5406]:          ~~~~~~~~~~~~~^^^^^
Apr 11 22:46:32 pi uvicorn[5406]: TypeError: unhashable type: 'dict'

Reproduction Steps

  1. Fresh install of AccessPopup using sudo ./installconfig.sh
  2. Enable web interface via option 8-1
  3. Launch access point mode using sudo accesspopup -a
  4. Provide username and password to AccessPopup network
  5. Browser at http://192.168.50.5:8052/ shows Internal Server Error
  6. Logs show TypeError: unhashable type: 'dict'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions