AW: AW: Many IllegalStateException when using http2 protocol

2022-03-30 Thread Thomas Hoffmann (Speed4Trade GmbH)


> -Ursprüngliche Nachricht-
> Von: Mark Thomas 
> Gesendet: Mittwoch, 30. März 2022 10:43
> An: users@tomcat.apache.org
> Betreff: Re: AW: Many IllegalStateException when using http2 protocol
> 
> On 27/03/2022 19:43, Thomas Hoffmann (Speed4Trade GmbH) wrote:
> 
> 
> 
> > Hello Konstantin and Mark,
> >
> > I could further track down the issue.
> > The stracktrace is not written any more to the log with Tomcat 9.0.18 but
> the client problem still persist.
> > I am also able to reproduce the problem with few tries now.
> >
> > Partly received web pages on client side occur in the following situation:
> > - Connector-Compression is "on" or "force"
> > - Browser is using http2 protocol
> > - Happens since upgrade from Tomcat 9.0.56 to 10.0.16 (didn’t occur
> > with Tomcat 9)
> > - Occurs in Firefox when opening a link by clicking the middle mouse
> > button
> 
> I have tried, and failed, to recreate this.
> 
> > Setting the loglevel to FINE I got the following stacks:
> > https://store1.gofile.io/download/3bc103b0-ecc5-42ac-bedb-
> da53bcdbb6f0/http2.log.txt  (quite long, so I uploaded it to a separate site).
> 
> That file is no longer available. I did look at it a few days ago and all I 
> saw was
> the client resetting multiple streams. It looked like the browser was
> cancelling the request.
> 
> > Is there any helpful information contained?
> > Anything else I can do to help investigating the issue?
> 
> Ideally, we need to be able to repeat this. That means we need the steps to
> recreate the issue from a clean install of the latest version of one of the
> currently supported Tomcat branches.
> 
> The simpler the test, the better. Ideally a single request to one of the web
> applications included in a default Tomcat install. If that isn't possible - 
> then
> the simplest possible web application and the simplest set of requests that
> trigger it.
> 
> Mark
> 

Hello Mark,

thank for your taking a look at the log!
It might be hard to create a simple page which shows the error because it might 
depend on the streams
which are opened in parallel by HTTP2 but I will try.
I will record a wireshark protocol which might show which side is closing the 
TCP connection 
and which parameters are transferred.

As it only happens with compression, maybe some content-length or similar data 
is calculated in the wrong way.

I will upload the old log and the wireshark protocol to a longer lasting 
provider and try to create a simple app.

Thanks!
Thomas


Re: AW: Many IllegalStateException when using http2 protocol

2022-03-30 Thread Mark Thomas

On 27/03/2022 19:43, Thomas Hoffmann (Speed4Trade GmbH) wrote:




Hello Konstantin and Mark,

I could further track down the issue.
The stracktrace is not written any more to the log with Tomcat 9.0.18 but the 
client problem still persist.
I am also able to reproduce the problem with few tries now.

Partly received web pages on client side occur in the following situation:
- Connector-Compression is "on" or "force"
- Browser is using http2 protocol
- Happens since upgrade from Tomcat 9.0.56 to 10.0.16 (didn’t occur with Tomcat 
9)
- Occurs in Firefox when opening a link by clicking the middle mouse button


I have tried, and failed, to recreate this.


Setting the loglevel to FINE I got the following stacks:
https://store1.gofile.io/download/3bc103b0-ecc5-42ac-bedb-da53bcdbb6f0/http2.log.txt
  (quite long, so I uploaded it to a separate site).


That file is no longer available. I did look at it a few days ago and 
all I saw was the client resetting multiple streams. It looked like the 
browser was cancelling the request.



Is there any helpful information contained?
Anything else I can do to help investigating the issue?


Ideally, we need to be able to repeat this. That means we need the steps 
to recreate the issue from a clean install of the latest version of one 
of the currently supported Tomcat branches.


The simpler the test, the better. Ideally a single request to one of the 
web applications included in a default Tomcat install. If that isn't 
possible - then the simplest possible web application and the simplest 
set of requests that trigger it.


Mark

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



AW: Many IllegalStateException when using http2 protocol

2022-03-27 Thread Thomas Hoffmann (Speed4Trade GmbH)
> > > > > > Hello,
> > > > > >
> > > > > > Since upgrading from Tomcat 9.0.56 to Tomcat 10.0.16, the
> > > > > > localhost-logfile
> > > > > is filling up with stacks of the form:
> > > > > >
> > > > > > 07-Mar-2022 07:24:01.780 SCHWERWIEGEND
> > > > > > [https-openssl-nio-443-exec-
> > > > > 21] org.apache.catalina.core.ApplicationDispatcher.invoke
> > > > > Servlet.service() for servlet [jsp] threw exception
> > > > > > java.lang.IllegalStateException: Connection [66],
> > > > > > Stream [113], Unable
> > > > > to write to stream once it has been closed
> > > > > > at
> > > > >
> > >
> >
> org.apache.coyote.http2.Stream$StreamOutputBuffer.doWrite(Stream.java:
> > > > > 843)
> > > > > > at
> > > > > org.apache.coyote.http11.filters.GzipOutputFilter$FakeOutputStre
> > > > > am
> > > > > .w
> > > > > rite(
> > > > > GzipOutputFilter.java:159)
> > > > > > at
> > > > >
> > >
> >
> java.base/java.util.zip.DeflaterOutputStream.deflate(DeflaterOutputStream.
> > > > > java:252)
> > > > > > at
> > > > > java.base/java.util.zip.DeflaterOutputStream.write(DeflaterOutpu
> > > > > tS
> > > > > tr
> > > > > eam.ja
> > > > > va:210)
> > > > > > at
> > > > > java.base/java.util.zip.GZIPOutputStream.write(GZIPOutputStream.
> > > > > ja
> > > > > va
> > > > > :148
> > > > > )
> > > > > > at
> > > > >
> > >
> >
> org.apache.coyote.http11.filters.GzipOutputFilter.doWrite(GzipOutputFilter.
> > > > > java:69)
> > > > > > at
> > > > >
> > >
> org.apache.coyote.http2.Http2OutputBuffer.doWrite(Http2OutputBuffer.
> > > > > jav
> > > > > a:59)
> > > > > > at
> org.apache.coyote.Response.doWrite(Response.java:625)
> > > > > > at
> > > > > org.apache.catalina.connector.OutputBuffer.realWriteBytes(Output
> > > > > Bu
> > > > > ff
> > > > > er.ja
> > > > > va:340)
> > > > > > at
> > > > > org.apache.catalina.connector.OutputBuffer.flushByteBuffer(Outpu
> > > > > tB
> > > > > uf
> > > > > fer.j
> > > > > ava:783)
> > > > > > at
> > > > > org.apache.catalina.connector.OutputBuffer.realWriteChars(Output
> > > > > Bu
> > > > > ff
> > > > > er.ja
> > > > > va:453)
> > > > > > at
> > > > > org.apache.catalina.connector.OutputBuffer.flushCharBuffer(Outpu
> > > > > tB
> > > > > uf
> > > > > fer.j
> > > > > ava:788)
> > > > > > at
> > > > >
> > org.apache.catalina.connector.OutputBuffer.append(OutputBuffer.java:
> > > > > 727)
> > > > > > at
> > > > > org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.ja
> > > > > va
> > > > > :5
> > > > > 05)
> > > > > > at
> > > > > org.apache.catalina.connector.CoyoteWriter.write(CoyoteWriter.ja
> > > > > va
> > > > > :1
> > > > > 48)
> > > > > > at
> > > > >
> > >
> >
> org.apache.catalina.filters.ExpiresFilter$XPrintWriter.write(ExpiresFilter.java:
> > > > > 850)
> > > > > > at
> > > > > org.apache.jasper.runtime.JspWriterImpl.write(JspWriterImpl.java
> > > > > :2
> > > > > 75
> > > > > )
> > > > > > at 
> > > > > > java.base/java.io.PrintWriter.write(PrintWriter.java:506)
> > > > > > at
> > > > > org.apache.jasper.runtime.JspWriterImpl.write(JspWriterImpl.java
> > > > > :2
> > > > > 75
> > > > > )
> > > > > > at 
> > > > > > java.base/java.io.PrintWriter.write(PrintWriter.java:506)
> > > > > > at
> > > > > org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.
> > > > > ja
> > > > > va:112
> > > > > )
> > > > > > at
> > > > > org.apache.jasper.runtime.JspWriterImpl.flush(JspWriterImpl.java
> > > > > :1
> > > > > 60
> > > > > )
> > > > > > at
> > > > > org.apache.jsp.WEB_002dINF.jsp.businessrelations.ticket_005frela
> > > > > ti
> > > > > on
> > > > > s_inc_
> > > > > jsp._jspService(ticket_005frelations_inc_jsp.java:702)
> > > > > > ...
> > > > > >
> > > > > > The jsp-file varies between the stacktraces, so it is not
> > > > > > related to a certain
> > > > > jsp-File.
> > > > > > The stream.java looks like (which didn’t change from Tomcat 9 to
> 10):
> > > > > > @Override
> > > > > > public final synchronized int doWrite(ByteBuffer
> > > > > > chunk) throws
> > > > > IOException {
> > > > > > if (closed) {
> > > > > > throw new IllegalStateException(
> > > > > > sm.getString("stream.closed",
> > > > > > getConnectionId(), getIdAsString()));
> > > > >
> > > > > I wonder why it throws an ISE here, instead of a proper
> > > > > IOException as declared by this method.
> > > > > (It looks like a bug, but I have not investigated the history of
> > > > > this code yet.)
> > > > >
> > > > > There is nothing suspicious in the stacktrace. An unusual bit of
> > > > > configuration here is having enabled a GzipOutputFilter.
> > > > >
> > > > 

AW: Many IllegalStateException when using http2 protocol

2022-03-16 Thread Thomas Hoffmann (Speed4Trade GmbH)


> -Ursprüngliche Nachricht-
> Von: Thomas Hoffmann (Speed4Trade GmbH)
> 
> Gesendet: Donnerstag, 10. März 2022 21:22
> An: Tomcat Users List 
> Betreff: AW: Many IllegalStateException when using http2 protocol
> 
> 
> 
> > -Ursprüngliche Nachricht-
> > Von: Konstantin Kolinko 
> > Gesendet: Donnerstag, 10. März 2022 16:31
> > An: Tomcat Users List 
> > Betreff: Re: Many IllegalStateException when using http2 protocol
> >
> > чт, 10 мар. 2022 г. в 18:16, Thomas Hoffmann (Speed4Trade GmbH)
> > :
> > >
> > > > -Ursprüngliche Nachricht-
> > > > Von: Konstantin Kolinko 
> > > > Gesendet: Mittwoch, 9. März 2022 00:52
> > > > An: Tomcat Users List 
> > > > Betreff: Re: Many IllegalStateException when using http2 protocol
> > > >
> > > > пн, 7 мар. 2022 г. в 16:26, Thomas Hoffmann (Speed4Trade GmbH)
> > > > :
> > > > >
> > > > > Hello,
> > > > >
> > > > > Since upgrading from Tomcat 9.0.56 to Tomcat 10.0.16, the
> > > > > localhost-logfile
> > > > is filling up with stacks of the form:
> > > > >
> > > > > 07-Mar-2022 07:24:01.780 SCHWERWIEGEND
> > > > > [https-openssl-nio-443-exec-
> > > > 21] org.apache.catalina.core.ApplicationDispatcher.invoke
> > > > Servlet.service() for servlet [jsp] threw exception
> > > > > java.lang.IllegalStateException: Connection [66], Stream
> > > > > [113], Unable
> > > > to write to stream once it has been closed
> > > > > at
> > > >
> >
> org.apache.coyote.http2.Stream$StreamOutputBuffer.doWrite(Stream.java:
> > > > 843)
> > > > > at
> > > > org.apache.coyote.http11.filters.GzipOutputFilter$FakeOutputStream
> > > > .w
> > > > rite(
> > > > GzipOutputFilter.java:159)
> > > > > at
> > > >
> >
> java.base/java.util.zip.DeflaterOutputStream.deflate(DeflaterOutputStream.
> > > > java:252)
> > > > > at
> > > > java.base/java.util.zip.DeflaterOutputStream.write(DeflaterOutputS
> > > > tr
> > > > eam.ja
> > > > va:210)
> > > > > at
> > > > java.base/java.util.zip.GZIPOutputStream.write(GZIPOutputStream.ja
> > > > va
> > > > :148
> > > > )
> > > > > at
> > > >
> >
> org.apache.coyote.http11.filters.GzipOutputFilter.doWrite(GzipOutputFilter.
> > > > java:69)
> > > > > at
> > > >
> > org.apache.coyote.http2.Http2OutputBuffer.doWrite(Http2OutputBuffer.
> > > > jav
> > > > a:59)
> > > > > at 
> > > > > org.apache.coyote.Response.doWrite(Response.java:625)
> > > > > at
> > > > org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBu
> > > > ff
> > > > er.ja
> > > > va:340)
> > > > > at
> > > > org.apache.catalina.connector.OutputBuffer.flushByteBuffer(OutputB
> > > > uf
> > > > fer.j
> > > > ava:783)
> > > > > at
> > > > org.apache.catalina.connector.OutputBuffer.realWriteChars(OutputBu
> > > > ff
> > > > er.ja
> > > > va:453)
> > > > > at
> > > > org.apache.catalina.connector.OutputBuffer.flushCharBuffer(OutputB
> > > > uf
> > > > fer.j
> > > > ava:788)
> > > > > at
> > > >
> org.apache.catalina.connector.OutputBuffer.append(OutputBuffer.java:
> > > > 727)
> > > > > at
> > > > org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java
> > > > :5
> > > > 05)
> > > > > at
> > > > org.apache.catalina.connector.CoyoteWriter.write(CoyoteWriter.java
> > > > :1
> > > > 48)
> > > > > at
> > > >
> >
> org.apache.catalina.filters.ExpiresFilter$XPrintWriter.write(ExpiresFilter.java:
> > > > 850)
> > > > > at
> > > > org.apache.jasper.runtime.JspWriterImpl.write(JspWriterImpl.java:2
> > > > 75
> > > > )
> 

AW: Many IllegalStateException when using http2 protocol

2022-03-10 Thread Thomas Hoffmann (Speed4Trade GmbH)


> -Ursprüngliche Nachricht-
> Von: Konstantin Kolinko 
> Gesendet: Donnerstag, 10. März 2022 16:31
> An: Tomcat Users List 
> Betreff: Re: Many IllegalStateException when using http2 protocol
> 
> чт, 10 мар. 2022 г. в 18:16, Thomas Hoffmann (Speed4Trade GmbH)
> :
> >
> > > -Ursprüngliche Nachricht-
> > > Von: Konstantin Kolinko 
> > > Gesendet: Mittwoch, 9. März 2022 00:52
> > > An: Tomcat Users List 
> > > Betreff: Re: Many IllegalStateException when using http2 protocol
> > >
> > > пн, 7 мар. 2022 г. в 16:26, Thomas Hoffmann (Speed4Trade GmbH)
> > > :
> > > >
> > > > Hello,
> > > >
> > > > Since upgrading from Tomcat 9.0.56 to Tomcat 10.0.16, the
> > > > localhost-logfile
> > > is filling up with stacks of the form:
> > > >
> > > > 07-Mar-2022 07:24:01.780 SCHWERWIEGEND
> > > > [https-openssl-nio-443-exec-
> > > 21] org.apache.catalina.core.ApplicationDispatcher.invoke
> > > Servlet.service() for servlet [jsp] threw exception
> > > > java.lang.IllegalStateException: Connection [66], Stream
> > > > [113], Unable
> > > to write to stream once it has been closed
> > > > at
> > >
> org.apache.coyote.http2.Stream$StreamOutputBuffer.doWrite(Stream.java:
> > > 843)
> > > > at
> > > org.apache.coyote.http11.filters.GzipOutputFilter$FakeOutputStream.w
> > > rite(
> > > GzipOutputFilter.java:159)
> > > > at
> > >
> java.base/java.util.zip.DeflaterOutputStream.deflate(DeflaterOutputStream.
> > > java:252)
> > > > at
> > > java.base/java.util.zip.DeflaterOutputStream.write(DeflaterOutputStr
> > > eam.ja
> > > va:210)
> > > > at
> > > java.base/java.util.zip.GZIPOutputStream.write(GZIPOutputStream.java
> > > :148
> > > )
> > > > at
> > >
> org.apache.coyote.http11.filters.GzipOutputFilter.doWrite(GzipOutputFilter.
> > > java:69)
> > > > at
> > >
> org.apache.coyote.http2.Http2OutputBuffer.doWrite(Http2OutputBuffer.
> > > jav
> > > a:59)
> > > > at org.apache.coyote.Response.doWrite(Response.java:625)
> > > > at
> > > org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuff
> > > er.ja
> > > va:340)
> > > > at
> > > org.apache.catalina.connector.OutputBuffer.flushByteBuffer(OutputBuf
> > > fer.j
> > > ava:783)
> > > > at
> > > org.apache.catalina.connector.OutputBuffer.realWriteChars(OutputBuff
> > > er.ja
> > > va:453)
> > > > at
> > > org.apache.catalina.connector.OutputBuffer.flushCharBuffer(OutputBuf
> > > fer.j
> > > ava:788)
> > > > at
> > > org.apache.catalina.connector.OutputBuffer.append(OutputBuffer.java:
> > > 727)
> > > > at
> > > org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:5
> > > 05)
> > > > at
> > > org.apache.catalina.connector.CoyoteWriter.write(CoyoteWriter.java:1
> > > 48)
> > > > at
> > >
> org.apache.catalina.filters.ExpiresFilter$XPrintWriter.write(ExpiresFilter.java:
> > > 850)
> > > > at
> > > org.apache.jasper.runtime.JspWriterImpl.write(JspWriterImpl.java:275
> > > )
> > > > at 
> > > > java.base/java.io.PrintWriter.write(PrintWriter.java:506)
> > > > at
> > > org.apache.jasper.runtime.JspWriterImpl.write(JspWriterImpl.java:275
> > > )
> > > > at 
> > > > java.base/java.io.PrintWriter.write(PrintWriter.java:506)
> > > > at
> > > org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.ja
> > > va:112
> > > )
> > > > at
> > > org.apache.jasper.runtime.JspWriterImpl.flush(JspWriterImpl.java:160
> > > )
> > > > at
> > > org.apache.jsp.WEB_002dINF.jsp.businessrelations.ticket_005frelation
> > > s_inc_
> > > jsp._jspService(ticket_005frelations_inc_jsp.java:702)
> > > > ...
> > > >
> > > > The jsp-file varies between the stacktraces, so it is not related
> > > > to a certain
> > > jsp-File.
> > > > The stream.java looks like (which didn’t change from Tomcat 9 to 10):
> > > > @Override
> > > > public final synchronized int doWrite(ByteBuffer chunk)
> > > > throws
> > > IOException {
> > > > if (closed) {
> > > > throw new IllegalStateException(
> > > > sm.getString("stream.closed",
> > > > getConnectionId(), getIdAsString()));
> > >
> > > I wonder why it throws an ISE here, instead of a proper IOException
> > > as declared by this method.
> > > (It looks like a bug, but I have not investigated the history of
> > > this code yet.)
> > >
> > > There is nothing suspicious in the stacktrace. An unusual bit of
> > > configuration here is having enabled a GzipOutputFilter.
> > >
> > > Best regards,
> > > Konstantin Kolinko
> >
> > Good observation about the GZip-Filter!
> > We are using compression="force" in our connector.
> > I modified some http2 settings (raised some limits) and set
> 

AW: Many IllegalStateException when using http2 protocol

2022-03-10 Thread Thomas Hoffmann (Speed4Trade GmbH)
> -Ursprüngliche Nachricht-
> Von: Konstantin Kolinko 
> Gesendet: Mittwoch, 9. März 2022 00:52
> An: Tomcat Users List 
> Betreff: Re: Many IllegalStateException when using http2 protocol
> 
> пн, 7 мар. 2022 г. в 16:26, Thomas Hoffmann (Speed4Trade GmbH)
> :
> >
> > Hello,
> >
> > Since upgrading from Tomcat 9.0.56 to Tomcat 10.0.16, the localhost-logfile
> is filling up with stacks of the form:
> >
> > 07-Mar-2022 07:24:01.780 SCHWERWIEGEND [https-openssl-nio-443-exec-
> 21] org.apache.catalina.core.ApplicationDispatcher.invoke Servlet.service()
> for servlet [jsp] threw exception
> > java.lang.IllegalStateException: Connection [66], Stream [113], 
> > Unable
> to write to stream once it has been closed
> > at
> org.apache.coyote.http2.Stream$StreamOutputBuffer.doWrite(Stream.java:
> 843)
> > at
> org.apache.coyote.http11.filters.GzipOutputFilter$FakeOutputStream.write(
> GzipOutputFilter.java:159)
> > at
> java.base/java.util.zip.DeflaterOutputStream.deflate(DeflaterOutputStream.
> java:252)
> > at
> java.base/java.util.zip.DeflaterOutputStream.write(DeflaterOutputStream.ja
> va:210)
> > at
> java.base/java.util.zip.GZIPOutputStream.write(GZIPOutputStream.java:148
> )
> > at
> org.apache.coyote.http11.filters.GzipOutputFilter.doWrite(GzipOutputFilter.
> java:69)
> > at
> org.apache.coyote.http2.Http2OutputBuffer.doWrite(Http2OutputBuffer.jav
> a:59)
> > at org.apache.coyote.Response.doWrite(Response.java:625)
> > at
> org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.ja
> va:340)
> > at
> org.apache.catalina.connector.OutputBuffer.flushByteBuffer(OutputBuffer.j
> ava:783)
> > at
> org.apache.catalina.connector.OutputBuffer.realWriteChars(OutputBuffer.ja
> va:453)
> > at
> org.apache.catalina.connector.OutputBuffer.flushCharBuffer(OutputBuffer.j
> ava:788)
> > at
> org.apache.catalina.connector.OutputBuffer.append(OutputBuffer.java:727)
> > at
> org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:505)
> > at
> org.apache.catalina.connector.CoyoteWriter.write(CoyoteWriter.java:148)
> > at
> org.apache.catalina.filters.ExpiresFilter$XPrintWriter.write(ExpiresFilter.java:
> 850)
> > at
> org.apache.jasper.runtime.JspWriterImpl.write(JspWriterImpl.java:275)
> > at java.base/java.io.PrintWriter.write(PrintWriter.java:506)
> > at
> org.apache.jasper.runtime.JspWriterImpl.write(JspWriterImpl.java:275)
> > at java.base/java.io.PrintWriter.write(PrintWriter.java:506)
> > at
> org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:112
> )
> > at
> org.apache.jasper.runtime.JspWriterImpl.flush(JspWriterImpl.java:160)
> > at
> org.apache.jsp.WEB_002dINF.jsp.businessrelations.ticket_005frelations_inc_
> jsp._jspService(ticket_005frelations_inc_jsp.java:702)
> > ...
> >
> > The jsp-file varies between the stacktraces, so it is not related to a 
> > certain
> jsp-File.
> > The stream.java looks like (which didn’t change from Tomcat 9 to 10):
> > @Override
> > public final synchronized int doWrite(ByteBuffer chunk) throws
> IOException {
> > if (closed) {
> > throw new IllegalStateException(
> > sm.getString("stream.closed",
> > getConnectionId(), getIdAsString()));
> 
> I wonder why it throws an ISE here, instead of a proper IOException as
> declared by this method.
> (It looks like a bug, but I have not investigated the history of this code 
> yet.)
> 
> There is nothing suspicious in the stacktrace. An unusual bit of configuration
> here is having enabled a GzipOutputFilter.
> 
> Best regards,
> Konstantin Kolinko

Good observation about the GZip-Filter!
We are using compression="force" in our connector.
I modified some http2 settings (raised some limits) and set compression="off" 
... up to now, the error disappeared.
As I modified several settings, I will carefully revert the changes step by 
step to figure out which connector parameter is causing this error.
Maybe the GZip-Filter doesn’t work well with the http2 protocol in tomcat.
I will investigate and post the results.

Thanks!
Thomas

> 
> > }
> >
> > The generated java file from the jsp file only catches IOException:
> > ...
> >   if (!(t instanceof jakarta.servlet.jsp.SkipPageException)){
> > out = _jspx_out;
> > if (out != null && out.getBufferSize() != 0)
> >   try {
> > if (response.isCommitted()) {
> >   out.flush();
> > } else {
> >   out.clearBuffer();
> > }
> >   } catch (java.io.IOException e) {}
> > if (_jspx_page_context 

AW: AW: Many IllegalStateException when using http2 protocol

2022-03-08 Thread Thomas Hoffmann (Speed4Trade GmbH)


> -Ursprüngliche Nachricht-
> Von: Mark Thomas 
> Gesendet: Dienstag, 8. März 2022 11:52
> An: users@tomcat.apache.org
> Betreff: Re: AW: Many IllegalStateException when using http2 protocol
> 
> On 08/03/2022 10:05, Thomas Hoffmann (Speed4Trade GmbH) wrote:
> > Hello,
> >
> > today I got feedback from users, that pages are sometimes not shown.
> > After pressing F5 the website shows up again.
> > So this error also has effects on client side.
> >
> > I am not sure if it is related to Tomcat 10 Upgrade. At least I don’t see 
> > that
> error in the Tomcat 9 logfiles.
> > After switching to Tomcat 10, many errors show up each day in the
> localhost-logfile.
> >
> > Did anything change in http2-protocol in Tomcat 10 ?
> > Any ideas how to narrow down the problem?
> 
> Turn on debug logging for HTTP/2. See comments in logging.properties
> 
> Mark
> 

Hello Mark,
the switch generates quite much logging information. I will try to find a 
suitable day to activate the logging on the live system.
I didn’t manage to reproduce the issue on test system.
I will try to hunt down or at least narrow down the problem.
Thanks! Thomas


Re: AW: Many IllegalStateException when using http2 protocol

2022-03-08 Thread Mark Thomas

On 08/03/2022 10:05, Thomas Hoffmann (Speed4Trade GmbH) wrote:

Hello,

today I got feedback from users, that pages are sometimes not shown.
After pressing F5 the website shows up again.
So this error also has effects on client side.

I am not sure if it is related to Tomcat 10 Upgrade. At least I don’t see that 
error in the Tomcat 9 logfiles.
After switching to Tomcat 10, many errors show up each day in the 
localhost-logfile.

Did anything change in http2-protocol in Tomcat 10 ?
Any ideas how to narrow down the problem?


Turn on debug logging for HTTP/2. See comments in logging.properties

Mark

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



AW: Many IllegalStateException when using http2 protocol

2022-03-08 Thread Thomas Hoffmann (Speed4Trade GmbH)
Hello,

today I got feedback from users, that pages are sometimes not shown.
After pressing F5 the website shows up again.
So this error also has effects on client side.

I am not sure if it is related to Tomcat 10 Upgrade. At least I don’t see that 
error in the Tomcat 9 logfiles.
After switching to Tomcat 10, many errors show up each day in the 
localhost-logfile.

Did anything change in http2-protocol in Tomcat 10 ?
Any ideas how to narrow down the problem?

Greetings,
Thomas

-Ursprüngliche Nachricht-
Gesendet: Montag, 7. März 2022 14:26
An: Tomcat Users List 
Betreff: Many IllegalStateException when using http2 protocol

Hello,

Since upgrading from Tomcat 9.0.56 to Tomcat 10.0.16, the localhost-logfile is 
filling up with stacks of the form:

07-Mar-2022 07:24:01.780 SCHWERWIEGEND [https-openssl-nio-443-exec-21] 
org.apache.catalina.core.ApplicationDispatcher.invoke Servlet.service() for 
servlet [jsp] threw exception
java.lang.IllegalStateException: Connection [66], Stream [113], Unable 
to write to stream once it has been closed
at 
org.apache.coyote.http2.Stream$StreamOutputBuffer.doWrite(Stream.java:843)
at 
org.apache.coyote.http11.filters.GzipOutputFilter$FakeOutputStream.write(GzipOutputFilter.java:159)
at 
java.base/java.util.zip.DeflaterOutputStream.deflate(DeflaterOutputStream.java:252)
at 
java.base/java.util.zip.DeflaterOutputStream.write(DeflaterOutputStream.java:210)
at 
java.base/java.util.zip.GZIPOutputStream.write(GZIPOutputStream.java:148)
at 
org.apache.coyote.http11.filters.GzipOutputFilter.doWrite(GzipOutputFilter.java:69)
at 
org.apache.coyote.http2.Http2OutputBuffer.doWrite(Http2OutputBuffer.java:59)
at org.apache.coyote.Response.doWrite(Response.java:625)
at 
org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:340)
at 
org.apache.catalina.connector.OutputBuffer.flushByteBuffer(OutputBuffer.java:783)
at 
org.apache.catalina.connector.OutputBuffer.realWriteChars(OutputBuffer.java:453)
at 
org.apache.catalina.connector.OutputBuffer.flushCharBuffer(OutputBuffer.java:788)
at 
org.apache.catalina.connector.OutputBuffer.append(OutputBuffer.java:727)
at 
org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:505)
at 
org.apache.catalina.connector.CoyoteWriter.write(CoyoteWriter.java:148)
at 
org.apache.catalina.filters.ExpiresFilter$XPrintWriter.write(ExpiresFilter.java:850)
at 
org.apache.jasper.runtime.JspWriterImpl.write(JspWriterImpl.java:275)
at java.base/java.io.PrintWriter.write(PrintWriter.java:506)
at 
org.apache.jasper.runtime.JspWriterImpl.write(JspWriterImpl.java:275)
at java.base/java.io.PrintWriter.write(PrintWriter.java:506)
at 
org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:112)
at 
org.apache.jasper.runtime.JspWriterImpl.flush(JspWriterImpl.java:160)
at 
org.apache.jsp.WEB_002dINF.jsp.businessrelations.ticket_005frelations_inc_jsp._jspService(ticket_005frelations_inc_jsp.java:702)
...

The jsp-file varies between the stacktraces, so it is not related to a certain 
jsp-File.
The stream.java looks like (which didn’t change from Tomcat 9 to 10):
@Override
public final synchronized int doWrite(ByteBuffer chunk) throws 
IOException {
if (closed) {
throw new IllegalStateException(
sm.getString("stream.closed", getConnectionId(), 
getIdAsString()));
}

The generated java file from the jsp file only catches IOException:
...
  if (!(t instanceof jakarta.servlet.jsp.SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
  try {
if (response.isCommitted()) {
  out.flush();
} else {
  out.clearBuffer();
}
  } catch (java.io.IOException e) {}
if (_jspx_page_context != null) 
_jspx_page_context.handlePageException(t);
else throw new ServletException(t);
  }

It seems like the browser is sometimes closing the stream and this causes 
Tomcat to write exceptions in the localhost-logfile.

Is there any way to prevent this?
It is strange, that it didn’t happen with Tomcat 9 or maybe a Firefox-Update is 
causing the issue(?) Access-log shows Firefox 97.

Greetings, Thomas
B�CB��[��X��ܚX�KK[XZ[
�\�\��][��X��ܚX�P�X�]
�\X�K�ܙ�B��܈Y][ۘ[��[X[��K[XZ[
�\�\��Z[�X�]
�\X�K�ܙ�B�

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands,