SonarQube未能分析我的解决方案

时间:2017-12-27 10:09:32

标签: sonarqube static-analysis sonarcloud

我正在尝试为我的开源项目设置SonarQube,但我在使用CI(AppVeyor)自动化流程时遇到了困难。

SonarQube分析失败,没有更多细节,只是我必须查看日志。但我不知道在哪里可以找到它们。我试过在AppVeyor VM上做远程操作,但我没有任何相关的东西。 .sonarqube文件夹中的日志不包含AppVeyor输出上打印的信息。

由于这是我第一次尝试将SonarQube添加到项目中,我不知道在哪里查看。我在互联网上搜索错误没有成功。

以下是AppVeyor输出错误的一部分:

[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

这里是分析失败的构建:https://ci.appveyor.com/project/Takumii/markify/build/1.0.501

可在此处找到该项目:https://github.com/Julien-Pires/Markify/tree/sonarqube

我使用NAnt执行Sonarqube分析。可以在此处找到用于Sonarqube的所有参数:https://github.com/Julien-Pires/Markify/blob/sonarqube/default.build

2 个答案:

答案 0 :(得分:0)

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

这表明了权限问题,因为detailed before in this answer。 请参阅“Authorization / Group”以检查您是否具有发布SonarQube分析的必要权限。

答案 1 :(得分:0)

请确保您拥有对试图发布分析报告的sonarqube服务器的必要访问权限。