1

我正在尝试为我的开源项目设置 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

4

2 回答 2

0

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

于 2017-12-27T11:18:39.047 回答
0
 [exec] 14:14:39.324 ERROR: Error during SonarQube Scanner execution
 [exec] 14:14:39.324 ERROR: Insufficient privileges

正如我之前在此答案中详述的那样,这表明存在权限问题。请参阅“授权/组”以检查您是否具有发布 SonarQube 分析的必要权限。

于 2017-12-27T10:13:16.030 回答