gpt4 book ai didi

sonarqube - 执行 Sonarqube 分析时出错 "Insufficient privileges"

转载 作者:行者123 更新时间:2023-12-05 00:50:06 48 4
gpt4 key购买 nike

我正在尝试通过 sonarqube 分析 java 代码。我们在本地环境中创建了一个 Sonar 服务器,而不是使用 Sonar 云。

我尝试使用 Sonar maven 插件最初来自此链接 Sonar-Maven Plugin

但是,我遇到了“权限不足”错误。

[INFO] BUILD FAILURE [INFO]
------------------------------------------------------------------------ [INFO] Total time: 22.185 s [INFO] Finished at: 2017-09-18T13:04:47+10:00 [INFO] Final Memory: 64M/589M [INFO]
------------------------------------------------------------------------ [ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:
3.3.0.603:sonar (default-cli) on project testproject: Insufficient privileges -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o rg.sonarsource.scanner.maven:sonar-maven-plugin:3.3.0.603:sonar (default-cli) on project testproject: Insufficient privileges
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor .java:213)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor .java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor .java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje ct(LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje ct(LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThre adedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl eStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun cher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav a:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La uncher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java: 356) Caused by: org.apache.maven.plugin.MojoExecutionException: Insufficient privileg es
at org.sonarsource.scanner.maven.bootstrap.ExceptionHandling.handle(Exce ptionHandling.java:36)
at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute(S cannerBootstrapper.java:80)
at org.sonarsource.scanner.maven.SonarQubeMojo.execute(SonarQubeMojo.jav a:139)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default BuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor .java:208)
... 20 more Caused by: Insufficient privileges [ERROR] [ERROR] Re-run Maven using the -X switch to enable full debug logging.

然后我尝试使用 Sonar runner 进行分析,我再次遇到相同的“权限不足”错误。
13:01:41.145 DEBUG: Upload report
13:01:41.179 DEBUG: POST 403 http://myserver:9000/api/ce/submit?projectKey=
SampleProject&projectName=sampleprojectWrapper | time=34ms
13:01:41.208 INFO: -------------------------------------------------------------
-----------
13:01:41.209 INFO: EXECUTION FAILURE
13:01:41.209 INFO: -------------------------------------------------------------
-----------
13:01:41.211 INFO: Total time: 12.919s
13:01:41.412 INFO: Final Memory: 52M/320M
13:01:41.413 INFO: -------------------------------------------------------------
-----------
13:01:41.414 ERROR: Error during SonarQube Scanner execution
Insufficient privileges

然后我创建了一个新的 Sonarqube 服务器并重新运行,它运行良好。
我试图找出第一台服务器出了什么问题。服务器和项目的配置相同。

提前致谢。

最佳答案

this answer 中所述,检查您用于工作的 SonarQube 用户权限:

  • global : 执行分析
  • project :浏览并查看源代码

  • 默认情况下,这些可能位于您的新 SonarQube 服务器中。

    OP VVP确认 in the comments :

    Yes the problem was "Anyone" group was removed somehow and this prevented code from being pushed to SonarQube.



    查看更多 Sonarqube / Security / Authorization / Group .

    关于sonarqube - 执行 Sonarqube 分析时出错 "Insufficient privileges",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46271107/

    48 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com