Bug 68720 - Troubleshooting Tomcat: Addressing Compression Issues with Firefox 'NS_ERROR_NET_PARTIAL_TRANSFER' Error
Summary: Troubleshooting Tomcat: Addressing Compression Issues with Firefox 'NS_ERROR_...
Status: NEW
Alias: None
Product: Tomcat Connectors
Classification: Unclassified
Component: Common (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-06 19:11 UTC by rootcause000
Modified: 2024-03-06 19:11 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rootcause000 2024-03-06 19:11:50 UTC
Tomcat version : 9.0.82
Java : Open JDK 1.8.0_362
While loading the webclient UI, the javascript files were uncompressed over response when h2 protocol is in use. In order to resolve the same, configured compression="force" and it's related attributes in the UpgradeProtocol component similar to the Connector component in tomcats server.xml file.

The confiugration is as follows,

<Connector SSLEnabled="true" URIEncoding="UTF-8" compressibleMimeType="text/html,text/xml,text/javascript,application/x-javascript,application/javascript,text/css,image/gif" compression="force" compressionMinSize="1024" connectionTimeout="20000" noCompressionUserAgents="gozilla, traviata" port="8061" protocol="org.apache.coyote.http11.Http11Nio2Protocol" scheme="https" secure="true" relaxedQueryChars="[]" address="0.0.0.0">
    <UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" compression="force" compressionMinSize="1024" noCompressionUserAgents="gozilla, traviata" compressibleMimeType="text/html,text/xml,text/javascript,application/x-javascript,application/javascript,text/css,image/gif"/>  
    <SSLHostConfig ciphers="${server.https.ciphers}" protocols="${jdk.tls.server.protocols}" honorCipherOrder="true">
        <Certificate certificateKeystoreFile="${javax.net.ssl.keyStore}" certificateKeystorePassword="${javax.net.ssl.keyStorePassword}"/>  
    </SSLHostConfig>
</Connector>

OS : Windows 11
Firefox version : 123.0.1
Chrome version : 121.0.6167.185
Edge version : 122.0.2365.66

While testing the compression behavior with multiple browsers, faced "NS_ERROR_NET_PARTIAL_TRANSFER" error from firefox for few .js, .svg and .ttf files which resulted in broken UI. The following error trace found in catalina logs at the same time.

[00:02:02:822]|[03-07-2024]|[org.apache.coyote.http2.Http2UpgradeHandler]|[INFO]|[338]: Connection [91], Stream [29] Closed due to error
 Note: further occurrences of HTTP/2 stream errors will be logged at DEBUG level.| 
org.apache.coyote.http2.StreamException: Connection [91], Stream [29], State [CLOSED_RST_RX], Frame type [RST]
    at org.apache.coyote.http2.StreamStateMachine.checkFrameType(StreamStateMachine.java:127)
    at org.apache.coyote.http2.AbstractNonZeroStream.checkState(AbstractNonZeroStream.java:50)
    at org.apache.coyote.http2.Http2UpgradeHandler.reset(Http2UpgradeHandler.java:1711)
    at org.apache.coyote.http2.Http2AsyncUpgradeHandler.reset(Http2AsyncUpgradeHandler.java:43)
Upon refresh, the UI loaded properly in firefox browser. This is not faced everytime when loading the UI, but intermittently. The same is working fine in Chrome and Edge browsers.

Is there anything to be handled in configuration level to resolve this error?