Skip to content

Failure to setup a development instance of the upload server #30

Description

@Hatepoem

Attempted to instance a server. The Z_SERVER works as expected. The server_upload fails.

First, it starts successfully. When user attempts to visit the appropriate web page (http://localhost:5010/upload), the server_upload fails with a Python error.

The same error appears when running with python3 or with gunicorn-20.1.0.

Error log

�[32mINFO�[0m:     Started server process [�[36m42618�[0m]
�[32mINFO�[0m:     Waiting for application startup.
�[32mINFO�[0m:     Application startup complete.
�[32mINFO�[0m:     Uvicorn running on �[1mhttp://0.0.0.0:5010�[0m (Press CTRL+C to quit)
�[31mERROR�[0m:    Exception in ASGI application
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/uvicorn/protocols/http/h11_impl.py", line 366, in run_asgi
    result = await app(self.scope, self.receive, self.send)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/uvicorn/middleware/proxy_headers.py", line 75, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/fastapi/applications.py", line 271, in __call__
    await super().__call__(scope, receive, send)
  File "/usr/lib/python3/dist-packages/starlette/applications.py", line 122, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/lib/python3/dist-packages/starlette/middleware/errors.py", line 184, in __call__
    raise exc
  File "/usr/lib/python3/dist-packages/starlette/middleware/errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "/usr/lib/python3/dist-packages/starlette/middleware/exceptions.py", line 79, in __call__
    raise exc
  File "/usr/lib/python3/dist-packages/starlette/middleware/exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "/usr/lib/python3/dist-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
    raise e
  File "/usr/lib/python3/dist-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "/usr/lib/python3/dist-packages/starlette/routing.py", line 718, in __call__
    await route.handle(scope, receive, send)
  File "/usr/lib/python3/dist-packages/starlette/routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "/usr/lib/python3/dist-packages/starlette/routing.py", line 66, in app
    response = await func(request)
               ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/fastapi/routing.py", line 237, in app
    raw_response = await run_endpoint_function(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/fastapi/routing.py", line 163, in run_endpoint_function
    return await dependant.call(**values)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/git/Ridepad/uwu-logs/server_upload.py", line 68, in upload_get
    return TEMPLATES.TemplateResponse(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Jinja2Templates.TemplateResponse() got an unexpected keyword argument 'request'

Environment

.Debian 12

pip install -r requirements.txt
apt-get install python3=3.11.2-1+b1 \
    python3-fastapi=0.92.0-1 \
    python3-pandas=1.5.3+dfsg-2 \
    python3-zstd=1.5.2.5-1+b3 \
    python3-jinja2=3.1.2-1+deb12u2 \
    python3-flask=2.2.2-3

I suspect this to be a library version incompatibility. I have no experience with Python. How do I set up my environment to side step this error?

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