ERROR: Error during SonarQube Scanner execution - SonarQube Scanner CLI - VSTS v3.0.2

661 views
Skip to first unread message

bha...@gmail.com

unread,
Dec 7, 2017, 5:53:10 AM12/7/17
to SonarQube
Hi,
I am having an issue when running the VSTS extension for CI for SQL files in a folder. (seems like it fails to upload Analysis reports files to sonarcloud)

2017-12-07T10:40:12.0797915Z ##[section]Starting: Perform a SonarQube analysis
2017-12-07T10:40:12.0797915Z ==============================================================================
2017-12-07T10:40:12.0797915Z Task : SonarQube Scanner CLI
2017-12-07T10:40:12.0797915Z Description : Perform a SonarQube analysis of the source code of your PHP, JavaScript... projects
2017-12-07T10:40:12.0797915Z Version : 3.0.2
2017-12-07T10:40:12.0797915Z Author : sonarsource
2017-12-07T10:40:12.0797915Z Help : Version: 3.0.2. [More Information](http://redirect.sonarsource.com/doc/install-configure-scanner-tfs-ts.html)
2017-12-07T10:40:12.0797915Z ==============================================================================
.
.
.
2017-12-07T10:40:40.4874873Z INFO: 328/328 source files have been analyzed
2017-12-07T10:40:40.4874873Z INFO: Sensor PL/SQL Sensor [plsql] (done) | time=19408ms
2017-12-07T10:40:40.4874873Z INFO: Sensor SonarJavaXmlFileSensor [java]
2017-12-07T10:40:40.4874873Z INFO: Sensor SonarJavaXmlFileSensor [java] (done) | time=15ms
2017-12-07T10:40:40.4874873Z INFO: Sensor Analyzer for "php.ini" files [php]
2017-12-07T10:40:40.4874873Z INFO: Sensor Analyzer for "php.ini" files [php] (done) | time=0ms
2017-12-07T10:40:40.4874873Z INFO: Sensor Zero Coverage Sensor
2017-12-07T10:40:40.5968676Z INFO: Sensor Zero Coverage Sensor (done) | time=94ms
2017-12-07T10:40:40.5968676Z INFO: Sensor CPD Block Indexer
2017-12-07T10:40:40.5968676Z INFO: Sensor CPD Block Indexer (done) | time=0ms
2017-12-07T10:40:40.5968676Z INFO: No SCM system was detected. You can use the 'sonar.scm.provider' property to explicitly specify it.
2017-12-07T10:40:40.5968676Z INFO: 50 files had no CPD blocks
2017-12-07T10:40:40.5968676Z INFO: Calculating CPD for 278 files
2017-12-07T10:40:41.1437698Z INFO: CPD calculation finished
2017-12-07T10:40:45.0814644Z INFO: Analysis report generated in 3922ms, dir size=7 MB
2017-12-07T10:40:46.1752947Z INFO: Analysis reports compressed in 1094ms, zip size=1 MB
2017-12-07T10:40:47.2846989Z INFO: ------------------------------------------------------------------------
2017-12-07T10:40:47.2846989Z INFO: EXECUTION FAILURE
2017-12-07T10:40:47.2846989Z INFO: ------------------------------------------------------------------------
2017-12-07T10:40:47.2846989Z INFO: Total time: 34.112s
2017-12-07T10:40:47.3940831Z INFO: Final Memory: 74M/1066M
2017-12-07T10:40:47.3940831Z INFO: ------------------------------------------------------------------------
2017-12-07T10:40:47.3940831Z ##[error]ERROR: Error during SonarQube Scanner execution
2017-12-07T10:40:47.3940831Z ##[error]ERROR: Insufficient privileges
2017-12-07T10:40:47.3940831Z ##[error]ERROR:
2017-12-07T10:40:47.3940831Z ##[error]ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
2017-12-07T10:40:47.5034876Z ##[error]System.Exception: Unexpected exit code received from batch file: 1
2017-12-07T10:40:47.5034876Z at Microsoft.TeamFoundation.DistributedTask.Task.Internal.InvokeBatchScriptCmdlet.ProcessRecord()
2017-12-07T10:40:47.5034876Z at System.Management.Automation.CommandProcessor.ProcessRecord()
2017-12-07T10:40:47.5347123Z ##[error]PowerShell script completed with 1 errors.
2017-12-07T10:40:47.5347123Z ##[section]Finishing: Perform a SonarQube analysis

Thanks in advance,
Bhagvan 

Fabrice Bellingard

unread,
Dec 7, 2017, 10:20:04 AM12/7/17
to bha...@gmail.com, SonarQube
Hi Bhagvan,

you typically get this error when you try to push the analysis on a project that already exists on SonarCloud, or when you forgot to specify the organization you want to push to.

Can you tell me what values you specify for "sonar.projectKey" and "sonar.organization"?


Best regards,
Fabrice Bellingard | SonarSource
SonarQube & SonarCloud Product Manager
https://sonarsource.com

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/f5bcfdf4-7c2d-430c-bf05-5fc902577918%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bhagvan

unread,
Dec 7, 2017, 11:17:48 AM12/7/17
to Fabrice Bellingard, SonarQube
Hi Fabrice,
Thanks for the reply, i have tried it on a couple of projects novitas (empty) and pbweb (has msbuild results).

I had no issues when i tried the MSBuild version of it, just the scanner CLI is having some issues.

Thanks,
Bhagvan

Bhagvan

unread,
Dec 7, 2017, 3:30:52 PM12/7/17
to Fabrice Bellingard, SonarQube
Hi Fabrice,
I enabled the debug log option and noticed that the scanner cli scripts misses the organisation when submitting report to cloud

POST 403 https://sonarcloud.io/api/ce/submit?projectKey=novitas&projectName=novitas | time=578ms -- this is from scanner cli which errors out
POST 200 https://sonarcloud.io/api/ce/submit?organization=pbweb&projectKey=PbWeb&projectName=Pbweb | time=2242ms -- this is from msbuild which works fine

Bhagvan

On Thu, Dec 7, 2017 at 8:17 AM, Bhagvan <bha...@gmail.com> wrote:
Hi Fabrice,
Thanks for the reply, i have tried it on a couple of projects novitas (empty) and pbweb (has msbuild results).

I had no issues when i tried the MSBuild version of it, just the scanner CLI is having some issues.

Thanks,
Bhagvan

bha...@gmail.com

unread,
Dec 7, 2017, 3:45:59 PM12/7/17
to SonarQube
ok seems like it is a bug in scanner cli powershell scripts in VSTS extension package ... i modified the powershell scripts to include the organisation key and it works fine

Fabrice Bellingard

unread,
Dec 8, 2017, 3:19:12 AM12/8/17
to bha...@gmail.com, SonarQube
Hi Bhagvan,

When using the Scanner CLI on VSTS, the task indeed does not allow to pass the organization through one of its parameter. Still, you can set it in the "sonar-project.properties" file that you can store in your SCM.

This is something that we are currently working on to make it far clearer and simpler when using VSTS with SonarCloud.

Thanks for your feedback Bhagvan!

Best regards,
Fabrice Bellingard | SonarSource
SonarQube & SonarCloud Product Manager
https://sonarsource.com
On Thu, Dec 7, 2017 at 9:45 PM, <bha...@gmail.com> wrote:
ok seems like it is a bug in scanner cli powershell scripts in VSTS extension package ... i modified the powershell scripts to include the organisation key and it works fine

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages