integrate SonarQube with jenkins - jenkins

im trying to integrate SonarQube with jenkins but im facing some errors
This is my analysis properties
sonar.projectBaseDir=/var/lib/jenkins/workspace/sonarqube
sonar.language=Java
#sonar.login=
sonar.projectVersion=1.0
sonar.sources=.
sonar.verbose=true
sonar.projectKey=sonarqube
sonar.host.url=http://x.xxx.xx.xxx:9000/
sonar.projectName=sonarqube
sonar.sourceEncoding=UTF-8
sonar.project.settings=/var/lib/jenkins/workspace/sonarqube/sonarqube-scanner/sonar-project.properties
sonar.analysis.mode=publish
sonar.buildbreaker.skip=true
It shows me this error msg
08:02:22.935 DEBUG: Extract sonar-scanner-api-batch in temp...
08:02:22.961 DEBUG: Get bootstrap index...
08:02:22.962 DEBUG: Download: http://x.xxx.xx.xxx:9000/batch/index
08:02:27.994 ERROR: SonarQube server [http://x.xxx.xx.xxx:9000/] can not be reached
08:02:27.994 INFO: ------------------------------------------------------------------------
08:02:27.994 INFO: EXECUTION FAILURE
08:02:27.994 INFO: ------------------------------------------------------------------------
08:02:27.995 INFO: Total time: 5.588s
08:02:28.020 INFO: Final Memory: 3M/56M
08:02:28.020 INFO: ------------------------------------------------------------------------
08:02:28.020 ERROR: Error during SonarScanner execution
org.sonarsource.scanner.api.internal.ScannerException: Unable to execute SonarScanner analysis
is there any suggestion for this problem?

Related

Error during SonarScanner execution in Mac OS for Swift language

I am trying to generate an report using Sonar Scanner in swift project.
I have SonarQube version: 9.2.4.50792 running on Mac OS Ventura 13.0.1
whenever I try to run these commands
`sonar-scanner
-Dsonar.projectKey=xyz
-Dsonar.sources=.
-Dsonar.host.url=https://sonarqube.mycompany.com
-Dsonar.login=123asd12`
it gives this error:
`INFO: SonarScanner 4.6.2.2472
INFO: Java 11.0.17 Alpine (64-bit)
INFO: Linux 5.15.49-linuxkit aarch64
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 2:30.223s
INFO: Final Memory: 5M/24M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
ERROR: Not authorized. Please check the properties sonar.login and sonar.password.
ERROR:
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.`

java.lang.IllegalStateException: Project home must be an existing directory

Please help me How to resolve this issue -
Getting Error while Sending Code from Jenkins to SonarQube.
git rev-list --no-walk 0070e5865725fdacc46d8444385e337eb9e6c4c8 # timeout=10
Unpacking https://repo1.maven.org/maven2/org/sonarsource/scanner/cli/sonar-scanner-cli/4.2.0.1873/sonar-scanner-cli-4.2.0.1873.zip to /jenkins/tools/hudson.plugins.sonar.SonarRunnerInstallation/ADOP_Sonar on 00a4ea1e
[Generali] $ /jenkins/tools/hudson.plugins.sonar.SonarRunnerInstallation/ADOP_Sonar/bin/sonar-scanner -X -Dsonar.host.url=https://alm.accenture.com/sonar -Dsonar.language=java "-Dsonar.projectName=Connected Vehicle Platform Sonar" -Dsonar.sourceEncoding=UTF-8 -Dsonar.projectKey=adop:CVPIFBNE:cvp -Dsonar.java.binaries=target/classes -Dsonar.sources=src/main/java -Dsonar.projectBaseDir=C:/Jenkins/workspace/Generali
14:30:02.030 INFO: Scanner configuration file: /jenkins/tools/hudson.plugins.sonar.SonarRunnerInstallation/ADOP_Sonar/conf/sonar-scanner.properties
14:30:02.038 INFO: Project root configuration file: NONE
14:30:02.147 INFO: SonarQube Scanner 4.2.0.1873
14:30:02.147 INFO: Java 9 Oracle Corporation (64-bit)
14:30:02.147 INFO: Linux 3.10.0-957.12.2.el7.x86_64 amd64
14:30:02.147 INFO: SONAR_SCANNER_OPTS=-Dsonar.login=04bcf7a2d5c6a5d44d9763fd840e723cbc85bb7e
14:30:02.641 DEBUG: keyStore is :
14:30:02.642 DEBUG: keyStore type is : pkcs12
14:30:02.642 DEBUG: keyStore provider is :
14:30:02.642 DEBUG: init keystore
14:30:02.643 DEBUG: init keymanager of type SunX509
14:30:02.897 DEBUG: Create: /root/.sonar/cache
14:30:02.899 INFO: User cache: /root/.sonar/cache
14:30:02.899 DEBUG: Create: /root/.sonar/cache/_tmp
14:30:02.904 DEBUG: Extract sonar-scanner-api-batch in temp...
14:30:02.911 DEBUG: Get bootstrap index...
14:30:02.911 DEBUG: Download: https://alm.accenture.com/sonar/batch/index
14:30:03.208 DEBUG: Get bootstrap completed
14:30:03.215 DEBUG: Download https://alm.accenture.com/sonar/batch/file?name=scanner-enterprise-7.9.1-all.jar to /root/.sonar/cache/_tmp/fileCache9893797395313049837.tmp
14:30:05.187 DEBUG: Create isolated classloader...
14:30:05.215 DEBUG: Start temp cleaning...
14:30:05.221 DEBUG: Temp cleaning done
14:30:05.222 DEBUG: Execution getVersion
14:30:05.237 INFO: SonarQube server 7.9.1
14:30:05.238 INFO: Default locale: "en", source code encoding: "UTF-8"
14:30:05.240 INFO: ------------------------------------------------------------------------
14:30:05.240 INFO: EXECUTION FAILURE
14:30:05.240 INFO: ------------------------------------------------------------------------
14:30:05.241 INFO: Total time: 3.298s
14:30:05.291 INFO: Final Memory: 3M/14M
14:30:05.291 INFO: ------------------------------------------------------------------------
14:30:05.291 ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: Project home must be an existing directory: /C:/Jenkins/workspace/Generali/C:/Jenkins/workspace/Generali
at org.sonarsource.scanner.api.Dirs.initProjectDirs(Dirs.java:51)
at org.sonarsource.scanner.api.Dirs.init(Dirs.java:41)
at org.sonarsource.scanner.api.EmbeddedScanner.initAnalysisProperties(EmbeddedScanner.java:158)
at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:137)
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)
WARN: Unable to locate 'report-task.txt' in the workspace. Did the SonarScanner succeeded?
ERROR: SonarQube scanner exited with non-zero code: 1
Finished: FAILURE
I had a similar issue:
ERROR: Error during SonarQube Scanner execution
ERROR: Project home must be an existing directory: C:\Windows\system32\config\...blah blah blah
I initially set my sonar.projectBaseDir by copying and pasting the path from File Explorer. The issue was Windows uses backslashes for paths. Once I switched them to forward slashes, the issue was fixed for me.

Sonarqube scan ends with "INFO: ANALYSIS SUCCESSFUL" but sonarqube UI says "Project is not analyzed yet."

I have a jenkins job that is triggered when a PR is made to a bitbucket repository. The job will run a sonarqube scan of the repository.
Then, I use sonarqube plugin called sonar-for-bitbucket that will make a PR comment summarizing the analysis.
This part happens successfully.
This is my sonarqube configuration in jenkins.
This is the console output
...
INFO: ANALYSIS SUCCESSFUL
INFO: Executing post-job Sonar Plug-in for Bitbucket Cloud
INFO: [sonar4bitbucket] Plug-in is active and will analyze pull request with #199...
INFO: Task total time: 1:25.408 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 1:27.292s
INFO: Final Memory: 64M/827M
INFO: ------------------------------------------------------------------------
WARN: Unable to locate 'report-task.txt' in the workspace. Did the SonarScanner succedeed?
Finished: SUCCESS
However, when I go to sonarqube UI it doesn't show any analysis result.
I also tried running this from my macbook with sonar-scanner. Got the same result.
INFO: ANALYSIS SUCCESSFUL
INFO: Task total time: 35.944 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 2:50.449s
INFO: Final Memory: 28M/813M
INFO: ------------------------------------------------------------------------

Run Code Analysis task for SonarQube Fails in TFS 2017 Build definition after upgrading to SonarQube 6.7.5

SonarQuber Version: 6.7.5 and
TFS - 2017 Update3
I am using SonarQube’s VSTS extensions to trigger the builds. I am building angular projects but the build definition is getting failed in Run Code Analysis task of Sonar.
Previously it used to work fine with SonarQube 5.6.6 but recently we upgraded the SonarQube to 6.7.5 in production and from then on wards the build started getting failed with the below error.
2018-11-21T13:26:26.4847112Z ##[error]ERROR: Error during SonarQube Scanner execution
2018-11-21T13:26:26.4847112Z ##[debug]Processed: ##vso[task.logissue type=error;]ERROR: Error during SonarQube Scanner execution
2018-11-21T13:26:26.4847112Z ##[debug]Processed: ERROR: Error during SonarQube Scanner execution##vso[task.logissue type=error;]
**2018-11-21T13:26:26.4847112Z **
2018-11-21T13:26:26.4847112Z ##[error]ERROR: Unable to register token in file src/app/areas/match-group/create-match-group/create-match-group.component.ts
Before we upgraded the SonarQube version in production to 6.7.5, I had tested the Build definition by pointing to it on Staging environment and it used to work there as well but after actual upgrade took place in production it started failing.
I think it is because the Quality gate is failing but I am not sure that really the Quality gate is failing because it is not mentioned in the log anywhere that Project does not pass the quality gate or it might be because of the Upgrade as well?
So can anyone please help me in resolving the issue?
Below is the complete log of Run Code Analysis task for Reference.
2018-11-21T13:26:04.1713599Z ##[debug]Evaluating condition for step: 'Run Code Analysis'
2018-11-21T13:26:04.1713599Z ##[debug]Evaluating: succeeded()
2018-11-21T13:26:04.1713599Z ##[debug]Evaluating succeeded:
2018-11-21T13:26:04.1713599Z ##[debug]=> (Boolean) True
2018-11-21T13:26:04.1713599Z ##[debug]Expanded: True
2018-11-21T13:26:04.1713599Z ##[debug]Result: True
2018-11-21T13:26:04.1713599Z ##[section]Starting: Run Code Analysis
2018-11-21T13:26:04.1713599Z ==============================================================================
2018-11-21T13:26:04.1713599Z Task : Run Code Analysis
2018-11-21T13:26:04.1713599Z Description : Run scanner and upload the results to the SonarQube server.
2018-11-21T13:26:04.1713599Z Version : 4.4.1
2018-11-21T13:26:04.1713599Z Author : sonarsource
2018-11-21T13:26:04.1713599Z Help : This task is not needed for Maven and Gradle projects since the scanner should be run as part of the build.
[More Information](http://redirect.sonarsource.com/doc/install-configure-scanner-tfs-ts.html)
2018-11-21T13:26:04.1713599Z ==============================================================================
2018-11-21T13:26:04.4369873Z ##[debug]agent.TempDirectory=F:\Builds\Sonar\_temp
2018-11-21T13:26:04.4369873Z ##[debug]loading inputs and endpoints
2018-11-21T13:26:04.4369873Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
2018-11-21T13:26:04.4369873Z ##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
2018-11-21T13:26:04.4369873Z ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
2018-11-21T13:26:04.4369873Z ##[debug]loading SECRET_SONARQUBE_ENDPOINT
2018-11-21T13:26:04.4369873Z ##[debug]loaded 4
2018-11-21T13:26:04.4526142Z ##[debug]Agent.ProxyUrl=undefined
2018-11-21T13:26:04.4526142Z ##[debug]Agent.CAInfo=undefined
2018-11-21T13:26:04.4526142Z ##[debug]Agent.ClientCert=undefined
2018-11-21T13:26:04.4526142Z ##[debug]Agent.SkipCertValidation=undefined
2018-11-21T13:26:04.5307416Z ##[debug]SONARQUBE_SCANNER_MODE=CLI
2018-11-21T13:26:04.5307416Z ##[debug]Absolute path for pathSegments: F:\Builds\Sonar\_tasks\SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055\4.4.1,sonar-scanner,bin,sonar-scanner = F:\Builds\Sonar\_tasks\SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055\4.4.1\sonar-scanner\bin\sonar-scanner
2018-11-21T13:26:04.5307416Z ##[debug]which 'F:\Builds\Sonar\_tasks\SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055\4.4.1\sonar-scanner\bin\sonar-scanner.bat'
2018-11-21T13:26:04.5307416Z ##[debug]found: 'F:\Builds\Sonar\_tasks\SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055\4.4.1\sonar-scanner\bin\sonar-scanner.bat'
2018-11-21T13:26:04.5307416Z ##[debug]which 'F:\Builds\Sonar\_tasks\SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055\4.4.1\sonar-scanner\bin\sonar-scanner.bat'
2018-11-21T13:26:04.5307416Z ##[debug]found: 'F:\Builds\Sonar\_tasks\SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055\4.4.1\sonar-scanner\bin\sonar-scanner.bat'
2018-11-21T13:26:04.5307416Z ##[debug]system.debug=True
2018-11-21T13:26:04.5307416Z ##[debug]exec tool: F:\Builds\Sonar\_tasks\SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055\4.4.1\sonar-scanner\bin\sonar-scanner.bat
2018-11-21T13:26:04.5307416Z ##[debug]arguments:
2018-11-21T13:26:04.5307416Z [command]C:\Windows\system32\cmd.exe /D /S /C "F:\Builds\Sonar\_tasks\SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055\4.4.1\sonar-scanner\bin\sonar-scanner.bat"
2018-11-21T13:26:04.7963804Z INFO: Scanner configuration file: F:\Builds\Sonar\_tasks\SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055\4.4.1\sonar-scanner\bin\..\conf\sonar-scanner.properties
2018-11-21T13:26:04.7963804Z INFO: Project root configuration file: NONE
2018-11-21T13:26:04.8276263Z INFO: SonarQube Scanner 3.2.0.1227
2018-11-21T13:26:04.8432500Z INFO: Java 1.8.0_172 Oracle Corporation (64-bit)
2018-11-21T13:26:04.8432500Z INFO: Windows Server 2016 10.0 amd64
2018-11-21T13:26:05.2184811Z INFO: User cache: C:\Users\svc_TFSservice\.sonar\cache
2018-11-21T13:26:05.6403612Z INFO: SonarQube server 6.7.5
2018-11-21T13:26:05.6403612Z INFO: Default locale: "en_US", source code encoding: "UTF-8"
2018-11-21T13:26:06.1403664Z INFO: Publish mode
2018-11-21T13:26:06.4059994Z INFO: Load global settings
2018-11-21T13:26:06.8122594Z INFO: Load global settings (done) | time=407ms
2018-11-21T13:26:06.8435246Z INFO: Server id: 98F64F5D-AWciJELiWXjIvPjAIE0y
2018-11-21T13:26:06.8591409Z INFO: User cache: C:\Users\svc_TFSservice\.sonar\cache
2018-11-21T13:26:07.0778908Z INFO: Load plugins index
2018-11-21T13:26:07.1716405Z INFO: Load plugins index (done) | time=94ms
2018-11-21T13:26:08.1247924Z INFO: Process project properties
2018-11-21T13:26:08.1247924Z INFO: Execute project builders
2018-11-21T13:26:08.1247924Z INFO: Execute project builders (done) | time=0ms
2018-11-21T13:26:08.1560423Z INFO: Load branch configuration
2018-11-21T13:26:08.1560423Z INFO: Load branch configuration (done) | time=0ms
2018-11-21T13:26:08.1560423Z INFO: Load project repositories
2018-11-21T13:26:08.2654212Z INFO: Load project repositories (done) | time=109ms
2018-11-21T13:26:08.4841842Z INFO: Load quality profiles
2018-11-21T13:26:08.5466788Z INFO: Load quality profiles (done) | time=62ms
2018-11-21T13:26:08.5623129Z INFO: Load active rules
2018-11-21T13:26:09.6406179Z INFO: Load active rules (done) | time=1078ms
2018-11-21T13:26:09.6406179Z INFO: Load metrics repository
2018-11-21T13:26:09.7030223Z INFO: Load metrics repository (done) | time=63ms
2018-11-21T13:26:09.7185915Z INFO: Project key: NextGenHTML5
2018-11-21T13:26:09.7185915Z INFO: ------------- Scan SNR-IM-NextGen-HTML5
2018-11-21T13:26:10.0008521Z INFO: Base dir: F:\Builds\Sonar\12\s
2018-11-21T13:26:10.0008521Z INFO: Working dir: F:\Builds\Sonar\12\s\.scannerwork
2018-11-21T13:26:10.0008521Z INFO: Source paths: src
2018-11-21T13:26:10.0008521Z INFO: Test paths: src
2018-11-21T13:26:10.0008521Z INFO: Source encoding: UTF-8, default locale: en_US
2018-11-21T13:26:10.1248422Z INFO: Load server rules
2018-11-21T13:26:10.4217641Z INFO: Load server rules (done) | time=297ms
2018-11-21T13:26:10.6404902Z INFO: Index files
2018-11-21T13:26:10.6404902Z INFO: Excluded sources:
2018-11-21T13:26:10.6404902Z INFO: **/node_modules/**
2018-11-21T13:26:10.6564588Z INFO: **/*.spec.ts
2018-11-21T13:26:10.6564588Z INFO: src/Tools/**
2018-11-21T13:26:10.6564588Z INFO: **/*.spec.ts
2018-11-21T13:26:10.6564588Z INFO: Included tests:
2018-11-21T13:26:10.6564588Z INFO: **/*.spec.ts
2018-11-21T13:26:10.9686205Z INFO: 188 files indexed
2018-11-21T13:26:10.9686205Z INFO: 212 files ignored because of inclusion/exclusion patterns
2018-11-21T13:26:10.9686205Z INFO: Quality profile for js: Sonar way Recommended
2018-11-21T13:26:10.9686205Z INFO: Quality profile for ts: TsLint
2018-11-21T13:26:10.9686205Z INFO: Quality profile for xml: Sonar way
2018-11-21T13:26:12.2655236Z INFO: Sensor JavaScript Squid Sensor [javascript]
2018-11-21T13:26:12.2655236Z INFO: 2 source files to be analyzed
2018-11-21T13:26:12.7030349Z INFO: Unit Test Coverage Sensor is started
2018-11-21T13:26:12.7030349Z INFO: 2/2 source files have been analyzed
2018-11-21T13:26:12.7030349Z INFO: Integration Test Coverage Sensor is started
2018-11-21T13:26:12.7030349Z INFO: Overall Coverage Sensor is started
2018-11-21T13:26:12.7030349Z INFO: Sensor JavaScript Squid Sensor [javascript] (done) | time=438ms
2018-11-21T13:26:12.7030349Z INFO: Sensor SonarJavaXmlFileSensor [java]
2018-11-21T13:26:12.7342853Z INFO: 1 source files to be analyzed
2018-11-21T13:26:12.7967860Z INFO: Sensor SonarJavaXmlFileSensor [java] (done) | time=93ms
2018-11-21T13:26:12.7967860Z INFO: Sensor XML Sensor [xml]
2018-11-21T13:26:12.7967860Z INFO: 1/1 source files have been analyzed
2018-11-21T13:26:13.2030475Z INFO: Sensor XML Sensor [xml] (done) | time=407ms
2018-11-21T13:26:13.2030475Z INFO: Sensor Analyzer for "php.ini" files [php]
2018-11-21T13:26:13.2186797Z INFO: Sensor Analyzer for "php.ini" files [php] (done) | time=15ms
2018-11-21T13:26:13.2186797Z INFO: Sensor TypeScript Sensor [typescript]
2018-11-21T13:26:26.3752598Z INFO: ------------------------------------------------------------------------
2018-11-21T13:26:26.3752598Z INFO: EXECUTION FAILURE
2018-11-21T13:26:26.3752598Z INFO: ------------------------------------------------------------------------
2018-11-21T13:26:26.3752598Z INFO: Total time: 21.595s
2018-11-21T13:26:26.4690128Z INFO: Final Memory: 19M/535M
2018-11-21T13:26:26.4690128Z INFO: ------------------------------------------------------------------------
2018-11-21T13:26:26.4847112Z ##[error]ERROR: Error during SonarQube Scanner execution
2018-11-21T13:26:26.4847112Z ##[debug]Processed: ##vso[task.logissue type=error;]ERROR: Error during SonarQube Scanner execution
2018-11-21T13:26:26.4847112Z ##[debug]Processed: ERROR: Error during SonarQube Scanner execution##vso[task.logissue type=error;]
2018-11-21T13:26:26.4847112Z
2018-11-21T13:26:26.4847112Z ##[error]ERROR: Unable to register token in file src/app/areas/match-group/create-match-group/create-match-group.component.ts
ERROR: Caused by: 59 is not a valid line offset for pointer. File src/app/areas/match-group/create-match-group/create-match-group.component.ts has 58 character(s) at line 1
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
2018-11-21T13:26:26.4847112Z ##[debug]Processed: ##vso[task.logissue type=error;]ERROR: Unable to register token in file src/app/areas/match-group/create-match-group/create-match-group.component.ts%0D%0AERROR: Caused by: 59 is not a valid line offset for pointer. File src/app/areas/match-group/create-match-group/create-match-group.component.ts has 58 character(s) at line 1%0D%0AERROR: %0D%0AERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
2018-11-21T13:26:26.4847112Z ERROR: Unable to register token in file src/app/areas/match-group/create-match-group/create-match-group.component.ts
2018-11-21T13:26:26.4847112Z ERROR: Caused by: 59 is not a valid line offset for pointer. File src/app/areas/match-group/create-match-group/create-match-group.component.ts has 58 character(s) at line 1
2018-11-21T13:26:26.4847112Z ERROR:
2018-11-21T13:26:26.4847112Z ##[debug]Processed: ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.##vso[task.logissue type=error;]
2018-11-21T13:26:26.4847112Z
2018-11-21T13:26:26.5627661Z ##[debug]rc:1
2018-11-21T13:26:26.5627661Z ##[debug]success:false
2018-11-21T13:26:26.5627661Z ##[debug]task result: Failed
2018-11-21T13:26:26.5627661Z ##[error]F:\Builds\Sonar\_tasks\SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055\4.4.1\sonar-scanner\bin\sonar-scanner.bat failed with return code: 1
2018-11-21T13:26:26.5627661Z ##[debug]Processed: ##vso[task.issue type=error;]F:\Builds\Sonar\_tasks\SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055\4.4.1\sonar-scanner\bin\sonar-scanner.bat failed with return code: 1
2018-11-21T13:26:26.5627661Z ##[debug]Processed: ##vso[task.complete result=Failed;]F:\Builds\Sonar\_tasks\SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055\4.4.1\sonar-scanner\bin\sonar-scanner.bat failed with return code: 1
2018-11-21T13:26:26.5802746Z ##[section]Finishing: Run Code Analysis
Regards,
SRP.

Report code coverage result from vsts to sonar

I have generate code coverage report from vsts and trying to report the result in sonar using arguments /d:sonar.cs.vscoveragexml.reportsPaths="C:\Agent\_work\1\s\TestResults\*\*\*\*.coverage but its throwing error
06:47:28.705 INFO - Sensor org.sonar.plugins.csharp.CSharpCodeCoverageProvider$CSharpCoverageReportImportSensor#4d437408
06:47:28.734 INFO - Parsing the Visual Studio coverage XML report C:\Agent\_work\1\s\TestResults\Priyanka_WINDOWSVM 2016-09-21 06_47_04\In\WINDOWSVM\Priyanka_WINDOWSVM 2016-09-21 06_46_46.coverage
06:47:28.878 DEBUG - Release semaphore on project : org.sonar.api.resources.Project#6b283550[id=213,key=MVCandWebApi,qualifier=TRK], with key batch-MVCandWebApi
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 13.942s
INFO: Final Memory: 24M/462M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: Error while parsing the XML file: C:\Agent\_work\1\s\TestResults\Priyanka_WINDOWSVM 2016-09-21 06_47_04\In\WINDOWSVM\Priyanka_WINDOWSVM 2016-09-21 06_46_46.coverage
at org.sonar.plugins.dotnet.tests.XmlParserHelper.nextStartTag(XmlParserHelper.java:74)
at org.sonar.plugins.dotnet.tests.XmlParserHelper.checkRootTag(XmlParserHelper.java:56)
at org.sonar.plugins.dotnet.tests.VisualStudioCoverageXmlReportParser$Parser.checkRootTag(VisualStudioCoverageXmlReportParser.java:121)
at org.sonar.plugins.dotnet.tests.VisualStudioCoverageXmlReportParser$Parser.parse(VisualStudioCoverageXmlReportParser.java:56)
at org.sonar.plugins.dotnet.tests.VisualStudioCoverageXmlReportParser.parse(VisualStudioCoverageXmlReportParser.java:37)
at org.sonar.plugins.dotnet.tests.CoverageCache.readCoverageFromCacheOrParse(CoverageCache.java:38)
at org.sonar.plugins.dotnet.tests.CoverageAggregator.aggregate(CoverageAggregator.java:107)
at org.sonar.plugins.dotnet.tests.CoverageAggregator.aggregate(CoverageAggregator.java:98)
at org.sonar.plugins.dotnet.tests.CoverageReportImportSensor.analyze(CoverageReportImportSensor.java:79)

Resources