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












1















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:BuildsSonar_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:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1,sonar-scanner,bin,sonar-scanner = F:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1sonar-scannerbinsonar-scanner
2018-11-21T13:26:04.5307416Z ##[debug]which 'F:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1sonar-scannerbinsonar-scanner.bat'
2018-11-21T13:26:04.5307416Z ##[debug]found: 'F:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1sonar-scannerbinsonar-scanner.bat'
2018-11-21T13:26:04.5307416Z ##[debug]which 'F:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1sonar-scannerbinsonar-scanner.bat'
2018-11-21T13:26:04.5307416Z ##[debug]found: 'F:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1sonar-scannerbinsonar-scanner.bat'
2018-11-21T13:26:04.5307416Z ##[debug]system.debug=True
2018-11-21T13:26:04.5307416Z ##[debug]exec tool: F:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1sonar-scannerbinsonar-scanner.bat
2018-11-21T13:26:04.5307416Z ##[debug]arguments:
2018-11-21T13:26:04.5307416Z [command]C:Windowssystem32cmd.exe /D /S /C "F:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1sonar-scannerbinsonar-scanner.bat"
2018-11-21T13:26:04.7963804Z INFO: Scanner configuration file: F:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1sonar-scannerbin..confsonar-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:Userssvc_TFSservice.sonarcache
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:Userssvc_TFSservice.sonarcache
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:BuildsSonar12s
2018-11-21T13:26:10.0008521Z INFO: Working dir: F:BuildsSonar12s.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:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1sonar-scannerbinsonar-scanner.bat failed with return code: 1
2018-11-21T13:26:26.5627661Z ##[debug]Processed: ##vso[task.issue type=error;]F:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1sonar-scannerbinsonar-scanner.bat failed with return code: 1
2018-11-21T13:26:26.5627661Z ##[debug]Processed: ##vso[task.complete result=Failed;]F:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1sonar-scannerbinsonar-scanner.bat failed with return code: 1
2018-11-21T13:26:26.5802746Z ##[section]Finishing: Run Code Analysis


Regards,



SRP.










share|improve this question



























    1















    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:BuildsSonar_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:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1,sonar-scanner,bin,sonar-scanner = F:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1sonar-scannerbinsonar-scanner
    2018-11-21T13:26:04.5307416Z ##[debug]which 'F:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1sonar-scannerbinsonar-scanner.bat'
    2018-11-21T13:26:04.5307416Z ##[debug]found: 'F:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1sonar-scannerbinsonar-scanner.bat'
    2018-11-21T13:26:04.5307416Z ##[debug]which 'F:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1sonar-scannerbinsonar-scanner.bat'
    2018-11-21T13:26:04.5307416Z ##[debug]found: 'F:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1sonar-scannerbinsonar-scanner.bat'
    2018-11-21T13:26:04.5307416Z ##[debug]system.debug=True
    2018-11-21T13:26:04.5307416Z ##[debug]exec tool: F:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1sonar-scannerbinsonar-scanner.bat
    2018-11-21T13:26:04.5307416Z ##[debug]arguments:
    2018-11-21T13:26:04.5307416Z [command]C:Windowssystem32cmd.exe /D /S /C "F:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1sonar-scannerbinsonar-scanner.bat"
    2018-11-21T13:26:04.7963804Z INFO: Scanner configuration file: F:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1sonar-scannerbin..confsonar-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:Userssvc_TFSservice.sonarcache
    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:Userssvc_TFSservice.sonarcache
    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:BuildsSonar12s
    2018-11-21T13:26:10.0008521Z INFO: Working dir: F:BuildsSonar12s.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:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1sonar-scannerbinsonar-scanner.bat failed with return code: 1
    2018-11-21T13:26:26.5627661Z ##[debug]Processed: ##vso[task.issue type=error;]F:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1sonar-scannerbinsonar-scanner.bat failed with return code: 1
    2018-11-21T13:26:26.5627661Z ##[debug]Processed: ##vso[task.complete result=Failed;]F:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1sonar-scannerbinsonar-scanner.bat failed with return code: 1
    2018-11-21T13:26:26.5802746Z ##[section]Finishing: Run Code Analysis


    Regards,



    SRP.










    share|improve this question

























      1












      1








      1








      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:BuildsSonar_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:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1,sonar-scanner,bin,sonar-scanner = F:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1sonar-scannerbinsonar-scanner
      2018-11-21T13:26:04.5307416Z ##[debug]which 'F:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1sonar-scannerbinsonar-scanner.bat'
      2018-11-21T13:26:04.5307416Z ##[debug]found: 'F:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1sonar-scannerbinsonar-scanner.bat'
      2018-11-21T13:26:04.5307416Z ##[debug]which 'F:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1sonar-scannerbinsonar-scanner.bat'
      2018-11-21T13:26:04.5307416Z ##[debug]found: 'F:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1sonar-scannerbinsonar-scanner.bat'
      2018-11-21T13:26:04.5307416Z ##[debug]system.debug=True
      2018-11-21T13:26:04.5307416Z ##[debug]exec tool: F:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1sonar-scannerbinsonar-scanner.bat
      2018-11-21T13:26:04.5307416Z ##[debug]arguments:
      2018-11-21T13:26:04.5307416Z [command]C:Windowssystem32cmd.exe /D /S /C "F:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1sonar-scannerbinsonar-scanner.bat"
      2018-11-21T13:26:04.7963804Z INFO: Scanner configuration file: F:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1sonar-scannerbin..confsonar-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:Userssvc_TFSservice.sonarcache
      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:Userssvc_TFSservice.sonarcache
      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:BuildsSonar12s
      2018-11-21T13:26:10.0008521Z INFO: Working dir: F:BuildsSonar12s.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:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1sonar-scannerbinsonar-scanner.bat failed with return code: 1
      2018-11-21T13:26:26.5627661Z ##[debug]Processed: ##vso[task.issue type=error;]F:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1sonar-scannerbinsonar-scanner.bat failed with return code: 1
      2018-11-21T13:26:26.5627661Z ##[debug]Processed: ##vso[task.complete result=Failed;]F:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1sonar-scannerbinsonar-scanner.bat failed with return code: 1
      2018-11-21T13:26:26.5802746Z ##[section]Finishing: Run Code Analysis


      Regards,



      SRP.










      share|improve this question














      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:BuildsSonar_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:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1,sonar-scanner,bin,sonar-scanner = F:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1sonar-scannerbinsonar-scanner
      2018-11-21T13:26:04.5307416Z ##[debug]which 'F:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1sonar-scannerbinsonar-scanner.bat'
      2018-11-21T13:26:04.5307416Z ##[debug]found: 'F:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1sonar-scannerbinsonar-scanner.bat'
      2018-11-21T13:26:04.5307416Z ##[debug]which 'F:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1sonar-scannerbinsonar-scanner.bat'
      2018-11-21T13:26:04.5307416Z ##[debug]found: 'F:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1sonar-scannerbinsonar-scanner.bat'
      2018-11-21T13:26:04.5307416Z ##[debug]system.debug=True
      2018-11-21T13:26:04.5307416Z ##[debug]exec tool: F:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1sonar-scannerbinsonar-scanner.bat
      2018-11-21T13:26:04.5307416Z ##[debug]arguments:
      2018-11-21T13:26:04.5307416Z [command]C:Windowssystem32cmd.exe /D /S /C "F:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1sonar-scannerbinsonar-scanner.bat"
      2018-11-21T13:26:04.7963804Z INFO: Scanner configuration file: F:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1sonar-scannerbin..confsonar-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:Userssvc_TFSservice.sonarcache
      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:Userssvc_TFSservice.sonarcache
      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:BuildsSonar12s
      2018-11-21T13:26:10.0008521Z INFO: Working dir: F:BuildsSonar12s.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:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1sonar-scannerbinsonar-scanner.bat failed with return code: 1
      2018-11-21T13:26:26.5627661Z ##[debug]Processed: ##vso[task.issue type=error;]F:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1sonar-scannerbinsonar-scanner.bat failed with return code: 1
      2018-11-21T13:26:26.5627661Z ##[debug]Processed: ##vso[task.complete result=Failed;]F:BuildsSonar_tasksSonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb380554.4.1sonar-scannerbinsonar-scanner.bat failed with return code: 1
      2018-11-21T13:26:26.5802746Z ##[section]Finishing: Run Code Analysis


      Regards,



      SRP.







      tfs sonarqube sonarqube-scan sonar-runner azure-pipelines-build-task






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 21 '18 at 16:11









      SRPSRP

      921214




      921214
























          0






          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53416175%2frun-code-analysis-task-for-sonarqube-fails-in-tfs-2017-build-definition-after-up%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53416175%2frun-code-analysis-task-for-sonarqube-fails-in-tfs-2017-build-definition-after-up%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Costa Masnaga

          Fotorealismo

          Sidney Franklin