Skip to content

Crash when accessed to webserver is done #1

Description

@xyphro

Did not debug it yet, but The Webserver application crashes when started and the first access from the webserver is done:

python main.py
INFO: Started server process [1899296]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://localhost:8000 (Press CTRL+C to quit)
INFO: ::1:62866 - "GET / HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "C:\Users\xyphro\AppData\Local\Programs\Python\Python314\Lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 415, in run_asgi
result = await app( # type: ignore[func-returns-value]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
self.scope, self.receive, self.send
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "C:\Users\xyphro\AppData\Local\Programs\Python\Python314\Lib\site-packages\uvicorn\middleware\proxy_headers.py", line 63, in call
return await self.app(scope, receive, send)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\xyphro\AppData\Local\Programs\Python\Python314\Lib\site-packages\fastapi\applications.py", line 1159, in call
await super().call(scope, receive, send)
File "C:\Users\xyphro\AppData\Local\Programs\Python\Python314\Lib\site-packages\starlette\applications.py", line 90, in call
await self.middleware_stack(scope, receive, send)
File "C:\Users\xyphro\AppData\Local\Programs\Python\Python314\Lib\site-packages\starlette\middleware\errors.py", line 186, in call
raise exc
File "C:\Users\xyphro\AppData\Local\Programs\Python\Python314\Lib\site-packages\starlette\middleware\errors.py", line 164, in call
await self.app(scope, receive, _send)
File "C:\Users\xyphro\AppData\Local\Programs\Python\Python314\Lib\site-packages\starlette\middleware\exceptions.py", line 63, in call
await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
File "C:\Users\xyphro\AppData\Local\Programs\Python\Python314\Lib\site-packages\starlette_exception_handler.py", line 53, in wrapped_app
raise exc
File "C:\Users\xyphro\AppData\Local\Programs\Python\Python314\Lib\site-packages\starlette_exception_handler.py", line 42, in wrapped_app
await app(scope, receive, sender)
File "C:\Users\xyphro\AppData\Local\Programs\Python\Python314\Lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in call
await self.app(scope, receive, send)
File "C:\Users\xyphro\AppData\Local\Programs\Python\Python314\Lib\site-packages\starlette\routing.py", line 660, in call
await self.middleware_stack(scope, receive, send)
File "C:\Users\xyphro\AppData\Local\Programs\Python\Python314\Lib\site-packages\starlette\routing.py", line 680, in app
await route.handle(scope, receive, send)
File "C:\Users\xyphro\AppData\Local\Programs\Python\Python314\Lib\site-packages\starlette\routing.py", line 276, in handle
await self.app(scope, receive, send)
File "C:\Users\xyphro\AppData\Local\Programs\Python\Python314\Lib\site-packages\fastapi\routing.py", line 134, in app
await wrap_app_handling_exceptions(app, request)(scope, receive, send)
File "C:\Users\xyphro\AppData\Local\Programs\Python\Python314\Lib\site-packages\starlette_exception_handler.py", line 53, in wrapped_app
raise exc
File "C:\Users\xyphro\AppData\Local\Programs\Python\Python314\Lib\site-packages\starlette_exception_handler.py", line 42, in wrapped_app
await app(scope, receive, sender)
File "C:\Users\xyphro\AppData\Local\Programs\Python\Python314\Lib\site-packages\fastapi\routing.py", line 120, in app
response = await f(request)
^^^^^^^^^^^^^^^^
File "C:\Users\xyphro\AppData\Local\Programs\Python\Python314\Lib\site-packages\fastapi\routing.py", line 674, in app
raw_response = await run_endpoint_function(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<3 lines>...
)
^
File "C:\Users\xyphro\AppData\Local\Programs\Python\Python314\Lib\site-packages\fastapi\routing.py", line 328, in run_endpoint_function
return await dependant.call(**values)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Temp\MagnovaExamples-main\MagnovaExamples-main\Oscilloscopes\WebControl\main.py", line 93, in root
return templates.TemplateResponse("index.html", {"request": request})
~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\xyphro\AppData\Local\Programs\Python\Python314\Lib\site-packages\starlette\templating.py", line 148, in TemplateResponse
template = self.get_template(name)
File "C:\Users\xyphro\AppData\Local\Programs\Python\Python314\Lib\site-packages\starlette\templating.py", line 115, in get_template
return self.env.get_template(name)
~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "C:\Users\xyphro\AppData\Local\Programs\Python\Python314\Lib\site-packages\jinja2\environment.py", line 1016, in get_template
return self._load_template(name, globals)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
File "C:\Users\xyphro\AppData\Local\Programs\Python\Python314\Lib\site-packages\jinja2\environment.py", line 964, in _load_template
template = self.cache.get(cache_key)
File "C:\Users\xyphro\AppData\Local\Programs\Python\Python314\Lib\site-packages\jinja2\utils.py", line 477, in get
return self[key]
~~~~^^^^^
File "C:\Users\xyphro\AppData\Local\Programs\Python\Python314\Lib\site-packages\jinja2\utils.py", line 515, in getitem
rv = self._mapping[key]
~~~~~~~~~~~~~^^^^^
TypeError: cannot use 'tuple' as a dict key (unhashable type: 'dict')
INFO: ::1:58697 - "GET /favicon.ico HTTP/1.1" 404 Not Found

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions