java.lang.IllegalStateException reported by sonarscanner in jenkins

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
  • what are you trying to achieve
  • what have you tried so far to achieve this

SonarQube version: 7.6
Sonarscanner is reporting error java.lang.IllegalStateException while posting the code quality details to sonarqube server
source server: RHEL 7.3
Java Version: 1.8.261

Hi All

We are facing issue with Sonarscanner running on a jenkins agent. The sonar scanner reports java.lang.IllegalStateException while connecting to sonarqube and posting the results.

The sonarqube server has apache2 which redirects connection to sonarqube at port 9000.The sonarqube server does not report any error for connection. I am wondering if anyone can help understanding the issue with sonarqube.

The following error was reported on SonarQube Web logs -

2020.09.20 05:50:45 INFO web[o.a.c.h.Http11Processor] 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(
at org.apache.coyote.http11.Http11Processor.service(
at org.apache.coyote.AbstractProcessorLight.process(
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$ Source)
at org.apache.tomcat.util.threads.TaskThread$
at Source)


Welcome to the community!

First, 7.6 is past EOL. You should upgrade at your earliest convenience:

7.6 -> 7.9.4 (current LTS) -> 8.4.2 (latest version. this step is optional)

Second, that error is going to be caused by something on your network between the scanner and the SonarQube server. You should talk to your network folks.


Thanks Ann !

I found that the issue was related with certificate after upgrading Java on the CI server. We’ve added the certificate store in cacerts in order to resolve the issue.