Bug 64218 - Servlet receives no parameters from post request
Summary: Servlet receives no parameters from post request
Status: RESOLVED DUPLICATE of bug 64202
Alias: None
Product: Tomcat 9
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 9.0.31
Hardware: PC All
: P2 critical (vote)
Target Milestone: -----
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2020-03-11 17:10 UTC by ron
Modified: 2020-03-11 17:12 UTC (History)
0 users

html file for test app to reproduce (2.62 KB, text/html)
2020-03-11 17:10 UTC, ron
java file for test app (622 bytes, text/plain)
2020-03-11 17:11 UTC, ron

Note You need to log in before you can comment on or make changes to this bug.
Description ron 2020-03-11 17:10:41 UTC
Created attachment 37094 [details]
html file for test app to reproduce

Since upgrading to 9.0.31 I've had an issue where occasionally my servlet receives none of the parameters that are posted to it. The bug is periodic, but the frequency of the issue tends to grow with the amount of data posted. But it's very erratic. If I send 5MB request, sometimes it will fail 3/4 of the time, and then it can succeed 100 times in a row. Testing just now with 500K, I went hundreded of requests without an error, and then suddenly 95% of the requests started failing

I've reproduced the bug on 3 separate servers (Windows Server 2016) as well as my dev machine (Windows 10) to rule out network or hardware issues. I've tested with 9.0.14 and 9.0.30 and am not able to reproduce the error with either of them, so it appears to be specific to 9.0.31. I also have not been able to reproduce it over an HTTP connection, only HTTPS.

When this happens, most of the time the servlet executes just fine except that it sees no data in the parameters. Occasionally I do get back an HTTP error (I believe it was a 500 error). 

I generally see no message in the error logs. I do sometimes see the following, but not always (and I have log level set to debug)

11-Mar-2020 12:42:58.608 INFO [https-jsse-nio-8431-exec-15] org.apache.coyote.http11.Http11Processor.service Error parsing HTTP request header
 Note: further occurrences of HTTP request parsing errors will be logged at DEBUG level.
	java.lang.IllegalArgumentException: Request header is too large
		at org.apache.coyote.http11.Http11InputBuffer.fill(Http11InputBuffer.java:722)
		at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:401)
		at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:260)
		at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
		at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
		at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1639)
		at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
		at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
		at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
		at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
		at java.base/java.lang.Thread.run(Thread.java:834)

Because this was a very erratic bug, I had to throw together a test app to be able to reproduce it reliably. I'm attaching an html and java file. Just throw them into a dynamic web project and run it. It just allows you to generate a random size payload, send it to the server via an ajax request, and the server reports back to client how many bytes it received (which is either all of it or nothing).
Comment 1 ron 2020-03-11 17:11:06 UTC
Created attachment 37095 [details]
java file for test app
Comment 2 Remy Maucherat 2020-03-11 17:12:20 UTC

*** This bug has been marked as a duplicate of bug 64202 ***