Error during SonarQube Scanner execution after upgrade to SonarQube 8

Hello,

I’ve upgraded my sonarqube from 7.6 to 7.9.1 and everything works like expected except the SonarScanner for Jenkins. I’ve configured my job to execute the Sonarqube Scanner but I got the following error:

11:24:59 DEBUG: Get bootstrap index...
11:24:59 DEBUG: Download: https://sonarqube.domain.com/batch_bootstrap/index
11:24:59 DEBUG: Get bootstrap completed
11:24:59 INFO: ------------------------------------------------------------------------
11:24:59 INFO: EXECUTION FAILURE
11:24:59 INFO: ------------------------------------------------------------------------
11:24:59 INFO: Total time: 0.563s
11:24:59 INFO: Final Memory: 6M/360M
11:24:59 INFO: ------------------------------------------------------------------------
11:24:59 ERROR: Error during SonarQube Scanner execution
11:24:59 org.sonarsource.scanner.api.internal.ScannerException: Unable to execute SonarQube
11:24:59 	at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory$1.run(IsolatedLauncherFactory.java:84)
11:24:59 	at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory$1.run(IsolatedLauncherFactory.java:71)
11:24:59 	at java.security.AccessController.doPrivileged(Native Method)
11:24:59 	at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher(IsolatedLauncherFactory.java:71)
11:24:59 	at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher(IsolatedLauncherFactory.java:67)
11:24:59 	at org.sonarsource.scanner.api.EmbeddedScanner.doStart(EmbeddedScanner.java:218)
11:24:59 	at org.sonarsource.scanner.api.EmbeddedScanner.start(EmbeddedScanner.java:156)
11:24:59 	at org.sonarsource.scanner.cli.Main.execute(Main.java:70)
11:24:59 	at org.sonarsource.scanner.cli.Main.main(Main.java:60)
11:24:59 Caused by: java.lang.IllegalStateException: Fail to download libraries from server
11:24:59 	at org.sonarsource.scanner.api.internal.Jars.downloadFiles(Jars.java:93)
11:24:59 	at org.sonarsource.scanner.api.internal.Jars.download(Jars.java:70)
11:24:59 	at org.sonarsource.scanner.api.internal.JarDownloader.download(JarDownloader.java:39)
11:24:59 	at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory$1.run(IsolatedLauncherFactory.java:75)
11:24:59 	... 8 more
11:24:59 Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
11:24:59 	at org.sonarsource.scanner.api.internal.Jars.downloadFiles(Jars.java:87)
11:24:59 	... 11 more

It’s seems it’s related with the https://sonarqube.domain.com/batch_bootstrap/index link because if I go directly to the link I got this message:

image

Any idea what I’m doing wrong or missing?

Thank you

Hi,

AFAIK the endpoint for getting the scanner jars changed from batch_bootstrap/index to
bootstrap/index , means you need to use a more recent version of the SonarScanner,
see https://docs.sonarqube.org/latest/analysis/scan/sonarscanner-for-jenkins/
Version 4+ should be sufficient.

Gilbert

1 Like

Hi @anon67236913,

Thank you for your reply.

I’ve tried that but I got the same error. I’ve one small question, where can I define the version of SonarScanner to use?

Than you.

Hi,

you need the Sonarqube Jenkins plugin and the Sonarqube Scanner in Jenkins (use version 4+)
As screenshots of my localized Jenkins won’t be helpful, i’ve searched and found

Gilbert

Once again, thank you @anon67236913.

It’s working now. I’ve to change the version in the Jenkins > Manage Jenkins > Global Tool Configuration – sonarqube integration with Jenkins for code analysis . :slight_smile:

Hi,

i’m glad it works :rocket: on your side now
Note = when updating to Sonarqube 8.0, the scanner must also run with Java 11.
With Sonarqube 7.9.1 LTS and the upcoming 7.9.2, Sonarqube server needs
Java 11 - whereas scanners are still happy with Java 8.

Gilbert