Uvicorn hangs when trying to include large inputs with body-size limit and more_body=True #2128
Unanswered
AshwathsGIT
asked this question in
Potential Issue
Replies: 1 comment
-
I found a python library that takes care of this via FastAPI middleware. If the upload file is too large it will throw a 413 HTTP error; "Error: Request Entity Too Large" from starlette_validation_uploadfile import ValidateUploadFileMiddleware from fastapi import ( app = FastAPI() #add this after FastAPI app is declared @app.post("/") |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
ASGI [4] Receive {'type': 'http.request', 'body': '<260403 bytes>', 'more_body': True}
The fastapi endpoint works when the input is less than 260k bytes, but when a larger input is given, it hangs with the above statement from the trace logs before even getting to the first line of the endpoint.
I'm trying to find a way to increase the body size limit. I came across the --limit-request-body, a command-line argument which on trying it said, it's not a valid option. If this is a valid option in previous version please let me know which version I should use.
Or if there an alternative way, If anyone has faced it before, please give your thoughts on handling this. Thanks.
Beta Was this translation helpful? Give feedback.
All reactions