-
-
Notifications
You must be signed in to change notification settings - Fork 755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connection aborted after HttpParserInvalidMethodError when making consecutive POST requests #1345
Comments
I had the same issue with
This seemed to fix it |
We are affected by encode/uvicorn#1345 Until this is resolved we need uvicorn to stay below version 0.17
I have the same problem with 0.17.0 and 0.17.1 for PUT/POST calls where the body data exceed 64kb and the request does not have an Can be reproduced by a simple application with one endpoint and following curl call: |
I can also confirm that this issue occurs for Tried to add the Can confirm that the issue occurs for requests with larger body data. |
I've just encountered this problem. Again, My service is deployed on Kubernetes, and I've found when I allocate >3 CPUs, the issue no longer occurs and I can raise the request body size, finally hitting the 413 threshold before ever seeing this |
I'm having this very same issue for |
I also faced this issue, I'm using conda package |
I assume the sensible thing here for now would be to revert #1332 and issue a new release. Does that seem like a reasonable course of action? |
Not really. That PR was solving a memory leak. What we can do is: I can check if I can solve this issue this afternoon without having to do the above. Although, I think we should go with #1307 anyway... For the reasons I've already stated on that PR. The way I see it, reverting #1332 and only that is not an option here. |
How to reproduce the bug: from httpx import Client
with Client() as client:
client.post("http://localhost:8000/test", content="x" * 100000) Uvicorn command: |
The solution I propose is to revert both. PRs were created:
Both memory leak and this issue are solved with my proposal. |
Now resolved in 0.17.2 - #1356 |
Checklist
master
.Describe the bug
After making a few
POST
requests, one of the requests ends with the connection aborted. The server logs a log about an invalid HTTP method, however only POST method is consistently attempted.Steps to reproduce the bug
The bug is reproduced when making multiple
requests.posts
against a service running with latest uvicornUnfortunately I was not able to create a reliable reproduction, as running locally I seemed to make successful requests
Expected behavior
All the requests used to pass in sequence without errors
Actual behavior
One of the requests, after an inconsistent number of successful requests, fails with a connection error after sending the request. The server logs
Debugging material
Request aborted
Server warning (
uvicorn.error
).Environment
Additional context
Since requests library is using a keepalive for the requests, a suspect change is the recent #1332, and reverting uvicorn version seems to make the problem go away.
The text was updated successfully, but these errors were encountered: