You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Thomas Hoffmann (Speed4Trade GmbH)" <Th...@speed4trade.com.INVALID> on 2022/03/23 14:13:01 UTC
Unknown http2 settings is logged with wrong settings key
Hello,
I got some warnings logged from http2 protocol and the logged values seem to be wrong.
If an unknown http2 settings is received, it logs the key and the value to the logfile:
/org/apache/coyote/http2/ConnectionSettingsBase.java, line 90:
case UNKNOWN:
// Unrecognised. Ignore it.
log.warn(sm.getString("connectionSettings.unknown",
connectionId, setting, Long.toString(value)));
return;
The value of the settings-variable was unfortunately converted before to Integer.MAX_VALUE within the settings.java
enum Setting {
HEADER_TABLE_SIZE(1),
ENABLE_PUSH(2),
MAX_CONCURRENT_STREAMS(3),
INITIAL_WINDOW_SIZE(4),
MAX_FRAME_SIZE(5),
MAX_HEADER_LIST_SIZE(6),
UNKNOWN(Integer.MAX_VALUE);
Thus, the logfile doesn’t contain the received, unknown settings-key but MAX_VALUE instead.
Is it possible to log the real settings key, which was received by the server?
Maybe the logging can be moved to the Setting.java instead or the real key value would have to be transferred to the function which logs(?)
Greetings, Thomas
Re: Unknown http2 settings is logged with wrong settings key
Posted by Rémy Maucherat <re...@apache.org>.
On Wed, Mar 23, 2022 at 8:28 PM Thomas Hoffmann (Speed4Trade GmbH)
<Th...@speed4trade.com.invalid> wrote:
>
>
>
> > -----Ursprüngliche Nachricht-----
> > Von: Christopher Schultz <ch...@christopherschultz.net>
> > Gesendet: Mittwoch, 23. März 2022 16:56
> > An: users@tomcat.apache.org
> > Betreff: Re: Unknown http2 settings is logged with wrong settings key
> >
> > Thomas,
> >
> > On 3/23/22 10:13, Thomas Hoffmann (Speed4Trade GmbH) wrote:
> > > Hello,
> > >
> > > I got some warnings logged from http2 protocol and the logged values
> > seem to be wrong.
> > > If an unknown http2 settings is received, it logs the key and the value to
> > the logfile:
> > >
> > > /org/apache/coyote/http2/ConnectionSettingsBase.java, line 90:
> > >
> > > case UNKNOWN:
> > > // Unrecognised. Ignore it.
> > > log.warn(sm.getString("connectionSettings.unknown",
> > > connectionId, setting, Long.toString(value)));
> > > return;
> > >
> > > The value of the settings-variable was unfortunately converted before
> > > to Integer.MAX_VALUE within the settings.java
> > >
> > > enum Setting {
> > > HEADER_TABLE_SIZE(1),
> > > ENABLE_PUSH(2),
> > > MAX_CONCURRENT_STREAMS(3),
> > > INITIAL_WINDOW_SIZE(4),
> > > MAX_FRAME_SIZE(5),
> > > MAX_HEADER_LIST_SIZE(6),
> > > UNKNOWN(Integer.MAX_VALUE);
> > >
> > > Thus, the logfile doesn’t contain the received, unknown settings-key but
> > MAX_VALUE instead.
> > >
> > > Is it possible to log the real settings key, which was received by the server?
> > > Maybe the logging can be moved to the Setting.java instead or the real
> > > key value would have to be transferred to the function which logs(?)
> >
> > I think the existing log can probably just be fixed, no? Want to take a stab at
> > writing a PR for this?
> >
> > -chris
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
>
> Hello Chris,
>
> I forked tomcat and commited/pushed a change.
> Somehow I got lost with the pull request. I haven’t created one yet because I committed one file which shouldn’t be contained in the commit.
> But somehow the commit was already authored (?)
> Not sure if I messed up something up to now.
>
> Can I create a pull request even if one file (gitignore) was accidentally contained in the commit?
> How can my push already be authored before any pull request?
> https://github.com/HoffmannTom/tomcat/commit/6da6f9444192a1ca1d8d0eda1c6694b7c12451ef
>
> Could you help me out how to continue?
> If my change is a mess, then you can tell me and I skip the pull request.
I had a look a little bit earlier and I also thought this was the way
to improve that logging.
Rémy
> Thanks! Thomas
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Unknown http2 settings is logged with wrong settings key
Posted by Rémy Maucherat <re...@apache.org>.
On Wed, Mar 23, 2022 at 8:28 PM Thomas Hoffmann (Speed4Trade GmbH)
<Th...@speed4trade.com.invalid> wrote:
>
>
>
> > -----Ursprüngliche Nachricht-----
> > Von: Christopher Schultz <ch...@christopherschultz.net>
> > Gesendet: Mittwoch, 23. März 2022 16:56
> > An: users@tomcat.apache.org
> > Betreff: Re: Unknown http2 settings is logged with wrong settings key
> >
> > Thomas,
> >
> > On 3/23/22 10:13, Thomas Hoffmann (Speed4Trade GmbH) wrote:
> > > Hello,
> > >
> > > I got some warnings logged from http2 protocol and the logged values
> > seem to be wrong.
> > > If an unknown http2 settings is received, it logs the key and the value to
> > the logfile:
> > >
> > > /org/apache/coyote/http2/ConnectionSettingsBase.java, line 90:
> > >
> > > case UNKNOWN:
> > > // Unrecognised. Ignore it.
> > > log.warn(sm.getString("connectionSettings.unknown",
> > > connectionId, setting, Long.toString(value)));
> > > return;
> > >
> > > The value of the settings-variable was unfortunately converted before
> > > to Integer.MAX_VALUE within the settings.java
> > >
> > > enum Setting {
> > > HEADER_TABLE_SIZE(1),
> > > ENABLE_PUSH(2),
> > > MAX_CONCURRENT_STREAMS(3),
> > > INITIAL_WINDOW_SIZE(4),
> > > MAX_FRAME_SIZE(5),
> > > MAX_HEADER_LIST_SIZE(6),
> > > UNKNOWN(Integer.MAX_VALUE);
> > >
> > > Thus, the logfile doesn’t contain the received, unknown settings-key but
> > MAX_VALUE instead.
> > >
> > > Is it possible to log the real settings key, which was received by the server?
> > > Maybe the logging can be moved to the Setting.java instead or the real
> > > key value would have to be transferred to the function which logs(?)
> >
> > I think the existing log can probably just be fixed, no? Want to take a stab at
> > writing a PR for this?
> >
> > -chris
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
>
> Hello Chris,
>
> I forked tomcat and commited/pushed a change.
> Somehow I got lost with the pull request. I haven’t created one yet because I committed one file which shouldn’t be contained in the commit.
> But somehow the commit was already authored (?)
> Not sure if I messed up something up to now.
>
> Can I create a pull request even if one file (gitignore) was accidentally contained in the commit?
> How can my push already be authored before any pull request?
> https://github.com/HoffmannTom/tomcat/commit/6da6f9444192a1ca1d8d0eda1c6694b7c12451ef
In your patch, you are still logging Setting.UNKNOWN:
Setting key = Setting.valueOf(id);
if (log.isDebugEnabled() && key == Setting.UNKNOWN) {
log.warn(sm.getString("connectionSettings.unknown",
connectionId, key, Long.toString(value)));
}
Instead, you should be logging the original id:
log.warn(sm.getString("connectionSettings.unknown",
connectionId, Integer.toString(id),
Long.toString(value)));
Rémy
> Could you help me out how to continue?
> If my change is a mess, then you can tell me and I skip the pull request.
>
> Thanks! Thomas
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
AW: Unknown http2 settings is logged with wrong settings key
Posted by "Thomas Hoffmann (Speed4Trade GmbH)" <Th...@speed4trade.com.INVALID>.
> -----Ursprüngliche Nachricht-----
> Von: Christopher Schultz <ch...@christopherschultz.net>
> Gesendet: Mittwoch, 23. März 2022 16:56
> An: users@tomcat.apache.org
> Betreff: Re: Unknown http2 settings is logged with wrong settings key
>
> Thomas,
>
> On 3/23/22 10:13, Thomas Hoffmann (Speed4Trade GmbH) wrote:
> > Hello,
> >
> > I got some warnings logged from http2 protocol and the logged values
> seem to be wrong.
> > If an unknown http2 settings is received, it logs the key and the value to
> the logfile:
> >
> > /org/apache/coyote/http2/ConnectionSettingsBase.java, line 90:
> >
> > case UNKNOWN:
> > // Unrecognised. Ignore it.
> > log.warn(sm.getString("connectionSettings.unknown",
> > connectionId, setting, Long.toString(value)));
> > return;
> >
> > The value of the settings-variable was unfortunately converted before
> > to Integer.MAX_VALUE within the settings.java
> >
> > enum Setting {
> > HEADER_TABLE_SIZE(1),
> > ENABLE_PUSH(2),
> > MAX_CONCURRENT_STREAMS(3),
> > INITIAL_WINDOW_SIZE(4),
> > MAX_FRAME_SIZE(5),
> > MAX_HEADER_LIST_SIZE(6),
> > UNKNOWN(Integer.MAX_VALUE);
> >
> > Thus, the logfile doesn’t contain the received, unknown settings-key but
> MAX_VALUE instead.
> >
> > Is it possible to log the real settings key, which was received by the server?
> > Maybe the logging can be moved to the Setting.java instead or the real
> > key value would have to be transferred to the function which logs(?)
>
> I think the existing log can probably just be fixed, no? Want to take a stab at
> writing a PR for this?
>
> -chris
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
Hello Chris,
I forked tomcat and commited/pushed a change.
Somehow I got lost with the pull request. I haven’t created one yet because I committed one file which shouldn’t be contained in the commit.
But somehow the commit was already authored (?)
Not sure if I messed up something up to now.
Can I create a pull request even if one file (gitignore) was accidentally contained in the commit?
How can my push already be authored before any pull request?
https://github.com/HoffmannTom/tomcat/commit/6da6f9444192a1ca1d8d0eda1c6694b7c12451ef
Could you help me out how to continue?
If my change is a mess, then you can tell me and I skip the pull request.
Thanks! Thomas
Re: Unknown http2 settings is logged with wrong settings key
Posted by Christopher Schultz <ch...@christopherschultz.net>.
Thomas,
On 3/23/22 10:13, Thomas Hoffmann (Speed4Trade GmbH) wrote:
> Hello,
>
> I got some warnings logged from http2 protocol and the logged values seem to be wrong.
> If an unknown http2 settings is received, it logs the key and the value to the logfile:
>
> /org/apache/coyote/http2/ConnectionSettingsBase.java, line 90:
>
> case UNKNOWN:
> // Unrecognised. Ignore it.
> log.warn(sm.getString("connectionSettings.unknown",
> connectionId, setting, Long.toString(value)));
> return;
>
> The value of the settings-variable was unfortunately converted before to Integer.MAX_VALUE within the settings.java
>
> enum Setting {
> HEADER_TABLE_SIZE(1),
> ENABLE_PUSH(2),
> MAX_CONCURRENT_STREAMS(3),
> INITIAL_WINDOW_SIZE(4),
> MAX_FRAME_SIZE(5),
> MAX_HEADER_LIST_SIZE(6),
> UNKNOWN(Integer.MAX_VALUE);
>
> Thus, the logfile doesn’t contain the received, unknown settings-key but MAX_VALUE instead.
>
> Is it possible to log the real settings key, which was received by the server?
> Maybe the logging can be moved to the Setting.java instead or the real key value would have to be transferred to the function which logs(?)
I think the existing log can probably just be fixed, no? Want to take a
stab at writing a PR for this?
-chris
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org