1

I'm trying to setup SonarQube for my open source project but I've difficulties to automatize the process with my CI (AppVeyor).

SonarQube analysis failed with no more details except that I have to look at the log. But I don't know where to look at to find them. I've tried to do remote on the AppVeyor VM but I haven't anything relevant. Logs in the .sonarqube folder contain no more information that the one printed on the AppVeyor output.

Since it's the first time I tried to add SonarQube to a project, I have no clue where to look at. I've searched the error on internet without success.

Here is a part of the error I get on AppVeyor output:

[exec] 14:14:38.867 INFO: Analysis report generated in 421ms, dir size=436 KB
[exec] 14:14:39.012 INFO: Analysis reports compressed in 143ms, zip size=230 KB
[exec] 14:14:39.012 INFO: Analysis report generated in C:\projects\markify\src\.sonarqube\out\.sonar\scanner-report
[exec] 14:14:39.012 DEBUG: Upload report
[exec] 14:14:39.225 DEBUG: POST 403 https://sonarcloud.io/api/ce/submit?projectKey=Markify&projectName=Markify | time=212ms
[exec] 14:14:39.234 INFO: ------------------------------------------------------------------------
[exec] 14:14:39.234 INFO: EXECUTION FAILURE
[exec] ##teamcity[buildProblem description='Analysis Failed: Check Build Log']]
[exec] 14:14:39.234 INFO: ------------------------------------------------------------------------
[exec] 14:14:39.234 INFO: Total time: 35.907s
[exec] 14:14:39.324 ERROR: Error during SonarQube Scanner execution
[exec] 14:14:39.324 ERROR: Insufficient privileges
[exec] 14:14:39.324 ERROR: 
[exec] 14:14:39.324 ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
[exec] 14:14:39.323 INFO: Final Memory: 69M/168M
[exec] 14:14:39.324 INFO: ------------------------------------------------------------------------
[exec] 14:14:39.324 DEBUG: Execution getVersion
[exec] 14:14:39.325 DEBUG: Execution stop
[exec] Process returned exit code 1
[exec] The SonarQube Scanner did not complete successfully
[exec] 14:14:39.535  Creating a summary markdown file...
[exec] 14:14:39.537  Post-processing failed. Exit code: 1
[exec] [EndPhase] : Failed. Check Log
[exec] ##teamcity[buildProblem description='sonar-scanner return non 0 error code']]
[exec] [CxxSonarQubeMsbuidRunner] Failed analyze project, check log
BUILD FAILED

And here a build where the analysis has failed : https://ci.appveyor.com/project/Takumii/markify/build/1.0.501

The project can be found here : https://github.com/Julien-Pires/Markify/tree/sonarqube

I'm using NAnt to execute the Sonarqube analysis. All parameters used for Sonarqube can be found here: https://github.com/Julien-Pires/Markify/blob/sonarqube/default.build

agabrys
  • 8,728
  • 3
  • 35
  • 73
Julien Pires
  • 512
  • 7
  • 18

2 Answers2

0
 [exec] 14:14:39.324 ERROR: Error during SonarQube Scanner execution
 [exec] 14:14:39.324 ERROR: Insufficient privileges

This suggest a permission issue, as I detailed before in this answer. See "Authorization / Group" to check if you have the necessary permission to post a SonarQube analysis.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I've checked group permission for "Anyone" and "Members" no one had permission to Analyze nor create project. So, I have activated the permissions but it changes nothing. I've still the same error. I'm trying to upload analysis report to SonarCloud.io and not a private server. – Julien Pires Dec 27 '17 at 13:19
  • @JulienPires Is there any connectivity issue to sonarCloud.io? – VonC Dec 27 '17 at 16:10
  • No, SonarCloud.io connectivity seems ok. To test it I've tried to remove the login parameters and I get a different error stating that I haven't the right to access the server. I have no clue what is triggering the insufficent privileges. I have configured the group with access to everything. And the login used match with my account which is organization admin. – Julien Pires Dec 27 '17 at 21:16
  • @JulienPires Did you try the maven build with the -X option, just to see if the error callstack might give some clues? – VonC Dec 27 '17 at 21:18
  • I have already set the parameter sonar.verbose=true which seems to be equivalent of -X. – Julien Pires Dec 27 '17 at 22:45
0

Please sure that, you have necessary access rights to the sonarqube server where u are trying to post your analysis report.

Vighnesh Pai
  • 1,795
  • 1
  • 14
  • 38