在Jenkins上执行Sonar跑步程序时出现错误500 [英] Error 500 during Sonar runner execution on Jenkins

查看:142
本文介绍了在Jenkins上执行Sonar跑步程序时出现错误500的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Jenkins上运行sonarqube独立分析时,出现以下错误.声纳扫描仪能够识别要分析的文件并能够对其进行精细分析,但是问题在于它试图将项目发布到仪表板时.

I am getting the below error when running sonarqube standalone analysis on Jenkins. The sonarqube scanner is able to identify the files to be analyzed and is able to analyze them fine, but the issue is when it is trying to publish the project to dashboard.

当我打开URL时 http://vv123456:9000/api /ce/submit?projectKey = pkey& projectName = pname 在浏览器中显示"{" errors:[{" msg:"需要HTTP方法POST"}]}",这意味着sonarqube网络服务很好.

When I open the URL http://vv123456:9000/api/ce/submit?projectKey=pkey&projectName=pname in browser, it says "{"errors":[{"msg":"HTTP method POST is required"}]}", which means the sonarqube webservice is fine.

Jenkins构建错误:

ERROR: Error during Sonar runner execution
org.sonar.runner.impl.RunnerException: Unable to execute Sonar
    at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
    at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
    at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
    at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
    at org.sonar.runner.api.Runner.execute(Runner.java:100)
    at org.sonar.runner.Main.executeTask(Main.java:70)
    at org.sonar.runner.Main.execute(Main.java:59)
    at org.sonar.runner.Main.main(Main.java:53)
Caused by: org.sonarqube.ws.client.HttpException: Error 500 on [http://vv123456:9000/api/ce/submit?projectKey=pkey&projectName=pname][1]
    at org.sonarqube.ws.client.BaseResponse.failIfNotSuccessful(BaseResponse.java:34)
    at org.sonar.batch.bootstrap.BatchWsClient.failIfUnauthorized(BatchWsClient.java:99)
    at org.sonar.batch.bootstrap.BatchWsClient.call(BatchWsClient.java:69)
    at org.sonar.batch.report.ReportPublisher.upload(ReportPublisher.java:172)
    at org.sonar.batch.report.ReportPublisher.execute(ReportPublisher.java:127)
    at org.sonar.batch.phases.PublishPhaseExecutor.publishReportJob(PublishPhaseExecutor.java:64)
    at org.sonar.batch.phases.PublishPhaseExecutor.executeOnRoot(PublishPhaseExecutor.java:51)
    at org.sonar.batch.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:86)
    at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:192)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
    at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:241)
    at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:236)
    at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:226)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
    at org.sonar.batch.task.ScanTask.execute(ScanTask.java:47)
    at org.sonar.batch.task.TaskContainer.doAfterStart(TaskContainer.java:86)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
    at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:106)
    at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:119)
    at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:79)
    at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
    ... 9 more

推荐答案

在SonarQube登录托管Web服务的服务器上(在我的情况下为vv123456),错误记录为:

In the SonarQube logs on the server where web-service is hosted (vv123456 in my case), there was an error logged as:

No such file or directory - C:/Windows/system32/config/systemprofile/AppData/Local/Temp

因此,我将路径添加到wrapper.conf中的临时位置为:

So, I added the path to the temp location in wrapper.conf as:

set.TMPDIR=/SonarQube/sonarqube-5.6/temp

这解决了问题.

这篇关于在Jenkins上执行Sonar跑步程序时出现错误500的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆