SonarQube未能分析我的解决方案

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了SonarQube未能分析我的解决方案相关的知识,希望对你有一定的参考价值。

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

答案
 [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分析的必要权限。

另一答案

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

以上是关于SonarQube未能分析我的解决方案的主要内容,如果未能解决你的问题,请参考以下文章

解决未能加载文件或程序集“Newtonsoft.Json ...."或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。 (异常来自 HRESULT:0x80131040)(代码片段

SonarQube / AngularJS - 如何让 SonarQube 启动并运行以集成 / 分析我的 Angular 项目?

未针对 sonarqube 分析项目代码

TFS2017上的SonarQube分析计时器

SonarQub代码分析平台部署

使用 SonarQube 分析 Typescript