You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2024/01/24 12:57:16 UTC
[Bug 68533] New: Failed to load resource: net::ERR_HTTP2_PROTOCOL_ERROR
https://bz.apache.org/bugzilla/show_bug.cgi?id=68533
Bug ID: 68533
Summary: Failed to load resource: net::ERR_HTTP2_PROTOCOL_ERROR
Product: Tomcat 9
Version: 9.0.83
Hardware: PC
OS: Linux
Status: NEW
Severity: critical
Priority: P2
Component: Catalina
Assignee: dev@tomcat.apache.org
Reporter: dev.devaskim@gmail.com
Target Milestone: -----
In our application we use Embedded Tomcat v9.0.83 with 2 connectors - ssl and
non-ssl.
After 1 hour of user inactivity with an opened (application) page in a browser
(Chrome and Chromium based), our application redirects a user to a login page.
Starting from this moment some of static resources (css, fonts, js, images)
fails to be downloaded with the browser error- Failed to load resource:
net::ERR_HTTP2_PROTOCOL_ERROR (copied from a Network/Console tabs of DevTools).
Page refreshing doesn't solve the problem - previously failed resources may be
downloaded, but now another ones fail.
Only full cache cleaning in a browser lets downloading all static resources.
Here is the same topic on Stack Overflow, but no connector tuning tips didn't
help us.
https://stackoverflow.com/questions/60049290/closenowexception-this-stream-is-not-writeable
In the attachment you can find Tomcat logs with FINE level for
org.apache.coyote.http2. And here is the exception from Spring:
24.01.2024 08:04:57,117 WARN
org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver
Failure in @ExceptionHandler
com.tibbo.linkserver.plugin.context.web.exception.RestExceptionHandler#handleError(Exception)
- [https-jsse-nio-443-exec-10]
org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver.doResolveHandlerMethodException
(ExceptionHandlerExceptionResolver.java:434)
org.apache.catalina.connector.ClientAbortException:
org.apache.coyote.CloseNowException: Connection [0], Stream [3], This stream is
in state [CLOSED_RST_RX] and is not writable
at
org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:309)
at
org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:271)
at
org.apache.catalina.connector.CoyoteOutputStream.flush(CoyoteOutputStream.java:120)
at
org.springframework.security.web.util.OnCommittedResponseWrapper$SaveContextServletOutputStream.flush(OnCommittedResponseWrapper.java:523)
at java.io.FilterOutputStream.flush(FilterOutputStream.java:140)
at
com.fasterxml.jackson.core.json.UTF8JsonGenerator.flush(UTF8JsonGenerator.java:1200)
at
com.fasterxml.jackson.databind.ObjectWriter.writeValue(ObjectWriter.java:1063)
at
org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.writeInternal(AbstractJackson2HttpMessageConverter.java:456)
at
org.springframework.http.converter.AbstractGenericHttpMessageConverter.write(AbstractGenericHttpMessageConverter.java:104)
at
org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:290)
at
org.springframework.web.servlet.mvc.method.annotation.HttpEntityMethodProcessor.handleReturnValue(HttpEntityMethodProcessor.java:219)
at
org.springframework.web.method.support.HandlerMethodReturnValueHandlerComposite.handleReturnValue(HandlerMethodReturnValueHandlerComposite.java:78)
at
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:135)
at
org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver.doResolveHandlerMethodException(ExceptionHandlerExceptionResolver.java:428)
at
org.springframework.web.servlet.handler.AbstractHandlerMethodExceptionResolver.doResolveException(AbstractHandlerMethodExceptionResolver.java:75)
at
org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver.resolveException(AbstractHandlerExceptionResolver.java:142)
at
org.springframework.web.servlet.handler.HandlerExceptionResolverComposite.resolveException(HandlerExceptionResolverComposite.java:80)
at
org.springframework.web.servlet.DispatcherServlet.processHandlerException(DispatcherServlet.java:1331)
at
org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1142)
at
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1088)
at
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:964)
at
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
at
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:529)
at
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:623)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:209)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
at
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
at
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:337)
at
org.springframework.security.web.access.intercept.AuthorizationFilter.doFilterInternal(AuthorizationFilter.java:73)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346)
at
org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:122)
at
org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:116)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346)
at
org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:126)
at
org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:81)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346)
at
org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:109)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346)
at
org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:149)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346)
at
org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346)
at
org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90)
at
org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346)
at
org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:112)
at
org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:82)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346)
at
org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:55)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346)
at
org.springframework.security.web.session.DisableEncodeUrlFilter.doFilterInternal(DisableEncodeUrlFilter.java:42)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346)
at
org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:221)
at
org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:186)
at
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:354)
at
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:267)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:168)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:481)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:130)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
at
org.apache.coyote.http2.StreamProcessor.service(StreamProcessor.java:432)
at
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
at
org.apache.coyote.http2.StreamProcessor.process(StreamProcessor.java:90)
at org.apache.coyote.http2.StreamRunnable.run(StreamRunnable.java:35)
at
org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
at
org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:750)
Caused by: org.apache.coyote.CloseNowException: Connection [0], Stream [3],
This stream is in state [CLOSED_RST_RX] and is not writable
at org.apache.coyote.http2.Stream.doStreamCancel(Stream.java:293)
at
org.apache.coyote.http2.Http2UpgradeHandler.reserveWindowSize(Http2UpgradeHandler.java:936)
at
org.apache.coyote.http2.Stream$StreamOutputBuffer.flush(Stream.java:1050)
at
org.apache.coyote.http2.Stream$StreamOutputBuffer.flush(Stream.java:994)
at
org.apache.coyote.http2.Stream$StreamOutputBuffer.flush(Stream.java:1121)
at
org.apache.coyote.http11.filters.GzipOutputFilter.flush(GzipOutputFilter.java:105)
at
org.apache.coyote.http2.Http2OutputBuffer.flush(Http2OutputBuffer.java:75)
at
org.apache.coyote.http2.StreamProcessor.flush(StreamProcessor.java:264)
at
org.apache.coyote.AbstractProcessor.action(AbstractProcessor.java:399)
at org.apache.coyote.Response.action(Response.java:207)
at
org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:305)
at
org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:271)
at
org.apache.catalina.connector.CoyoteOutputStream.flush(CoyoteOutputStream.java:120)
at
org.springframework.security.web.util.OnCommittedResponseWrapper$SaveContextServletOutputStream.flush(OnCommittedResponseWrapper.java:523)
at java.io.FilterOutputStream.flush(FilterOutputStream.java:140)
at
com.fasterxml.jackson.core.json.UTF8JsonGenerator.flush(UTF8JsonGenerator.java:1200)
at
com.fasterxml.jackson.databind.ObjectWriter.writeValue(ObjectWriter.java:1063)
at
org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.writeInternal(AbstractJackson2HttpMessageConverter.java:456)
at
org.springframework.http.converter.AbstractGenericHttpMessageConverter.write(AbstractGenericHttpMessageConverter.java:104)
at
org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:290)
at
org.springframework.web.servlet.mvc.method.annotation.HttpEntityMethodProcessor.handleReturnValue(HttpEntityMethodProcessor.java:219)
at
org.springframework.web.method.support.HandlerMethodReturnValueHandlerComposite.handleReturnValue(HandlerMethodReturnValueHandlerComposite.java:78)
at
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:135)
at
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)
at
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808)
at
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1071)
... 65 more
Caused by: org.apache.coyote.http2.StreamException: Connection [0], Stream [3],
This stream is in state [CLOSED_RST_RX] and is not writable
at org.apache.coyote.http2.Stream.doStreamCancel(Stream.java:285)
... 91 more
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 68533] Failed to load resource: net::ERR_HTTP2_PROTOCOL_ERROR
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=68533
Den <de...@gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEEDINFO |NEW
--- Comment #2 from Den <de...@gmail.com> ---
Mark, I attached such logs with FINE level but seems like the file was too big
(1.7MB). So I uploaded the file to my Google Drive. Here is a link
https://drive.google.com/file/d/1p6DtBQY4cslyx6PXU4x6Rc4tlBbLCPpS/view?usp=sharing
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 68533] Failed to load resource: net::ERR_HTTP2_PROTOCOL_ERROR
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=68533
Mark Thomas <ma...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |INVALID
Status|NEW |RESOLVED
--- Comment #3 from Mark Thomas <ma...@apache.org> ---
This is an application bug, not a Tomcat bug.
Reviewing the logs shows the following:
- the problems start in stream 55
- the request is processed correctly
- a 304 response is sent
So far, so good. Note that as per the HTTP specs (see RFC 9110, section 15.4.5)
304 responses cannot contain a response body.
At this point the application attempts to send a response body. That triggers
error handling that results in the closure of the HTTP/2 connection. Arguably,
Tomcat could handle this differently and ignore the attempt to write the body
or throw an IllegalStateException or similar but that is only working around
the application misbehaviour.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 68533] Failed to load resource: net::ERR_HTTP2_PROTOCOL_ERROR
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=68533
Mark Thomas <ma...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |NEEDINFO
--- Comment #1 from Mark Thomas <ma...@apache.org> ---
Given you are reproducing this on connection 0 (the first HTTP/2 request
received) I'm assuming that you can easily reproduce this.
Try enabling debug logging for the org.apache.coyote.http2 package (the setting
for this can just be uncommenting in $CATALINA_BASE/conf/logging.properties),
recreating the issue and then attaching the logs. There will probably be a fair
amount of logs so try and keep the traffic to the minimum required to trigger
the issue. That should give us a clearer picture of what is happening.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org