sonarqube ERROR: Error during SonarScanner execution - sonarqube

getting error when trying to invoke scan
I can manually download the file fine as sudo and as well as non sudo so not sure what exactly is the issue.
my server is running as pod and I am running scanner command on macOS Catalina 10.15.7
any hint?
Command>
sonar-scanner -X -Dsonar.projectKey=product-dev -Dsonar.sources=. -Dsonar.host.url=https://codeanalysis.teat.com/ -Dsonar.login=xxxxx
14:33:02.837 INFO: Scanner configuration file: /usr/local/conf/sonar-scanner.properties
14:33:02.840 INFO: Project root configuration file: /Users/user/code/nvidia/git-av/product/sonar-project.properties
14:33:02.871 INFO: SonarScanner 4.7.0.2747
14:33:02.871 INFO: Java 11.0.14.1 Eclipse Adoptium (64-bit)
14:33:02.871 INFO: Mac OS X 10.15.7 x86_64
14:33:03.043 DEBUG: keyStore is :
14:33:03.043 DEBUG: keyStore type is : pkcs12
14:33:03.044 DEBUG: keyStore provider is :
14:33:03.044 DEBUG: init keystore
14:33:03.044 DEBUG: init keymanager of type SunX509
14:33:03.182 DEBUG: Create: /Users/user/.sonar/cache
14:33:03.183 INFO: User cache: /Users/user/.sonar/cache
14:33:03.183 DEBUG: Create: /Users/user/.sonar/cache/_tmp
14:33:03.185 DEBUG: Extract sonar-scanner-api-batch in temp...
14:33:03.189 DEBUG: Get bootstrap index...
14:33:03.189 DEBUG: Download: https://codeanalysis.teat.com/batch/index
14:33:03.555 DEBUG: Get bootstrap completed
14:33:03.560 DEBUG: Download https://codeanalysis.teat.com/batch/file?name=sonar-scanner-engine-shaded-8.9.1.44547-all.jar to /Users/user/.sonar/cache/_tmp/fileCache4937569030361501711.tmp
14:33:11.799 INFO: ------------------------------------------------------------------------
14:33:11.799 INFO: EXECUTION FAILURE
14:33:11.799 INFO: ------------------------------------------------------------------------
14:33:11.799 INFO: Total time: 8.986s
14:33:11.811 INFO: Final Memory: 4M/24M
14:33:11.811 INFO: ------------------------------------------------------------------------
14:33:11.811 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(IsolatedLauncherFactory.java:85)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher(IsolatedLauncherFactory.java:74)
at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher(IsolatedLauncherFactory.java:70)
at org.sonarsource.scanner.api.EmbeddedScanner.doStart(EmbeddedScanner.java:185)
at org.sonarsource.scanner.api.EmbeddedScanner.start(EmbeddedScanner.java:123)
at org.sonarsource.scanner.cli.Main.execute(Main.java:73)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: java.lang.IllegalStateException: Fail to download sonar-scanner-engine-shaded-8.9.1.44547-all.jar to /Users/user/.sonar/cache/_tmp/fileCache4937569030361501711.tmp
at org.sonarsource.scanner.api.internal.cache.FileCache.download(FileCache.java:100)
at org.sonarsource.scanner.api.internal.cache.FileCache.get(FileCache.java:84)
at org.sonarsource.scanner.api.internal.JarDownloader.lambda$getScannerEngineFiles$0(JarDownloader.java:60)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.base/java.util.stream.ReferencePipeline.collect(Unknown Source)
at org.sonarsource.scanner.api.internal.JarDownloader.getScannerEngineFiles(JarDownloader.java:61)
at org.sonarsource.scanner.api.internal.JarDownloader.download(JarDownloader.java:53)
at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.lambda$createLauncher$0(IsolatedLauncherFactory.java:76)
... 7 more
Caused by: org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http2.StreamResetException: stream was reset: NO_ERROR
at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http2.Http2Stream$FramingSource.read(Http2Stream.java:384)
at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.connection.Exchange$ResponseBodySource.read(Exchange.java:286)
at org.sonarsource.scanner.api.internal.shaded.okio.RealBufferedSource$1.read(RealBufferedSource.java:447)
at java.base/java.io.InputStream.transferTo(Unknown Source)
at java.base/java.nio.file.Files.copy(Unknown Source)
at org.sonarsource.scanner.api.internal.ServerConnection.downloadFile(ServerConnection.java:82)
at org.sonarsource.scanner.api.internal.JarDownloader$ScannerFileDownloader.download(JarDownloader.java:73)
at org.sonarsource.scanner.api.internal.cache.FileCache.download(FileCache.java:98)
... 19 more

Related

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.

Getting error while run sonar-scanner: java.lang.NoClassDefFoundError: org/sonar/batch/bootstrapper/LogOutput$Level

sonar-scanner -X
19:49:25.192 INFO: Scanner configuration file: /usr/local/Cellar/sonar-scanner/3.1.0.1141/libexec/conf/sonar-scanner.properties
19:49:25.211 INFO: SonarQube Scanner 3.1.0.1141
19:49:25.212 INFO: Java 1.8.0_131 Oracle Corporation (64-bit)
19:49:25.212 INFO: Mac OS X 10.13 x86_64
19:49:25.363 DEBUG: keyStore is :
19:49:25.363 DEBUG: keyStore type is : jks
19:49:25.363 DEBUG: keyStore provider is :
19:49:25.589 DEBUG: Create isolated classloader...
19:49:25.597 DEBUG: Start temp cleaning...
19:49:25.607 DEBUG: Temp cleaning done
19:49:25.607 DEBUG: Execution getVersion
List item
19:49:25.623 INFO: EXECUTION FAILURE
19:49:25.623 INFO: ------------------------------------------------------------------------
19:49:25.623 INFO: Total time: 0.452s
19:49:25.648 INFO: Final Memory: 4M/123M
19:49:25.648 INFO: ------------------------------------------------------------------------
19:49:25.648 ERROR: Error during SonarQube Scanner execution
java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError: org/sonar/batch/bootstrapper/LogOutput$Level
at org.sonarsource.scanner.api.internal.batch.DefaultBatchFactory.createBatch(DefaultBatchFactory.java:35)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
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:171)
at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:128)
at org.sonarsource.scanner.cli.Main.execute(Main.java:111)
at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: java.lang.NoClassDefFoundError: org/sonar/batch/bootstrapper/LogOutput$Level
... 13 more
Caused by: java.lang.ClassNotFoundException: org.sonar.batch.bootstrapper.LogOutput$Level
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at org.sonarsource.scanner.api.internal.IsolatedClassloader.loadClass(IsolatedClassloader.java:82)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 13 more
SonarQube Scanner 3.1.0.1141 (19:49:25.211 INFO: SonarQube Scanner 3.1.0.1141) is compatible with SonarQube 5.6+ (LTS) (read more here). You have SonarQube server 5.0.1 (19:49:25.610 INFO: SonarQube server 5.0.1) so those two tools are incompatible (class org/sonar/batch/bootstrapper/LogOutput$Level has been added in 5.2).
You can:
use an older version of the scanner (download sonar-runner 2.4 - read about runner vs scanner)
upgrade SonarQube server to at least 5.6

SonarQube scanner can't connect to server

I faced the issue with the sonar-scanner-cli which can't connect to the SonarQube server. Scan is run from within the docker container. Docker connects to SonarQube server through proxy so I thought that it was the issue but I tried to set proxy environment variables and also pass proxy parameters to the scanner. That didn't help. Also other binaries like yum or gradle can connect to external repos without problem from the same container.
SonarQube server version: 6.7.0.33306.
13:12:28.858 INFO: Scanner configuration file: /home/jenkins/tools/hudson.plugins.sonar.SonarRunnerInstallation/SonarQube_2.8/sonar-scanner-2.8/conf/sonar-scanner.properties
13:12:28.869 INFO: Project root configuration file: NONE
13:12:28.937 INFO: SonarQube Scanner 2.8
13:12:28.937 INFO: Java 1.8.0_151 Oracle Corporation (64-bit)
13:12:28.937 INFO: Linux
3.10.0-693.2.2.el7.x86_64 amd64
13:12:29.854 DEBUG: keyStore is :
13:12:29.854 DEBUG: keyStore type is : jks
13:12:29.854 DEBUG: keyStore provider is :
13:12:29.854 DEBUG: init keystore
13:12:29.854 DEBUG: init keymanager of type SunX509
13:12:30.067 DEBUG: Create : /home/jenkins/.sonar/cache
13:12:30.074 INFO: User cache: /home/jenkins/.sonar/cache
13:12:30.074 DEBUG: Create : /home/jenkins/.sonar/cache/_tmp
13:12:30.075 DEBUG: Extract sonar-scanner-api-batch in temp...
13:12:30.088 DEBUG: Get bootstrap index...
13:12:30.089 DEBUG: Download: https://hostname/batch_bootstrap/index
13:12:30.133 ERROR: SonarQube server [https://hostname] can not be reached
13:12:30.133 INFO:
------------------------------------------------------------------------
13:12:30.133 INFO: EXECUTION FAILURE
13:12:30.134 INFO:
------------------------------------------------------------------------
13:12:30.134 INFO: Total time: 1.342s
13:12:30.153 INFO: Final Memory: 4M/148M
13:12:30.154 INFO:
------------------------------------------------------------------------
13:12:30.154 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.net.ConnectException: Failed to connect to hostname/IP:443
at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.io.RealConnection.connectSocket(RealConnection.java:187)
at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.io.RealConnection.buildConnection(RealConnection.java:170)
at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.io.RealConnection.connect(RealConnection.java:111)
at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:187)
at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:123)
at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:93)
at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:296)
at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:248)
at org.sonarsource.scanner.api.internal.shaded.okhttp.RealCall.getResponse(RealCall.java:243)
at org.sonarsource.scanner.api.internal.shaded.okhttp.RealCall$ApplicationInterceptorChain.proceed(RealCall.java:201)
at org.sonarsource.scanner.api.internal.shaded.okhttp.RealCall.getResponseWithInterceptorChain(RealCall.java:163)
at org.sonarsource.scanner.api.internal.shaded.okhttp.RealCall.execute(RealCall.java:57)
at org.sonarsource.scanner.api.internal.ServerConnection.callUrl(ServerConnection.java:113)
at org.sonarsource.scanner.api.internal.ServerConnection.downloadString(ServerConnection.java:98)
at org.sonarsource.scanner.api.internal.Jars.downloadFiles(Jars.java:78)
... 11 more
I think you should verify your firewall. In most systems, port 9000 is not open and it is a common source of failure.

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.

Debugging Sonar Qube plugin

Following the guide at http://docs.sonarqube.org/display/DEV/Debugging, I have encounter an issue where the sonar-runner appears to be looking in the wrong place for the sonar-project.properties file.
This happens when I try to debug with Intellij.
Can anyone help?
Thanks
Matt
I get the following error:
SONAR_RUNNER_OPTS=-Xdebug -Xnoagent -Duser.dir=c:\dev\eci -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
INFO: Error stacktraces are turned on.
ERROR: homekey=runner.home
ERROR: homrelativePathFromHom=conf/sonar-runner.properties
ERROR: settingsKey=runner.settings
INFO: Runner configuration file: C:\Sonar\sonar-runner-2.4\conf\sonar- runner.properties
ERROR: homekey=project.home
ERROR: homrelativePathFromHom=sonar-project.properties
ERROR: settingsKey=project.settings
INFO: Project configuration file: NONE
INFO: Default locale: "en_AU", source code encoding: "windows-1252" (analysis is platform dependent)
INFO: Work directory: c:\dev\eci\.\.sonar
INFO: SonarQube Server 5.1.1
17:30:39.333 INFO - Load global repositories
17:30:39.340 DEBUG - Download: http://localhost:9000/batch/global (no proxy)
17:30:39.490 INFO - Load global repositories (done) | time=159ms
17:30:39.492 INFO - Server id: 20150731104939
17:30:39.493 INFO - User cache: C:\Users\matthewo\.sonar\cache
17:30:39.499 INFO - Install plugins
17:30:39.499 DEBUG - Download index of plugins
17:30:39.499 DEBUG - Download: http://localhost:9000/deploy/plugins/index.txt (no proxy)
17:30:39.585 DEBUG - Loaded 2138 properties from l10n bundles
17:30:39.585 INFO - Install JDBC driver
17:30:39.585 DEBUG - Download index of jdbc-driver
17:30:39.585 DEBUG - Download: http://localhost:9000/deploy/jdbc-driver.txt (no proxy)
17:30:39.592 INFO - Create JDBC datasource for jdbc:jtds:sqlserver://localhost:1433/Sonar;instance=MSSQL2012;SelectMethod=Curso r
17:31:03.765 DEBUG - Testing JDBC connection
17:31:04.351 DEBUG - Download: http://localhost:9000/api/server (no proxy)
17:31:04.368 INFO - Initializing Hibernate
17:31:04.370 DEBUG - hibernate.generate_statistics: false
17:31:04.370 DEBUG - hibernate.dialect: org.sonar.core.persistence.dialect.MsSql$MsSqlDialect
17:31:04.370 DEBUG - hibernate.connection.provider_class: org.sonar.jpa.session.CustomHibernateConnectionProvider
INFO: ---------------------------------------------------------------------- --
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 26.253s
Final Memory: 66M/340M
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: java.lang.IllegalStateException: You must define the following mandatory properties for 'Unknown': sonar.projectKey, sonar.projectName, sonar.projectVersion, sonar.sources
at org.sonar.batch.scan.ProjectReactorBuilder.checkMandatoryProperties(ProjectReact orBuilder.java:315)
at org.sonar.batch.scan.ProjectReactorBuilder.defineRootProject(ProjectReactorBuild er.java:157)
at org.sonar.batch.scan.ProjectReactorBuilder.execute(ProjectReactorBuilder.java:116)
at org.sonar.batch.scan.ProjectScanContainer.projectBootstrap(ProjectScanContainer.java:110)
at org.sonar.batch.scan.ProjectScanContainer.doBeforeStart(ProjectScanContainer.java:86)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:90)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:57)
at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:45)
at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:135)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:158)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:95)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
... 9 more
Is there any way to set the working directory, so sonar-runner finds the project properties in the correct location - where I am executing the command from?
Thanks
Matt
Why are you trying to update the user directory? Try to remove -Duser.dir=c:\dev\eci from SONAR_RUNNER_OPTS

Resources