声纳构建稳定性插件403错误

时间:2014-02-17 17:12:32

标签: jenkins sonarqube

我的配置是:SonarQube 4.0Build Stability 1.2Jenkins 1.549

我在项目级别配置了Build Stability插件(Configuration - > Settings):

  • 输入我的登录信息(这绝对是正确的)
  • 输入我的密码(这绝对是正确的)
  • 已输入CI网址:Jenkins:https://<host>/job/<job-name>/(其中<host><job-name>将替换为实际主机和实际工作名称)
  • 我的Sonar分析运行配置中指定了两个属性:-Dsonar.login=admin -Dsonar.password=admin(如here所述)。这些凭证绝对是正确的。

我可以通过Web界面和REST API访问此作业:https://<host>/job/<job-name>//lastBuild/api/xml/返回200.

但是当我进行声纳分析时,我得到了:

[INFO] [23:27:04.986] CI URL: Jenkins:https://<host>/job/<job-name>/
[ERROR] [23:27:06.017] Received 403 when trying to access https://<host>/job/<job-name>//lastBuild/api/xml/
org.sonar.api.utils.SonarException: Received 403 when trying to access https://<host>/job/<job-name>//lastBuild/api/xml/
at org.sonar.plugins.buildstability.ci.CiConnector.execute(CiConnector.java:132) ~[na:na]
at org.sonar.plugins.buildstability.ci.CiConnector.executeGet(CiConnector.java:120) ~[na:na]
at org.sonar.plugins.buildstability.ci.CiConnector.getLastBuild(CiConnector.java:68) ~[na:na]
at org.sonar.plugins.buildstability.ci.CiConnector.getBuildsSince(CiConnector.java:106) ~[na:na]
at org.sonar.plugins.buildstability.BuildStabilitySensor.analyse(BuildStabilitySensor.java:105) ~[na:na]
at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:72) [sonar-batch-4.0.jar:na]
at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:114) [sonar-batch-4.0.jar:na]
at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:150) [sonar-batch-4.0.jar:na]
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92) [sonar-plugin-api-4.0.jar:na]
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77) [sonar-plugin-api-4.0.jar:na]
at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:190) [sonar-batch-4.0.jar:na]
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:185) [sonar-batch-4.0.jar:na]
at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:178) [sonar-batch-4.0.jar:na]
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92) [sonar-plugin-api-4.0.jar:na]
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77) [sonar-plugin-api-4.0.jar:na]
at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:58) [sonar-batch-4.0.jar:na]
at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:45) [sonar-batch-4.0.jar:na]
at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:82) [sonar-batch-4.0.jar:na]
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92) [sonar-plugin-api-4.0.jar:na]
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77) [sonar-plugin-api-4.0.jar:na]
at org.sonar.batch.bootstrap.BootstrapContainer.executeTask(BootstrapContainer.java:155) [sonar-batch-4.0.jar:na]
at org.sonar.batch.bootstrap.BootstrapContainer.doAfterStart(BootstrapContainer.java:143) [sonar-batch-4.0.jar:na]
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92) [sonar-plugin-api-4.0.jar:na]
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77) [sonar-plugin-api-4.0.jar:na]
at org.sonar.batch.bootstrapper.Batch.startBatch(Batch.java:92) [sonar-batch-4.0.jar:na]
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:74) [sonar-batch-4.0.jar:na]
at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:45) [sonar-runner-batch7469182442801630044.jar:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.6.0_45]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[na:1.6.0_45]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_45]
at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_45]
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87) [sonar-runner-api-2.3.jar:na]
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75) [sonar-runner-api-2.3.jar:na]
at java.security.AccessController.doPrivileged(Native Method) [na:1.6.0_45]
at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69) [sonar-runner-api-2.3.jar:na]
at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50) [sonar-runner-api-2.3.jar:na]
at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102) [sonar-runner-api-2.3.jar:na]
at org.sonar.runner.api.Runner.execute(Runner.java:90) [sonar-runner-api-2.3.jar:na]
at org.sonar.maven.SonarMojo.execute(SonarMojo.java:173) [sonar-maven-plugin-4.0.jar:na]
at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:104) [sonar-maven-plugin-2.2.jar:na]
at org.codehaus.mojo.sonar.Bootstraper.start(Bootstraper.java:67) [sonar-maven-plugin-2.2.jar:na]
at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:109) [sonar-maven-plugin-2.2.jar:na]
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) [maven-core-3.0.5.jar:3.0.5]
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) [maven-core-3.0.5.jar:3.0.5]
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) [maven-core-3.0.5.jar:3.0.5]
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) [maven-core-3.0.5.jar:3.0.5]
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84) [maven-core-3.0.5.jar:3.0.5]
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) [maven-core-3.0.5.jar:3.0.5]
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) [maven-core-3.0.5.jar:3.0.5]
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) [maven-core-3.0.5.jar:3.0.5]
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320) [maven-core-3.0.5.jar:3.0.5]
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) [maven-core-3.0.5.jar:3.0.5]
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537) [maven-embedder-3.0.5.jar:3.0.5]
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) [maven-embedder-3.0.5.jar:3.0.5]
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141) [maven-embedder-3.0.5.jar:3.0.5]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.6.0_45]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[na:1.6.0_45]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_45]
at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_45]
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290) [plexus-classworlds-2.4.jar:na]
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) [plexus-classworlds-2.4.jar:na]
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409) [plexus-classworlds-2.4.jar:na]
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352) [plexus-classworlds-2.4.jar:na]

1 个答案:

答案 0 :(得分:1)

您是否尝试过没有凭据?

来自Sonar Build Stability Plugin Documentation

  

包含SonarQube 3.4.0至3.6.3的安全提示   对于在项目分析期间要读取的* .secured属性,必须将sonar.login和sonar.password属性设置为以下用户的凭据:   系统管理员   并且项目管理员正在分析正在进行的项目   例:   sonar-runner -Dsonar.login = admin -Dsonar.password = admin

根据您的帖子,您正在运行v4.0。

我认为您传递的凭据与其内部功能相冲突,为您提供未经授权的403。如果您删除了应该使您符合其文档的凭据。

如果不能解决问题,请检查您的网址。在URL内部使用双斜杠//有点奇怪。肯定会引起一些问题。