[fileupload] - Supports HTTP/2 Tomcat UpgradeProtocol

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[fileupload] - Supports HTTP/2 Tomcat UpgradeProtocol

Yozons on Gmail
Does FileUpload support HTTP/2 over HTTPS?  We seem to get exceptions
and even long waits trying to upload files when enabling HTTP/2.

In Tomcat, we've tried adding <UpgradeProtocol
className="org.apache.coyote.http2.Http2Protocol" /> to our secure
Connector, and that seems to work for normal web requests
(application/x-www-form-urlencoded), but not well for file upload
requests (multipart/form-data).  We get broken connections and file
uploads that seem to take much longer when HTTP/2 is enabled.   If we
remove UpgradeProtocol, then the file uploads seem to work normally again.

Thanks in advance for any good insights.

Reply | Threaded
Open this post in threaded view
|

Re: [fileupload] - Supports HTTP/2 Tomcat UpgradeProtocol

Yozons on Gmail
I noted that Tomcat 9 seems fail like FileUpload when using Servlet 3's
@MultipartConfig.  So it doesn't seem that UpgradeProtocol works even
with Tomcat Servlet's handling of file uploads any better than FileUpload.

I get this exception when I try to allow HTTP/2 with file uploading;
does this imply there's no way to make these work together:

17:11:59.793 ERROR - Exception:
org.apache.tomcat.util.http.fileupload.impl.IOFileUploadException:
Processing of multipart/form-data request failed. java.io.IOException:
Stream reset - FileUploader.uploadToBuffer()
java.io.IOException:
org.apache.tomcat.util.http.fileupload.impl.IOFileUploadException:
Processing of multipart/form-data request failed. java.io.IOException:
Stream reset
     at
org.apache.catalina.connector.Request.parseParts(Request.java:2916)
~[catalina.jar:9.0.35]
     at
org.apache.catalina.connector.Request.getParts(Request.java:2771)
~[catalina.jar:9.0.35]
     at
org.apache.catalina.connector.RequestFacade.getParts(RequestFacade.java:1098)
~[catalina.jar:9.0.35]
     at
com.esignforms.yozons.util.FileUploader.uploadToBuffer(FileUploader.java:288)
[yozons-esignforms-20.5.25.jar:?]
     at com.esignforms.yozons.jsp.PageBean.init(PageBean.java:200)
[yozons-esignforms-20.5.25.jar:?]
     at
com.esignforms.yozons.servlet.PickupTransaction.doGet(PickupTransaction.java:31)
[yozons-esignforms-20.5.25.jar:?]
     at
com.esignforms.yozons.servlet.PickupTransaction.doPost(PickupTransaction.java:82)
[yozons-esignforms-20.5.25.jar:?]
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
[servlet-api.jar:?]
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
[servlet-api.jar:?]
     at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
[catalina.jar:9.0.35]
     at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
[catalina.jar:9.0.35]
     at
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
[tomcat-websocket.jar:9.0.35]
     at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
[catalina.jar:9.0.35]
     at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
[catalina.jar:9.0.35]
     at
org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:109)
[catalina.jar:9.0.35]
     at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
[catalina.jar:9.0.35]
     at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
[catalina.jar:9.0.35]
     at
org.apache.catalina.filters.HttpHeaderSecurityFilter.doFilter(HttpHeaderSecurityFilter.java:126)
[catalina.jar:9.0.35]
     at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
[catalina.jar:9.0.35]
     at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
[catalina.jar:9.0.35]
     at
com.esignforms.yozons.filter.AddSecurityHeaderFilter.doFilter(AddSecurityHeaderFilter.java:64)
[yozons-esignforms-20.5.25.jar:?]
     at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
[catalina.jar:9.0.35]
     at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
[catalina.jar:9.0.35]
     at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
[catalina.jar:9.0.35]
     at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
[catalina.jar:9.0.35]
     at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:666)
[catalina.jar:9.0.35]
     at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
[catalina.jar:9.0.35]
     at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
[catalina.jar:9.0.35]
     at
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:690)
[catalina.jar:9.0.35]
     at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
[catalina.jar:9.0.35]
     at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
[catalina.jar:9.0.35]
     at
org.apache.coyote.http2.StreamProcessor.service(StreamProcessor.java:380)
[tomcat-coyote.jar:9.0.35]
     at
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
[tomcat-coyote.jar:9.0.35]
     at
org.apache.coyote.http2.StreamProcessor.process(StreamProcessor.java:72)
[tomcat-coyote.jar:9.0.35]
     at
org.apache.coyote.http2.StreamRunnable.run(StreamRunnable.java:35)
[tomcat-coyote.jar:9.0.35]
     at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
[?:?]
     at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
[?:?]
     at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
[tomcat-util.jar:9.0.35]
     at java.lang.Thread.run(Thread.java:832) [?:?]
Caused by:
org.apache.tomcat.util.http.fileupload.impl.IOFileUploadException:
Processing of multipart/form-data request failed. java.io.IOException:
Stream reset
     at
org.apache.tomcat.util.http.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:297)
~[tomcat-coyote.jar:9.0.35]
     at
org.apache.catalina.connector.Request.parseParts(Request.java:2869)
~[catalina.jar:9.0.35]
     ... 38 more
Caused by: org.apache.catalina.connector.ClientAbortException:
java.io.IOException: Stream reset
     at
org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:340)
~[catalina.jar:9.0.35]
     at
org.apache.catalina.connector.InputBuffer.checkByteBufferEof(InputBuffer.java:632)
~[catalina.jar:9.0.35]
     at
org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:362)
~[catalina.jar:9.0.35]
     at
org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:132)
~[catalina.jar:9.0.35]
     at
org.apache.tomcat.util.http.fileupload.MultipartStream$ItemInputStream.makeAvailable(MultipartStream.java:977)
~[tomcat-coyote.jar:9.0.35]
     at
org.apache.tomcat.util.http.fileupload.MultipartStream$ItemInputStream.read(MultipartStream.java:881)
~[tomcat-coyote.jar:9.0.35]
     at java.io.FilterInputStream.read(FilterInputStream.java:132) ~[?:?]
     at
org.apache.tomcat.util.http.fileupload.util.LimitedInputStream.read(LimitedInputStream.java:132)
~[tomcat-coyote.jar:9.0.35]
     at java.io.FilterInputStream.read(FilterInputStream.java:106) ~[?:?]
     at
org.apache.tomcat.util.http.fileupload.util.Streams.copy(Streams.java:98)
~[tomcat-coyote.jar:9.0.35]
     at
org.apache.tomcat.util.http.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:293)
~[tomcat-coyote.jar:9.0.35]
     at
org.apache.catalina.connector.Request.parseParts(Request.java:2869)
~[catalina.jar:9.0.35]
     ... 38 more
Caused by: java.io.IOException: Stream reset
     at
org.apache.coyote.http2.Stream$StreamInputBuffer.doRead(Stream.java:1084)
~[tomcat-coyote.jar:9.0.35]
     at org.apache.coyote.Request.doRead(Request.java:551)
~[tomcat-coyote.jar:9.0.35]
     at
org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:336)
~[catalina.jar:9.0.35]
     at
org.apache.catalina.connector.InputBuffer.checkByteBufferEof(InputBuffer.java:632)
~[catalina.jar:9.0.35]
     at
org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:362)
~[catalina.jar:9.0.35]
     at
org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:132)
~[catalina.jar:9.0.35]
     at
org.apache.tomcat.util.http.fileupload.MultipartStream$ItemInputStream.makeAvailable(MultipartStream.java:977)
~[tomcat-coyote.jar:9.0.35]
     at
org.apache.tomcat.util.http.fileupload.MultipartStream$ItemInputStream.read(MultipartStream.java:881)
~[tomcat-coyote.jar:9.0.35]
     at java.io.FilterInputStream.read(FilterInputStream.java:132) ~[?:?]
     at
org.apache.tomcat.util.http.fileupload.util.LimitedInputStream.read(LimitedInputStream.java:132)
~[tomcat-coyote.jar:9.0.35]
     at java.io.FilterInputStream.read(FilterInputStream.java:106) ~[?:?]
     at
org.apache.tomcat.util.http.fileupload.util.Streams.copy(Streams.java:98)
~[tomcat-coyote.jar:9.0.35]
     at
org.apache.tomcat.util.http.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:293)
~[tomcat-coyote.jar:9.0.35]
     at
org.apache.catalina.connector.Request.parseParts(Request.java:2869)
~[catalina.jar:9.0.35]
     ... 38 more


On 5/29/20 2:14 PM, Yozons on Gmail wrote:

> Does FileUpload support HTTP/2 over HTTPS?  We seem to get exceptions
> and even long waits trying to upload files when enabling HTTP/2.
>
> In Tomcat, we've tried adding <UpgradeProtocol
> className="org.apache.coyote.http2.Http2Protocol" /> to our secure
> Connector, and that seems to work for normal web requests
> (application/x-www-form-urlencoded), but not well for file upload
> requests (multipart/form-data).  We get broken connections and file
> uploads that seem to take much longer when HTTP/2 is enabled.   If we
> remove UpgradeProtocol, then the file uploads seem to work normally
> again.
>
> Thanks in advance for any good insights.
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]