Jenkins & Sonar: fails after "Get boostrap completed"

Currently have:

  • Jenkins (version 2.289.2)
  • SonarQube (Community Edition Version 8.5.1 (build 38104))
    Running in GCP Kubernetes.

I’m currently integrating SonarQube in Jenkins and after having configured SonarQube server and SonarQube scanner in Jenkins.

To test if everything is ok I put up a simple test:

  • Cloning a GIT repo with a HelloWorld java in it

But this error keeps appearing:

[sonar_teste] $ /var/jenkins_home/tools/hudson.plugins.sonar.SonarRunnerInstallation/SonarQube_scanner/bin/sonar-scanner -X ******** -Dsonar.projectKey=XXX -Dsonar.sourceEncoding=UTF-8 -Dsonar.projectBaseDir=/var/jenkins_home/workspace/sonar_teste
13:43:41.766 INFO: Scanner configuration file: /var/jenkins_home/tools/hudson.plugins.sonar.SonarRunnerInstallation/SonarQube_scanner/conf/
13:43:41.769 INFO: Project root configuration file: NONE
13:43:41.821 INFO: SonarScanner
13:43:41.821 INFO: Java 11.0.11 AdoptOpenJDK (64-bit)
13:43:41.821 INFO: Linux 5.4.104+ amd64
13:43:42.129 DEBUG: keyStore is : 
13:43:42.130 DEBUG: keyStore type is : pkcs12
13:43:42.130 DEBUG: keyStore provider is : 
13:43:42.130 DEBUG: init keystore
13:43:42.131 DEBUG: init keymanager of type SunX509
13:43:42.393 DEBUG: Create: /var/jenkins_home/.sonar/cache
13:43:42.393 INFO: User cache: /var/jenkins_home/.sonar/cache
13:43:42.394 DEBUG: Create: /var/jenkins_home/.sonar/cache/_tmp
13:43:42.397 DEBUG: Extract sonar-scanner-api-batch in temp...
13:43:42.401 DEBUG: Get bootstrap index...
13:43:42.401 DEBUG: Download: https://xxxxxxxxxxxx/sonar/batch/index
13:43:43.338 DEBUG: Get bootstrap completed
13:43:43.356 INFO: ------------------------------------------------------------------------
13:43:43.356 INFO: ------------------------------------------------------------------------
13:43:43.357 INFO: Total time: 1.626s
13:43:43.380 INFO: Final Memory: 5M/20M
13:43:43.380 INFO: ------------------------------------------------------------------------
13:43:43.380 ERROR: Error during SonarScanner execution
org.sonarsource.scanner.api.internal.ScannerException: Unable to execute SonarScanner analysis
	at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.lambda$createLauncher$0(
	at java.base/ Method)
	at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher(
	at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher(
	at org.sonarsource.scanner.api.EmbeddedScanner.doStart(
	at org.sonarsource.scanner.api.EmbeddedScanner.start(
	at org.sonarsource.scanner.cli.Main.execute(
	at org.sonarsource.scanner.cli.Main.main(
Caused by: java.lang.IllegalStateException: Fail to parse entry in bootstrap index: 
	at org.sonarsource.scanner.api.internal.BootstrapIndexDownloader.parse(
	at org.sonarsource.scanner.api.internal.BootstrapIndexDownloader.getIndex(
	at org.sonarsource.scanner.api.internal.JarDownloader.getScannerEngineFiles(
	at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.lambda$createLauncher$0(
	... 7 more
WARN: Unable to locate 'report-task.txt' in the workspace. Did the SonarScanner succeed?
ERROR: SonarQube scanner exited with non-zero code: 1
Finished: FAILURE

The bootstrap index url returns:

I search solutions but nothing seems to solve it.


Welcome to the community!

You say you’ve checked the batch/index and get a valid-looking response (at least based on what I see from our dogfooding instance). When you checked it, did you copy/paste the URL from the log? I.e. were you checking exactly the same URL as Jenkins?

Assuming the answer to that^ is ‘yes’, is it possible that there’s something on the network (e.g. a proxy) that allows your traffic to SonarQube but blocks Jenkins’?


1 Like

Hi, @ganncamp thanks for replying.
Yes, I copied the address link directly from Jenkins and that worked

Both Jenkins and SonarQube have AzureAD SSO authentication and I have an nginx ingress controller on GCP and I did inspect if anything showed up in the pod logs but it doesn’t appear any error.

The only thing that is a bit of on the NGINx Ingress Controller Logs is theese lines: - - [11/Aug/2021:08:40:35 +0000] "GET /sonar/batch/index HTTP/2.0" 401 0 "-" "ScannerCLI/" 0 0.009 [default-sonar-svc-9000] [] 0 0.009 401 943ab489dc93850dea975e566ceaa98d - - [11/Aug/2021:08:40:35 +0000] "GET /sonar/batch/index HTTP/2.0" 302 138 "-" "ScannerCLI/" 65 0.009 [default-sonar-svc-9000] [] - - - - 943ab489dc93850dea975e566ceaa98d - - [11/Aug/2021:08:40:35 +0000] "GET /oauth2/start?rd=%2Fsonar%2Fbatch%2Findex HTTP/2.0" 302 435 "-" "ScannerCLI/" 37 0.003 [default-oauth2-proxy-4180] [] yy.yy.y.y:4180 435 0.003 302 4c47f801f3310f02d70abae8d674bc4f - - [11/Aug/2021:08:40:40 +0000] "GET /oauth2/auth HTTP/1.1" 202 0 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0" 8210 0.002 [default-oauth2-proxy-4180] [] yy.yy.y.y:4180 0 0.003 202 62f729cf75d5ab0ccab27aa9d2abb4b5

I build and watched live the logs and after this line appear it stopped.

I kept thinking about what you said and I accessed the Jenkins pod and tried to curl the url/batch/index and it can’t access it as you can see:

jenkins@jenkins-0:/$ curl
<head><title>302 Found</title></head>
<center><h1>302 Found</h1></center>

But when I access from my local browser it shows the


You’re one step ahead of me. That’s^ exactly what I was going to ask you to try next. So… it looks like you need to talk to your network folks or whomever admins your Nginx.


I already did it, it turns out that on the url field I needed to put the “http://sonar-service:9000/sonar” to this to work.
I was putting the actual URL that people can acess sonar!

Now I’m getting a:

Bad Message 431
reason: Request Header Fields Too Large

Another error to find and solve :slight_smile:

Thanks @ganncamp

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.