Re: Error parsing HTTP request header, HTTP method names must be tokens

2018-02-21 Thread Alex O'Ree
Thanks. I'll try the logging change to see if i can at least narrow it down
a bit more.

On Wed, Feb 21, 2018 at 7:49 PM, Konstantin Kolinko 
wrote:

> 2018-02-21 22:19 GMT+03:00 Alex O'Ree :
> > That's the error message. The problem is I have no idea which client it
> is
> > and what character it is sending that is causing the issue. Thus I would
> > like to get the offending header logged in some way.
>
> The "http-nio-8080-exec-3" in the message is the thread name. It can
> be written to the Access Log with "%I"
>
> http://tomcat.apache.org/tomcat-8.5-doc/config/valve.html#Access_Logging
>
> Also look for response status in an access log. I think those requests
> are handled with status "400".
>
> You will see an IP address there. You wont't see any headers (such as
> User-Agent) as those have not been parsed yet.
>
> > On Tue, Feb 20, 2018 at 4:25 PM, Coty Sutherland 
> > wrote:
> >
> >> On Tue, Feb 20, 2018 at 4:01 PM, Alex O'Ree 
> wrote:
> >> > I keep running into the an IllegalArgumentException at or near
> startup of
> >> > tomcat 8.5 with a bunch of cxf web services deployed and I have no
> idea
> >> > what's causing it. The error message mentions turning on logging at
> the
> >> > debug level.
> >>
> >> Random shot in the dark given the minimal date provided :) Does it
> >> look like this:
> >>
> >> INFO [http-nio-8080-exec-3]
> >> org.apache.coyote.http11.Http11Processor.service Error parsing HTTP
> >> request header
> >>  Note: further occurrences of HTTP request parsing errors will be
> >> logged at DEBUG level.
> >>  java.lang.IllegalArgumentException: Invalid character found in the
> >> request target. The valid characters are defined in RFC 7230 and RFC
> >> 3986
> >> at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(
> >> Http11InputBuffer.java:460)
> >> at org.apache.coyote.http11.Http11Processor.service(
> >> Http11Processor.java:291)
> >> at org.apache.coyote.AbstractProcessorLight.process(
> >> AbstractProcessorLight.java:66)
> >> at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(
> >> AbstractProtocol.java:754)
> >> at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.
> >> doRun(NioEndpoint.java:1376)
> >> at org.apache.tomcat.util.net.SocketProcessorBase.run(
> >> SocketProcessorBase.java:49)
> >> at java.util.concurrent.ThreadPoolExecutor.runWorker(
> >> ThreadPoolExecutor.java:1149)
> >> at java.util.concurrent.ThreadPoolExecutor$Worker.run(
> >> ThreadPoolExecutor.java:624)
> >> at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(
> >> TaskThread.java:61)
> >> at java.lang.Thread.run(Thread.java:748)
> >>
> >> If so, then your client is sending you requests with unencoded special
> >> characters that are now disallowed by Tomcat.
> >>
>
> >> Question: Assuming i need to edit the logging.properties file, which
> setting/line do i have to edit to reveal what the root cause is?
>
> http://tomcat.apache.org/tomcat-8.5-doc/logging.html
> and also official Java documentation on java.util.logging.
>
> From the log message cited by Coty, I think you need to add
> org.apache.coyote.http11.Http11Processor.level = FINE
>
> In short, you need both
> 1) .level = FINE
> 2) .level = FINE
>
> "1)" controls whether a log event is raised,
> "2)" controls writing it out to a specific output (console, file)
>
> "2)" is already set in the logging.properties file provided by Tomcat.
>
> Best regards,
> Konstantin Kolinko
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Error parsing HTTP request header, HTTP method names must be tokens

2018-02-21 Thread Konstantin Kolinko
2018-02-21 22:19 GMT+03:00 Alex O'Ree :
> That's the error message. The problem is I have no idea which client it is
> and what character it is sending that is causing the issue. Thus I would
> like to get the offending header logged in some way.

The "http-nio-8080-exec-3" in the message is the thread name. It can
be written to the Access Log with "%I"

http://tomcat.apache.org/tomcat-8.5-doc/config/valve.html#Access_Logging

Also look for response status in an access log. I think those requests
are handled with status "400".

You will see an IP address there. You wont't see any headers (such as
User-Agent) as those have not been parsed yet.

> On Tue, Feb 20, 2018 at 4:25 PM, Coty Sutherland 
> wrote:
>
>> On Tue, Feb 20, 2018 at 4:01 PM, Alex O'Ree  wrote:
>> > I keep running into the an IllegalArgumentException at or near startup of
>> > tomcat 8.5 with a bunch of cxf web services deployed and I have no idea
>> > what's causing it. The error message mentions turning on logging at the
>> > debug level.
>>
>> Random shot in the dark given the minimal date provided :) Does it
>> look like this:
>>
>> INFO [http-nio-8080-exec-3]
>> org.apache.coyote.http11.Http11Processor.service Error parsing HTTP
>> request header
>>  Note: further occurrences of HTTP request parsing errors will be
>> logged at DEBUG level.
>>  java.lang.IllegalArgumentException: Invalid character found in the
>> request target. The valid characters are defined in RFC 7230 and RFC
>> 3986
>> at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(
>> Http11InputBuffer.java:460)
>> at org.apache.coyote.http11.Http11Processor.service(
>> Http11Processor.java:291)
>> at org.apache.coyote.AbstractProcessorLight.process(
>> AbstractProcessorLight.java:66)
>> at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(
>> AbstractProtocol.java:754)
>> at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.
>> doRun(NioEndpoint.java:1376)
>> at org.apache.tomcat.util.net.SocketProcessorBase.run(
>> SocketProcessorBase.java:49)
>> at java.util.concurrent.ThreadPoolExecutor.runWorker(
>> ThreadPoolExecutor.java:1149)
>> at java.util.concurrent.ThreadPoolExecutor$Worker.run(
>> ThreadPoolExecutor.java:624)
>> at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(
>> TaskThread.java:61)
>> at java.lang.Thread.run(Thread.java:748)
>>
>> If so, then your client is sending you requests with unencoded special
>> characters that are now disallowed by Tomcat.
>>

>> Question: Assuming i need to edit the logging.properties file, which
setting/line do i have to edit to reveal what the root cause is?

http://tomcat.apache.org/tomcat-8.5-doc/logging.html
and also official Java documentation on java.util.logging.

>From the log message cited by Coty, I think you need to add
org.apache.coyote.http11.Http11Processor.level = FINE

In short, you need both
1) .level = FINE
2) .level = FINE

"1)" controls whether a log event is raised,
"2)" controls writing it out to a specific output (console, file)

"2)" is already set in the logging.properties file provided by Tomcat.

Best regards,
Konstantin Kolinko

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



Re: Error parsing HTTP request header, HTTP method names must be tokens

2018-02-21 Thread Mark Thomas
On 21/02/18 19:19, Alex O'Ree wrote:
> That's the error message. The problem is I have no idea which client it is
> and what character it is sending that is causing the issue. Thus I would
> like to get the offending header logged in some way.

That sounds like an enhancement request for the log message to include
the invalid character and a client IP address.

The patch should be fairly simple if you fancy taking a shot at it.

Mark


> 
> On Tue, Feb 20, 2018 at 4:25 PM, Coty Sutherland 
> wrote:
> 
>> On Tue, Feb 20, 2018 at 4:01 PM, Alex O'Ree  wrote:
>>> I keep running into the an IllegalArgumentException at or near startup of
>>> tomcat 8.5 with a bunch of cxf web services deployed and I have no idea
>>> what's causing it. The error message mentions turning on logging at the
>>> debug level.
>>
>> Random shot in the dark given the minimal date provided :) Does it
>> look like this:
>>
>> INFO [http-nio-8080-exec-3]
>> org.apache.coyote.http11.Http11Processor.service Error parsing HTTP
>> request header
>>  Note: further occurrences of HTTP request parsing errors will be
>> logged at DEBUG level.
>>  java.lang.IllegalArgumentException: Invalid character found in the
>> request target. The valid characters are defined in RFC 7230 and RFC
>> 3986
>> at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(
>> Http11InputBuffer.java:460)
>> at org.apache.coyote.http11.Http11Processor.service(
>> Http11Processor.java:291)
>> at org.apache.coyote.AbstractProcessorLight.process(
>> AbstractProcessorLight.java:66)
>> at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(
>> AbstractProtocol.java:754)
>> at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.
>> doRun(NioEndpoint.java:1376)
>> at org.apache.tomcat.util.net.SocketProcessorBase.run(
>> SocketProcessorBase.java:49)
>> at java.util.concurrent.ThreadPoolExecutor.runWorker(
>> ThreadPoolExecutor.java:1149)
>> at java.util.concurrent.ThreadPoolExecutor$Worker.run(
>> ThreadPoolExecutor.java:624)
>> at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(
>> TaskThread.java:61)
>> at java.lang.Thread.run(Thread.java:748)
>>
>> If so, then your client is sending you requests with unencoded special
>> characters that are now disallowed by Tomcat.
>>
>>> Question: Assuming i need to edit the logging.properties file, which
>>> setting/line do i have to edit to reveal what the root cause is?
>>
>> I can't answer that without more information. What is throwing the
>> exception? A stack trace would be helpful.
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>>
> 


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



Re: Error parsing HTTP request header, HTTP method names must be tokens

2018-02-21 Thread Alex O'Ree
That's the error message. The problem is I have no idea which client it is
and what character it is sending that is causing the issue. Thus I would
like to get the offending header logged in some way.

On Tue, Feb 20, 2018 at 4:25 PM, Coty Sutherland 
wrote:

> On Tue, Feb 20, 2018 at 4:01 PM, Alex O'Ree  wrote:
> > I keep running into the an IllegalArgumentException at or near startup of
> > tomcat 8.5 with a bunch of cxf web services deployed and I have no idea
> > what's causing it. The error message mentions turning on logging at the
> > debug level.
>
> Random shot in the dark given the minimal date provided :) Does it
> look like this:
>
> INFO [http-nio-8080-exec-3]
> org.apache.coyote.http11.Http11Processor.service Error parsing HTTP
> request header
>  Note: further occurrences of HTTP request parsing errors will be
> logged at DEBUG level.
>  java.lang.IllegalArgumentException: Invalid character found in the
> request target. The valid characters are defined in RFC 7230 and RFC
> 3986
> at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(
> Http11InputBuffer.java:460)
> at org.apache.coyote.http11.Http11Processor.service(
> Http11Processor.java:291)
> at org.apache.coyote.AbstractProcessorLight.process(
> AbstractProcessorLight.java:66)
> at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(
> AbstractProtocol.java:754)
> at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.
> doRun(NioEndpoint.java:1376)
> at org.apache.tomcat.util.net.SocketProcessorBase.run(
> SocketProcessorBase.java:49)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(
> ThreadPoolExecutor.java:1149)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(
> ThreadPoolExecutor.java:624)
> at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(
> TaskThread.java:61)
> at java.lang.Thread.run(Thread.java:748)
>
> If so, then your client is sending you requests with unencoded special
> characters that are now disallowed by Tomcat.
>
> > Question: Assuming i need to edit the logging.properties file, which
> > setting/line do i have to edit to reveal what the root cause is?
>
> I can't answer that without more information. What is throwing the
> exception? A stack trace would be helpful.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Error parsing HTTP request header, HTTP method names must be tokens

2018-02-20 Thread Coty Sutherland
On Tue, Feb 20, 2018 at 4:01 PM, Alex O'Ree  wrote:
> I keep running into the an IllegalArgumentException at or near startup of
> tomcat 8.5 with a bunch of cxf web services deployed and I have no idea
> what's causing it. The error message mentions turning on logging at the
> debug level.

Random shot in the dark given the minimal date provided :) Does it
look like this:

INFO [http-nio-8080-exec-3]
org.apache.coyote.http11.Http11Processor.service Error parsing HTTP
request header
 Note: further occurrences of HTTP request parsing errors will be
logged at DEBUG level.
 java.lang.IllegalArgumentException: Invalid character found in the
request target. The valid characters are defined in RFC 7230 and RFC
3986
at 
org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:460)
at 
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:291)
at 
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at 
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:754)
at 
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1376)
at 
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at 
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)

If so, then your client is sending you requests with unencoded special
characters that are now disallowed by Tomcat.

> Question: Assuming i need to edit the logging.properties file, which
> setting/line do i have to edit to reveal what the root cause is?

I can't answer that without more information. What is throwing the
exception? A stack trace would be helpful.

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



Error parsing HTTP request header, HTTP method names must be tokens

2018-02-20 Thread Alex O'Ree
I keep running into the an IllegalArgumentException at or near startup of
tomcat 8.5 with a bunch of cxf web services deployed and I have no idea
what's causing it. The error message mentions turning on logging at the
debug level.

Question: Assuming i need to edit the logging.properties file, which
setting/line do i have to edit to reveal what the root cause is?