When i am trying to configur sonar in windows i am getting the task execurion error - sonarqube

I am using Sonar-Qube-5.5 and Sonar-Runner-2.4. These are configuration that we have access to use. We need to do the set-up in each and every local system.
Added the logs for reference.
D:\sonar\sonar-runner-2.4\bin>sonar-runner D:\sonar\soanr_ws\FirstSonarProject -X
D:\sonar\sonar-runner-2.4\bin\..
SonarQube Runner 2.4
Java 1.7.0_79 Oracle Corporation (64-bit)
Windows 7 6.1 amd64
INFO: Error stacktraces are turned on.
INFO: Runner configuration file: D:\sonar\sonar-runner-2.4\bin\..\conf\sonar-runner.properties
INFO: Project configuration file: NONE
INFO: SonarQube Server 5.5
09:52:01.484 DEBUG - Publish global mode
09:52:01.562 DEBUG - cache: C:\Users\tcs_ban214.HDFCSLDM\.sonar\ws_cache\http%3A%2F%2Flocalhost%3A9000\global
09:52:01.718 INFO - Load global repositories
09:52:01.781 DEBUG - GET 200 http://localhost:9000/batch/global | time=63ms
09:52:01.859 INFO - Load global repositories (done) | time=141ms
09:52:01.890 INFO - User cache: C:\Users\tcs_ban214.HDFCSLDM\.sonar\cache
09:52:02.217 INFO - Load plugins index
09:52:02.217 DEBUG - GET 200 http://localhost:9000/deploy/plugins/index.txt | time=0ms
09:52:02.217 INFO - Load plugins index (done) | time=0ms
09:52:02.217 DEBUG - Load plugins
09:52:02.249 DEBUG - Load plugins (done) | time=32ms
09:52:02.249 DEBUG - API compatibility mode is enabled on plugin Git [scmgit] (built with API lower than 5.2)
09:52:02.264 DEBUG - API compatibility mode is enabled on plugin JavaScript [javascript] (built with API lower than 5.2)
09:52:02.264 DEBUG - API compatibility mode is enabled on plugin SVN [scmsvn] (built with API lower than 5.2)
09:52:02.264 DEBUG - API compatibility mode is enabled on plugin Java [java] (built with API lower than 5.2)
09:52:02.280 DEBUG - API compatibility mode is enabled on plugin C# [csharp] (built with API lower than 5.2)
09:52:02.373 DEBUG - Plugins:
09:52:02.373 DEBUG - * Git 1.2 (scmgit)
09:52:02.373 DEBUG - * JavaScript 2.11 (javascript)
09:52:02.373 DEBUG - * SVN 1.3 (scmsvn)
09:52:02.373 DEBUG - * Java 3.13.1 (java)
09:52:02.373 DEBUG - * C# 5.0 (csharp)
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 1.732s
Final Memory: 3M/91M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
org.sonar.runner.impl.RunnerException: Unable to execute Sonar
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
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: Task 'D:\sonar\soanr_ws\FirstSonarProject' does not exist. Please use 'list' task to see all available tasks.
D:\sonar\sonar-runner-2.4\bin>

You incorrectly executed the sonar-runner tool. You should execute command in directory where your project is located, example:
cd D:\sonar\soanr_ws\FirstSonarProject
D:\sonar\sonar-runner-2.4\bin\sonar-runner -X
Here is a whole documentation about how to execute sonar-runner from command line: http://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner

Related

ERROR: Error during SonarScanner execution

I am trying to scan the source code of this website https://demo.testfire.net/ whose source code is https://github.com/HCL-TECH-SOFTWARE/AltoroJ/tree/master over here.
I don't understand how to do it. I followed some videos but this is the error I am getting. Can someone tell me the steps I need to follow, or point me to any video or blog that can be helpful to do so?
INFO: Scanner configuration file: C:\Users\vansi\Downloads\sonar-scanner-cli-4.6.2.2472-windows\sonar-scanner-4.6.2.2472-windows\bin\..\conf\sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: SonarScanner 4.6.2.2472
INFO: Java 11.0.11 AdoptOpenJDK (64-bit)
INFO: Windows 10 10.0 amd64
INFO: User cache: C:\Users\vansi\.sonar\cache
INFO: Scanner configuration file: C:\Users\vansi\Downloads\sonar-scanner-cli-4.6.2.2472-windows\sonar-scanner-4.6.2.2472-windows\bin\..\conf\sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: Analyzing on SonarQube server 9.1.0
INFO: Default locale: "en_IN", source code encoding: "windows-1252" (analysis is platform dependent)
INFO: Load global settings
INFO: Load global settings (done) | time=162ms
INFO: Server id: BF41A1F2-AX0zI9epWE89Of-oTW0T
INFO: User cache: C:\Users\vansi\.sonar\cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=95ms
INFO: Load/download plugins (done) | time=309ms
INFO: Process project properties
INFO: Process project properties (done) | time=21ms
INFO: Execute project builders
INFO: Execute project builders (done) | time=2ms
INFO: Project key: Altoro-J
INFO: Base dir: C:\Users\vansi\Downloads\AltoroJ-AltoroJ-3.2 (1)
INFO: Working dir: C:\Users\vansi\Downloads\AltoroJ-AltoroJ-3.2 (1)\.scannerwork
INFO: Load project settings for component key: 'Altoro-J'
INFO: Load project settings for component key: 'Altoro-J' (done) | time=35ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=110ms
INFO: Load active rules
INFO: Load active rules (done) | time=3237ms
WARN: SCM provider autodetection failed. Please use "sonar.scm.provider" to define SCM of your project, or disable the SCM Sensor in the project settings.
INFO: Indexing files...
INFO: Project configuration:
INFO: Load project repositories
INFO: Load project repositories (done) | time=26ms
INFO: 214 files indexed
INFO: Quality profile for css: Sonar way
INFO: Quality profile for java: Sonar way
INFO: Quality profile for js: Sonar way
INFO: Quality profile for jsp: Sonar way
INFO: Quality profile for web: Sonar way
INFO: Quality profile for xml: Sonar way
INFO: ------------- Run sensors on module Altoro-J
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=52ms
INFO: Sensor JavaSensor [java]
INFO: Configured Java source version (sonar.java.source): none
INFO: JavaClasspath initialization
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 11.058s
INFO: Final Memory: 13M/54M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
org.sonar.java.AnalysisException: Your project contains .java files, please provide compiled classes with sonar.java.binaries property, or exclude them from the analysis with sonar.exclusions property.
at org.sonar.java.classpath.ClasspathForMain.init(ClasspathForMain.java:75)
at org.sonar.java.classpath.AbstractClasspath.getElements(AbstractClasspath.java:317)
at org.sonar.java.SonarComponents.getJavaClasspath(SonarComponents.java:175)
at org.sonar.java.JavaFrontend.<init>(JavaFrontend.java:88)
at org.sonar.plugins.java.JavaSensor.execute(JavaSensor.java:108)
at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:59)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:77)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:59)
at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:79)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:382)
at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:378)
at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:347)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:136)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy0.execute(Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
ERROR:
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
The error indicates that you have not provided the java binaries during the sonar execution.
Add the below sonar.properties:
sonar.java.binaries= **/*.java
This will now scan your java binaries. This property is one of the required property if you are going to scan the java code.
More details: https://docs.sonarqube.org/latest/analysis/languages/java/
please sure your container of sonarqube /manuall setup is running on your ip:port (default=9090) and then rebuild using jenkins or your ci/cd tool.
Hope it will work

Jenkins: org.sonarsource.scanner.api.internal.ScannerException: Unable to execute SonarQube

Using sonar-scanner failed with an ERROR, although the Get bootstrap completed step ran successfully before. Seeing
org.sonarsource.scanner.api.internal.ScannerException: Unable to execute SonarQube
More details:
/opt/sonar-scanner/bin/sonar-scanner -X -Djavax.net.debug="ssl,handshake" -Dsonar.projectKey=project-header-forwarding -Dsonar.projectName=project-header-forwarding -Dsonar.projectVersion=0.0.80 -Dsonar.sourceEncoding=UTF-8 -Dsonar.host.url=http://my-sonarsystem:9000 -Dsonar.projectBaseDir=/home/jenkins-master/workspace/project-header-forwarding_master
11:55:59.205 INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
11:55:59.221 INFO: Project root configuration file: NONE
11:55:59.270 INFO: SonarQube Scanner 2.8
11:55:59.270 INFO: Java 1.8.0_212 Oracle Corporation (64-bit)
11:55:59.270 INFO: Linux 3.10.0-957.12.2.el7.x86_64 amd64
11:55:59.560 DEBUG: keyStore is :
11:55:59.561 DEBUG: keyStore type is : jks
11:55:59.561 DEBUG: keyStore provider is :
11:55:59.561 DEBUG: init keystore
11:55:59.562 DEBUG: init keymanager of type SunX509
11:55:59.665 INFO: User cache: /home/wpci/.sonar/cache
11:55:59.665 DEBUG: Extract sonar-scanner-api-batch in temp...
11:55:59.680 DEBUG: Get bootstrap index...
11:55:59.680 DEBUG: Download: http://my-sonarsystem:9000/batch_bootstrap/index
11:55:59.962 DEBUG: Get bootstrap completed
11:55:59.969 INFO: ------------------------------------------------------------------------
11:55:59.970 INFO: EXECUTION FAILURE
11:55:59.970 INFO: ------------------------------------------------------------------------
11:55:59.971 INFO: Total time: 0.832s
11:56:00.014 INFO: Final Memory: 4M/178M
11:56:00.014 INFO: ------------------------------------------------------------------------
11:56:00.014 ERROR: Error during SonarQube Scanner execution
org.sonarsource.scanner.api.internal.ScannerException: Unable to execute SonarQube
at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory$1.run(IsolatedLauncherFactory.java:84)
at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory$1.run(IsolatedLauncherFactory.java:71)
at java.security.AccessController.doPrivileged(Native Method)
at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher(IsolatedLauncherFactory.java:71)
at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher(IsolatedLauncherFactory.java:67)
at org.sonarsource.scanner.api.EmbeddedScanner.doStart(EmbeddedScanner.java:218)
at org.sonarsource.scanner.api.EmbeddedScanner.start(EmbeddedScanner.java:156)
at org.sonarsource.scanner.cli.Main.execute(Main.java:72)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: java.lang.IllegalStateException: Fail to download libraries from server
at org.sonarsource.scanner.api.internal.Jars.downloadFiles(Jars.java:93)
at org.sonarsource.scanner.api.internal.Jars.download(Jars.java:70)
at org.sonarsource.scanner.api.internal.JarDownloader.download(JarDownloader.java:39)
at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory$1.run(IsolatedLauncherFactory.java:75)
... 8 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
at org.sonarsource.scanner.api.internal.Jars.downloadFiles(Jars.java:87)
... 11 more
You're running a version of Sonar Scanner that isn't compatible with your version of SonarQube.
More specifically, the version of Sonar Scanner you're using attempts to download the relevant scanner Jars by getting a list from the batch_bootstrap/index endpoint of your SonarQube server, but this was deprecated then removed in more recent SonarQube versions, in favour of bootstrap/index so the scanner is attempting to parse an empty list of Jars.
Depending on which version of SonarQube you're running, updating to Sonar Scanner 4 should overcome this.

SonarQube upgrade from 6.4 to 6.5 breaks the scanner

I am on sonarQube6.4 and have upgraded to 6.5
Sonar-scanner is 3.0.3
Now after the upgrade the scanner fails anytime there is a java file in the source path. If I don't scan java files everything works just fine.
However If I rollback an use 6.4 version, everything works fine, so is there any regression? This is the stack trace, when I run the scanner command with -X command. So is it a mandate in 6.5 to provided the location of all compiled classed, is there a way to ignore it.
04:56:21.218 DEBUG: Sensors : JavaSquidSensor -> SurefireSensor ->
JaCoCoSensor -> SonarJavaXmlFileSensor -> Analyzer for "php.ini" files
-> Zero Coverage Sensor -> CPD Block Indexer 04:56:21.218 INFO: Sensor JavaSquidSensor [java] 04:56:21.558 INFO: Configured Java source
version (sonar.java.source): none 04:56:21.565 INFO: JavaClasspath
initialization 04:56:21.570 INFO:
------------------------------------------------------------------------ 04:56:21.571 INFO: EXECUTION FAILURE 04:56:21.571 INFO:
------------------------------------------------------------------------ 04:56:21.571 INFO: Total time: 6.545s 04:56:21.707 INFO: Final Memory:
51M/1083M 04:56:21.707 INFO:
------------------------------------------------------------------------ 04:56:21.707 ERROR: Error during SonarQube Scanner execution
org.sonar.squidbridge.api.AnalysisException: Please provide compiled
classes of your project with sonar.java.binaries property
at org.sonar.java.JavaClasspath.init(JavaClasspath.java:59)
at org.sonar.java.AbstractJavaClasspath.getElements(AbstractJavaClasspath.java:281)
at org.sonar.java.SonarComponents.getJavaClasspath(SonarComponents.java:141)
at org.sonar.java.JavaSquid.(JavaSquid.java:83)
at org.sonar.plugins.java.JavaSquidSensor.execute(JavaSquidSensor.java:83)
at org.sonar.scanner.sensor.SensorWrapper.analyse(SensorWrapper.java:53)
at org.sonar.scanner.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:88)
at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:82)
at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:68)
at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:78)
at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:179)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:144)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:129)
at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:261)
at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:256)
at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:245)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:144)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:129)
at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:47)
at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:84)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:144)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:129)
at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:119)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:116)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy0.execute(Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:233)
at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:123)
at org.sonarsource.scanner.cli.Main.execute(Main.java:77)
at org.sonarsource.scanner.cli.Main.main(Main.java:61) 04:56:21.710 DEBUG: Execution getVersion 04:56:21.711 DEBUG: Execution
stop
When I run the same with 6.4, it works fine and the only warning I see in the console is :
04:52:42.738 WARN: Bytecode of dependencies was not provided for analysis of source files, you might end up with less precise results. Bytecode can be provided using sonar.java.libraries property
Error during SonarQube Scanner execution
org.sonar.squidbridge.api.AnalysisException: Please provide compiled
classes of your project with sonar.java.binaries property
Since SonarJava 4.12, you must specify sonar.java.binaries property https://docs.sonarqube.org/display/PLUG/Java+Plugin+and+Bytecode
Example :
sonar-scanner -Dsonar.projectKey=fr.demo:my-project -Dsonar.sources=. -Dsonar.java.binaries=.
The error message says:
Error during SonarQube Scanner execution org.sonar.squidbridge.api.AnalysisException:
Please provide compiled classes of your project with sonar.java.binaries property
It seems like the java sensor requires the .class files, in addition to the .java files.
You could:
Add those files to the analysis (it will by the way give you more valuable sonar findings!)
Try adding and removing files to find out, which piece of code causes the issue and report it as a Sonar Java bug
I had this issue as well and I fixed it in the following way:
This page mentions about an entry which was optional before and became mandatory during the latest update (4.12). It says that the sonar.java.binaries entry in the Jenkins project settings should be set. When set, even to a faulty folder, it will fix your errors, leaving only a warning and your pipeline will be running again.
The setting should be added to Jenkins -> "your project" -> Configuration -> Build -> Execute SonarQube Scanner -> Analysis Properties. Add this entry and point it to your binaries folder.
Even i was also facing same issue after SonarQube upgrade to latest 6.5 version. But after downgrading SonarJava plugin(from 4.12 to 4.11), it worked.
Hope it will help you.

Status returned by url [http://localhost:9000/batch_bootstrap/index] is not valid

When I am trying to run sonar-scanner, I was not able to start sonarqube and this error is being displayed.
INFO: Scanner configuration file: /sonar-scanner-2.8/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: SonarQube Scanner 2.8
INFO: Java 1.8.0_91 Oracle Corporation (64-bit)
INFO: Mac OS X 10.12.1 x86_64
INFO: User cache: /.sonar/cache
ERROR: SonarQube server [http://localhost:9000] can not be reached
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 0.417s
INFO: Final Memory: 3M/123M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
org.sonarsource.scanner.api.internal.ScannerException: Unable to execute SonarQube
at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory$1.run(IsolatedLauncherFactory.java:84)
at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory$1.run(IsolatedLauncherFactory.java:71)
at java.security.AccessController.doPrivileged(Native Method)
at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher(IsolatedLauncherFactory.java:71)
at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher(IsolatedLauncherFactory.java:67)
at org.sonarsource.scanner.api.EmbeddedScanner.doStart(EmbeddedScanner.java:218)
at org.sonarsource.scanner.api.EmbeddedScanner.start(EmbeddedScanner.java:156)
at org.sonarsource.scanner.cli.Main.execute(Main.java:72)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: java.lang.IllegalStateException: Fail to download libraries from server
at org.sonarsource.scanner.api.internal.Jars.downloadFiles(Jars.java:93)
at org.sonarsource.scanner.api.internal.Jars.download(Jars.java:70)
at org.sonarsource.scanner.api.internal.JarDownloader.download(JarDownloader.java:39)
at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory$1.run(IsolatedLauncherFactory.java:75)
... 8 more
Caused by: java.lang.IllegalStateException: Status returned by url [http://localhost:9000/batch_bootstrap/index] is not valid: [404]
at org.sonarsource.scanner.api.internal.ServerConnection.callUrl(ServerConnection.java:115)
at org.sonarsource.scanner.api.internal.ServerConnection.downloadString(ServerConnection.java:98)
at org.sonarsource.scanner.api.internal.Jars.downloadFiles(Jars.java:78)
... 11 more
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
Actually, you should first start SonarQube. When it runs, then you can start your scanner.
I get the case where my port 9001 was already in used and SonarQube server did't start. To resolve it, I changed the port to 19001 (free on my computer) in SonarQube_Dir/conf/sonar.properties
sonar.search.port=19001
After this change, I was able to start the sonarQube server, and run the scanner.

Execution failure, unable to request: /deploy/jdbc-driver.txt

We used a Master/Slaves Jenkins architecture to perform SonarQube. When i runned my job,
Sonar was unable to execute and request the file /deploy/jdbc-driver.txt. I didn't find the reason, my properties files (Sonar server and sonar runner) seems to be good.
Could you help me please ?
Best regards,
David Parcoit
[IBP.DVB] $ D:\sonar-runner\bin\sonar-runner.bat -Dsonar.jdbc.driver=com.mysql.jdbc.Driver "-Dsonar.jdbc.url=jdbc:mysql://ibicer05.srv-ib.dev:54301/sonar?autoReconnect=true&useUnicode=true&characterEncoding=utf8" ******** ******** -Dsonar.host.url=http://ibicer00.srv-ib.dev:8090/sonar "-Dsonar.projectBaseDir=E:\Jenkins\workspace\DVB - Build Quotidien\IBP.DVB" -Dsonar.sourceEncoding=UTF-8 -Dsonar.dotnet.excludeGeneratedCode=true -Dsonar.dotnet.buildConfigurations=Release -Dsonar.language=cs -Dsonar.sources=. -Dsonar.gendarme.mode=skip -Dsonar.projectVersion=1.0.0.0 -Dsonar.projectKey=IBP.DVB -Dsonar.ndeps.mode=skip -Dsonar.dotnet.visualstudio.solution.file=IBP.DVB.sln -Dsonar.projectName=DVB
D:\sonar-runner
SonarQube Runner 2.4
Java 1.8.0_05 Oracle Corporation (64-bit)
Windows Server 2012 6.2 amd64
INFO: Runner configuration file: D:\sonar-runner\conf\sonar-runner.properties
INFO: Project configuration file: NONE
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Work directory: E:\Jenkins\workspace\DVB - Build Quotidien\IBP.DVB\.sonar
INFO: SonarQube Server 3.7.4
23:47:37.351 INFO - Load batch settings
23:47:37.507 INFO - User cache: C:\Windows\system32\config\systemprofile\.sonar\cache
23:47:37.523 INFO - Install plugins
23:47:42.265 INFO - Install JDBC driver
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 13.573s
Final Memory: 4M/44M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: Unable to request: /deploy/jdbc-driver.txt
ERROR: Caused by: Unexpected end of ZLIB input stream
ERROR:
ERROR: To see the full stack trace of the errors, re-run SonarQube Runner with the -e switch.
ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.
Build step 'Invoke Standalone Sonar Analysis' marked build as failure
Finished: FAILURE

Resources