声纳 "Insufficient privileges"
SonarQube "Insufficient privileges"
自更新到 5.x 以来,由于 "Insufficient privileges" 问题,目前我们的许多构建作业都失败了。如 here 中所述,该问题应在 SonarQube 5.1 中得到修复,但实际上并未修复,或者存在与我们目前 运行 SonarQube 5.1.1.[=13= 相同错误的另一个问题]
这是错误消息的示例:
08:27:13 [ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project server: Fail to decorate 'org.sonar.api.resources.File@b77a66[key=src/main/java/ch/ti8m/security/hwtoken/server/services/impl/TOTPAlgorithm.java,path=src/main/java/ch/ti8m/security/hwtoken/server/services/impl/TOTPAlgorithm.java,filename=TOTPAlgorithm.java,language=Java]': Insufficient privileges -> [Help 1]
08:27:13 org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project server: Fail to decorate 'org.sonar.api.resources.File@b77a66[key=src/main/java/ch/ti8m/security/hwtoken/server/services/impl/TOTPAlgorithm.java,path=src/main/java/ch/ti8m/security/hwtoken/server/services/impl/TOTPAlgorithm.java,filename=TOTPAlgorithm.java,language=Java]'
08:27:13 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
08:27:13 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
08:27:13 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
08:27:13 at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
08:27:13 at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
08:27:13 at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
08:27:13 at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
08:27:13 at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
08:27:13 at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
08:27:13 at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
08:27:13 at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
08:27:13 at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
08:27:13 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
08:27:13 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
08:27:13 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
08:27:13 at java.lang.reflect.Method.invoke(Method.java:606)
08:27:13 at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
08:27:13 at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
08:27:13 at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
08:27:13 at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
08:27:13 Caused by: org.apache.maven.plugin.MojoExecutionException: Fail to decorate 'org.sonar.api.resources.File@b77a66[key=src/main/java/ch/ti8m/security/hwtoken/server/services/impl/TOTPAlgorithm.java,path=src/main/java/ch/ti8m/security/hwtoken/server/services/impl/TOTPAlgorithm.java,filename=TOTPAlgorithm.java,language=Java]'
08:27:13 at org.codehaus.mojo.sonar.bootstrap.ExceptionHandling.handle(ExceptionHandling.java:41)
08:27:13 at org.codehaus.mojo.sonar.bootstrap.RunnerBootstraper.execute(RunnerBootstraper.java:139)
08:27:13 at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:132)
08:27:13 at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
08:27:13 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
08:27:13 ... 19 more
08:27:13 Caused by: org.sonar.api.utils.SonarException: Fail to decorate 'org.sonar.api.resources.File@b77a66[key=src/main/java/ch/ti8m/security/hwtoken/server/services/impl/TOTPAlgorithm.java,path=src/main/java/ch/ti8m/security/hwtoken/server/services/impl/TOTPAlgorithm.java,filename=TOTPAlgorithm.java,language=Java]'
08:27:13 at org.sonar.batch.phases.DecoratorsExecutor.executeDecorator(DecoratorsExecutor.java:104)
08:27:13 at org.sonar.batch.phases.DecoratorsExecutor.decorateResource(DecoratorsExecutor.java:87)
08:27:13 at org.sonar.batch.phases.DecoratorsExecutor.decorateResource(DecoratorsExecutor.java:79)
08:27:13 at org.sonar.batch.phases.DecoratorsExecutor.decorateResource(DecoratorsExecutor.java:79)
08:27:13 at org.sonar.batch.phases.DecoratorsExecutor.execute(DecoratorsExecutor.java:71)
08:27:13 at org.sonar.batch.phases.DatabaseModePhaseExecutor.execute(DatabaseModePhaseExecutor.java:127)
08:27:13 at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:264)
08:27:13 at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
08:27:13 at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
08:27:13 at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:235)
08:27:13 at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:230)
08:27:13 at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:228)
08:27:13 at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:220)
08:27:13 at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
08:27:13 at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
08:27:13 at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:57)
08:27:13 at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:45)
08:27:13 at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:135)
08:27:13 at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
08:27:13 at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
08:27:13 at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:158)
08:27:13 at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:95)
08:27:13 at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
08:27:13 at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
08:27:13 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
08:27:13 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
08:27:13 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
08:27:13 at java.lang.reflect.Method.invoke(Method.java:606)
08:27:13 at org.sonar.runner.impl.BatchLauncher.delegateExecution(BatchLauncher.java:87)
08:27:13 at org.sonar.runner.impl.BatchLauncher.run(BatchLauncher.java:75)
08:27:13 at java.security.AccessController.doPrivileged(Native Method)
08:27:13 at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
08:27:13 at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
08:27:13 at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
08:27:13 at org.sonar.runner.api.Runner.execute(Runner.java:100)
08:27:13 at org.codehaus.mojo.sonar.bootstrap.RunnerBootstraper.execute(RunnerBootstraper.java:135)
08:27:13 ... 22 more
08:27:13 Caused by: java.lang.IllegalStateException: Insufficient privileges
08:27:13 at org.sonar.batch.bootstrap.ServerClient.handleHttpException(ServerClient.java:137)
08:27:13 at org.sonar.batch.bootstrap.ServerClient.request(ServerClient.java:107)
08:27:13 at org.sonar.batch.bootstrap.ServerClient.request(ServerClient.java:99)
08:27:13 at org.sonar.batch.bootstrap.ServerClient.request(ServerClient.java:87)
08:27:13 at org.sonar.batch.issue.tracking.DefaultServerLineHashesLoader.loadHashesFromWs(DefaultServerLineHashesLoader.java:47)
08:27:13 at org.sonar.batch.issue.tracking.DefaultServerLineHashesLoader.getLineHashes(DefaultServerLineHashesLoader.java:38)
08:27:13 at org.sonar.batch.issue.tracking.SourceHashHolder.initHashes(SourceHashHolder.java:52)
08:27:13 at org.sonar.batch.issue.tracking.SourceHashHolder.getHashedReference(SourceHashHolder.java:60)
08:27:13 at org.sonar.batch.issue.tracking.IssueTracking.mapIssues(IssueTracking.java:83)
08:27:13 at org.sonar.batch.issue.tracking.IssueTracking.track(IssueTracking.java:55)
08:27:13 at org.sonar.batch.issue.tracking.IssueTrackingDecorator.doDecorate(IssueTrackingDecorator.java:139)
08:27:13 at org.sonar.batch.issue.tracking.IssueTrackingDecorator.decorate(IssueTrackingDecorator.java:113)
08:27:13 at org.sonar.batch.phases.DecoratorsExecutor.executeDecorator(DecoratorsExecutor.java:96)
08:27:13 ... 57 more
08:27:13 [ERROR]
08:27:13 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
08:27:13 [ERROR]
08:27:13 [ERROR] For more information about the errors and possible solutions, please read the following articles:
08:27:13 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
08:27:13 SonarQube analysis completed: FAILURE
08:27:13 Build step 'SonarQube' changed build result to FAILURE
08:27:13 Build step 'SonarQube' marked build as failure
关于如何修复它有什么想法吗?向任何人授予权限的解决方法是 NoGo,因为整个系统必须遵守某些保密协议,因此访问受到限制。
运行分析的用户需要权限:
- 全球:
Execute Analysis
- 项目:
BROWSE
和 SEE SOURCE CODE
在 SonarQube 5.1.1.
上测试
在我的例子中,权限没问题。
然后我在sonar中搜索这个项目,发现:这个项目没有任何历史记录。
所以我想这个项目之前是在声纳中创建的。(可能是父 pom.xml 中的一个模型。然后从父 pom 中删除。)然后我删除了项目,然后再次 运行 声纳。一切正常
自更新到 5.x 以来,由于 "Insufficient privileges" 问题,目前我们的许多构建作业都失败了。如 here 中所述,该问题应在 SonarQube 5.1 中得到修复,但实际上并未修复,或者存在与我们目前 运行 SonarQube 5.1.1.[=13= 相同错误的另一个问题]
这是错误消息的示例:
08:27:13 [ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project server: Fail to decorate 'org.sonar.api.resources.File@b77a66[key=src/main/java/ch/ti8m/security/hwtoken/server/services/impl/TOTPAlgorithm.java,path=src/main/java/ch/ti8m/security/hwtoken/server/services/impl/TOTPAlgorithm.java,filename=TOTPAlgorithm.java,language=Java]': Insufficient privileges -> [Help 1]
08:27:13 org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project server: Fail to decorate 'org.sonar.api.resources.File@b77a66[key=src/main/java/ch/ti8m/security/hwtoken/server/services/impl/TOTPAlgorithm.java,path=src/main/java/ch/ti8m/security/hwtoken/server/services/impl/TOTPAlgorithm.java,filename=TOTPAlgorithm.java,language=Java]'
08:27:13 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
08:27:13 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
08:27:13 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
08:27:13 at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
08:27:13 at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
08:27:13 at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
08:27:13 at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
08:27:13 at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
08:27:13 at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
08:27:13 at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
08:27:13 at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
08:27:13 at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
08:27:13 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
08:27:13 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
08:27:13 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
08:27:13 at java.lang.reflect.Method.invoke(Method.java:606)
08:27:13 at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
08:27:13 at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
08:27:13 at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
08:27:13 at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
08:27:13 Caused by: org.apache.maven.plugin.MojoExecutionException: Fail to decorate 'org.sonar.api.resources.File@b77a66[key=src/main/java/ch/ti8m/security/hwtoken/server/services/impl/TOTPAlgorithm.java,path=src/main/java/ch/ti8m/security/hwtoken/server/services/impl/TOTPAlgorithm.java,filename=TOTPAlgorithm.java,language=Java]'
08:27:13 at org.codehaus.mojo.sonar.bootstrap.ExceptionHandling.handle(ExceptionHandling.java:41)
08:27:13 at org.codehaus.mojo.sonar.bootstrap.RunnerBootstraper.execute(RunnerBootstraper.java:139)
08:27:13 at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:132)
08:27:13 at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
08:27:13 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
08:27:13 ... 19 more
08:27:13 Caused by: org.sonar.api.utils.SonarException: Fail to decorate 'org.sonar.api.resources.File@b77a66[key=src/main/java/ch/ti8m/security/hwtoken/server/services/impl/TOTPAlgorithm.java,path=src/main/java/ch/ti8m/security/hwtoken/server/services/impl/TOTPAlgorithm.java,filename=TOTPAlgorithm.java,language=Java]'
08:27:13 at org.sonar.batch.phases.DecoratorsExecutor.executeDecorator(DecoratorsExecutor.java:104)
08:27:13 at org.sonar.batch.phases.DecoratorsExecutor.decorateResource(DecoratorsExecutor.java:87)
08:27:13 at org.sonar.batch.phases.DecoratorsExecutor.decorateResource(DecoratorsExecutor.java:79)
08:27:13 at org.sonar.batch.phases.DecoratorsExecutor.decorateResource(DecoratorsExecutor.java:79)
08:27:13 at org.sonar.batch.phases.DecoratorsExecutor.execute(DecoratorsExecutor.java:71)
08:27:13 at org.sonar.batch.phases.DatabaseModePhaseExecutor.execute(DatabaseModePhaseExecutor.java:127)
08:27:13 at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:264)
08:27:13 at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
08:27:13 at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
08:27:13 at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:235)
08:27:13 at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:230)
08:27:13 at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:228)
08:27:13 at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:220)
08:27:13 at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
08:27:13 at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
08:27:13 at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:57)
08:27:13 at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:45)
08:27:13 at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:135)
08:27:13 at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
08:27:13 at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
08:27:13 at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:158)
08:27:13 at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:95)
08:27:13 at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
08:27:13 at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
08:27:13 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
08:27:13 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
08:27:13 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
08:27:13 at java.lang.reflect.Method.invoke(Method.java:606)
08:27:13 at org.sonar.runner.impl.BatchLauncher.delegateExecution(BatchLauncher.java:87)
08:27:13 at org.sonar.runner.impl.BatchLauncher.run(BatchLauncher.java:75)
08:27:13 at java.security.AccessController.doPrivileged(Native Method)
08:27:13 at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
08:27:13 at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
08:27:13 at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
08:27:13 at org.sonar.runner.api.Runner.execute(Runner.java:100)
08:27:13 at org.codehaus.mojo.sonar.bootstrap.RunnerBootstraper.execute(RunnerBootstraper.java:135)
08:27:13 ... 22 more
08:27:13 Caused by: java.lang.IllegalStateException: Insufficient privileges
08:27:13 at org.sonar.batch.bootstrap.ServerClient.handleHttpException(ServerClient.java:137)
08:27:13 at org.sonar.batch.bootstrap.ServerClient.request(ServerClient.java:107)
08:27:13 at org.sonar.batch.bootstrap.ServerClient.request(ServerClient.java:99)
08:27:13 at org.sonar.batch.bootstrap.ServerClient.request(ServerClient.java:87)
08:27:13 at org.sonar.batch.issue.tracking.DefaultServerLineHashesLoader.loadHashesFromWs(DefaultServerLineHashesLoader.java:47)
08:27:13 at org.sonar.batch.issue.tracking.DefaultServerLineHashesLoader.getLineHashes(DefaultServerLineHashesLoader.java:38)
08:27:13 at org.sonar.batch.issue.tracking.SourceHashHolder.initHashes(SourceHashHolder.java:52)
08:27:13 at org.sonar.batch.issue.tracking.SourceHashHolder.getHashedReference(SourceHashHolder.java:60)
08:27:13 at org.sonar.batch.issue.tracking.IssueTracking.mapIssues(IssueTracking.java:83)
08:27:13 at org.sonar.batch.issue.tracking.IssueTracking.track(IssueTracking.java:55)
08:27:13 at org.sonar.batch.issue.tracking.IssueTrackingDecorator.doDecorate(IssueTrackingDecorator.java:139)
08:27:13 at org.sonar.batch.issue.tracking.IssueTrackingDecorator.decorate(IssueTrackingDecorator.java:113)
08:27:13 at org.sonar.batch.phases.DecoratorsExecutor.executeDecorator(DecoratorsExecutor.java:96)
08:27:13 ... 57 more
08:27:13 [ERROR]
08:27:13 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
08:27:13 [ERROR]
08:27:13 [ERROR] For more information about the errors and possible solutions, please read the following articles:
08:27:13 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
08:27:13 SonarQube analysis completed: FAILURE
08:27:13 Build step 'SonarQube' changed build result to FAILURE
08:27:13 Build step 'SonarQube' marked build as failure
关于如何修复它有什么想法吗?向任何人授予权限的解决方法是 NoGo,因为整个系统必须遵守某些保密协议,因此访问受到限制。
运行分析的用户需要权限:
- 全球:
Execute Analysis
- 项目:
BROWSE
和SEE SOURCE CODE
在 SonarQube 5.1.1.
上测试在我的例子中,权限没问题。
然后我在sonar中搜索这个项目,发现:这个项目没有任何历史记录。 所以我想这个项目之前是在声纳中创建的。(可能是父 pom.xml 中的一个模型。然后从父 pom 中删除。)然后我删除了项目,然后再次 运行 声纳。一切正常