https://bz.apache.org/bugzilla/show_bug.cgi?id=64218

            Bug ID: 64218
           Summary: Servlet receives no parameters from post request
           Product: Tomcat 9
           Version: 9.0.31
          Hardware: PC
            Status: NEW
          Severity: critical
          Priority: P2
         Component: Catalina
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: -----

Created attachment 37094
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=37094&action=edit
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).

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to