Fail to download libraries from server, Caused by: java.lang.ArrayIndexOutOfBoundsException: 1

SonarQube Runner 2.4
Java 1.8.0_141 Oracle Corporation (64-bit)
Linux 2.6.32-696.18.7.1.el6.ucloud.x86_64 amd64
INFO: Error stacktraces are turned on.
INFO: Runner configuration file: /data/jenkins/tools/hudson.plugins.sonar.SonarRunnerInstallation/default/conf/sonar-runner.properties
INFO: Project configuration file: NONE
INFO: Default locale: "en_US", source code encoding: "UTF-8" (analysis is platform dependent)
INFO: Work directory: /****/.sonar
INFO: SonarQube Server 7.9.2.30863
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 0.153s
Final Memory: 2M/240M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
java.lang.IllegalStateException: Fail to download libraries from server
	at org.sonar.runner.impl.Jars.dowloadFiles(Jars.java:78)
	at org.sonar.runner.impl.Jars.download(Jars.java:57)
	at org.sonar.runner.impl.JarDownloader.download(JarDownloader.java:46)
	at org.sonar.runner.impl.JarDownloader.checkVersionAndDownload(JarDownloader.java:37)
	at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:71)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
	at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
	at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
	at org.sonar.runner.api.Runner.execute(Runner.java:100)
	at org.sonar.runner.Main.executeTask(Main.java:70)
	at org.sonar.runner.Main.execute(Main.java:59)
	at org.sonar.runner.Main.main(Main.java:53)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
	at org.sonar.runner.impl.Jars.dowloadFiles(Jars.java:72)
	... 12 more

We are using:

  • sonarqube: docker images sonarqube:7.9-community
  • jenkins : 2.204
  • jenkins-plugin : SonarQube Scanner for Jenkins 2.11

Hey there.

Your version of the SonarQube Scanner (v2.4) is very old. and will cause this compatibility issue. Can you try the latest version?

Colin

we team use jenkins,
I download from https://updates.jenkins.io/download/plugins/sonar/ version: 2.11, this is last version and upload to jenkins.

That’s the version of the extension for Jenkins (which ultimately points to a scanner installation to use) but still means you could have an old scanner installed. This section of the docs might help you.

Analyzing other project types

Global Configuration
This step is mandatory if you want to trigger any of your SonarQube analyses with the SonarScanner. You can define as many scanner instances as you wish. Then for each Jenkins job, you will be able to choose with which launcher to use to run the SonarQube analysis.

  1. Log into Jenkins as an administrator and go to Manage Jenkins > Global Tool Configuration
  2. Scroll down to the SonarScanner configuration section and click on Add SonarScanner. It is based on the typical Jenkins tool auto-installation. You can either choose to point to an already installed version of SonarScanner (uncheck ‚ÄėInstall automatically‚Äô) or tell Jenkins to grab the installer from a remote location (check ‚ÄėInstall automatically‚Äô)
1 Like

I must owe you one, I sloved this trouble one day , thanks a million.

1 Like

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