Bootstrap FreeKB - Tomcat - Resolve "Error parsing HTTP request header"
Tomcat - Resolve "Error parsing HTTP request header"

Updated:   |  Tomcat articles

"Error parsing HTTP request header" appears in catalina.log.

26-Jul-2022 01:13:52.454 INFO [tomcat-http--27] org.apache.coyote.http11.Http11Processor.service Error parsing HTTP request header
 Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level.
 java.lang.IllegalArgumentException: Invalid character found in method name. HTTP method names must be tokens
  at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:426)
  at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:687)
  at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
  at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790)
  at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
  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)

 


Max HTTP Header Size

Each Tomcat application server has a set amount of memory allocated for HTTP header, in server.xml. In this example, the application server has 12288 bytes of memory allocated for the HTTP header. If server.xml is updated to have some other value set for the maxHttpHeaderSize, the Tomcat application server will need to be restarted for this change to take effect.

maxHttpHeaderSize="12288"

 


Anti Virus

If the app in question is not fronted by a web server and does not produce web content (eg. JSP and HTML pages), anti-virus scans may be the cause of this error. The localhost_access_log.txt may identify an anti-virus scan. In this example, the anti-virus software Qualys was scanning Tomcat and producing the HTTP exceptions.

x.x.x.x - - [dd/mm/yyyy:hh:mm:ss -xxxx] "QUALYS / HTTP/1.1" 405 1134

 

Usually, anti-virus scans are scheduled to occur at a reoccurring period, such as once every 7 days near the same time period. If you know the schedule for the anit-virus scans, you can check the catalina.log at the same time period in the past. If similar exceptions are found near the same time period, this is further indication of an anti-virus scan as the cause of the HTTP errors.

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter f4aed5 in the box below so that we can be sure you are a human.