Discussion:
Error parsing HTTP request header, HTTP method names must be tokens
Alex O'Ree
2018-02-20 21:01:33 UTC
Permalink
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?
Coty Sutherland
2018-02-20 21:25:54 UTC
Permalink
Post by 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.
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.
Post by Alex O'Ree
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-***@tomcat.apache.org
For additional commands, e-mail: users-***@tomcat.apache.org
Alex O'Ree
2018-02-21 19:19:20 UTC
Permalink
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.
Post by Coty Sutherland
Post by 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.
Random shot in the dark given the minimal date provided :) Does it
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.
Post by Alex O'Ree
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.
---------------------------------------------------------------------
Mark Thomas
2018-02-21 19:27:20 UTC
Permalink
Post by 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.
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
Post by Alex O'Ree
Post by Coty Sutherland
Post by 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.
Random shot in the dark given the minimal date provided :) Does it
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.
Post by Alex O'Ree
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-***@tomcat.apache.org
For additional commands, e-mail: users-***@tomcat.apache.org
Konstantin Kolinko
2018-02-22 00:49:57 UTC
Permalink
Post by 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.
Post by Alex O'Ree
Post by Coty Sutherland
Post by 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.
Random shot in the dark given the minimal date provided :) Does it
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) <log category aka logger>.level = FINE
2) <handler>.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-***@tomcat.apache.org
For additional commands, e-mail: users-***@tomcat.apache.org
Alex O'Ree
2018-02-22 03:10:13 UTC
Permalink
Thanks. I'll try the logging change to see if i can at least narrow it down
a bit more.
Post by Konstantin Kolinko
Post by Alex O'Ree
That's the error message. The problem is I have no idea which client it
is
Post by Alex O'Ree
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.
Post by Alex O'Ree
Post by Coty Sutherland
Post by Alex O'Ree
I keep running into the an IllegalArgumentException at or near
startup of
Post by Alex O'Ree
Post by Coty Sutherland
Post by Alex O'Ree
tomcat 8.5 with a bunch of cxf web services deployed and I have no
idea
Post by Alex O'Ree
Post by Coty Sutherland
Post by Alex O'Ree
what's causing it. The error message mentions turning on logging at
the
Post by Alex O'Ree
Post by Coty Sutherland
Post by Alex O'Ree
debug level.
Random shot in the dark given the minimal date provided :) Does it
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) <log category aka logger>.level = FINE
2) <handler>.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
---------------------------------------------------------------------
Loading...