# FastAPI - Internal Server Error

**URL:** https://openziti.discourse.group/t/fastapi-internal-server-error/2336
**Category:** SDK Questions
**Created:** [March 22, 2024, 2:06am UTC](https://openziti.discourse.group/t/fastapi-internal-server-error/2336 "2024-03-22T02:06:39Z")
**Posts on this page:** 1
**Showing post:** 6

<div class="post-metadata">

### Author: ![papiris](https://avatars.discourse-cdn.com/v4/letter/p/dbc845/32.png) [@papiris](https://openziti.discourse.group/u/papiris)
#### Post date: [April 21, 2024, 7:26pm UTC](https://openziti.discourse.group/t/fastapi-internal-server-error/2336/6 "2024-04-21T19:26:09Z")

</div>

I've also had similar trouble with FastAPI over in [Using OpenZiti in distributed surveillance system](https://openziti.discourse.group/t/2135).

The function at `/login` might be provided with the underlying [ASGI interface tuple](https://www.uvicorn.org/#the-asgi-interface) when zitified, maybe because openziti changes something in a way that FastAPI no longer extracts the recieve (Request) part directly, without the function explicitly defining it as parameter?  
That's just my guess, but adding `request: Request` as a parameter for functions worked for me.

Could you try adding `request` as a parameter to your URL-path(?) functions?  
i.e. something like

```python
@app.post("/api/login")
async def login(request: Request, auth_details: AuthDetailsLogin, response: Response):

```

Disclaimer: I haven't run your code on my machine.

---

_[View the full topic](https://openziti.discourse.group/t/fastapi-internal-server-error/2336)._
