org.sonar.runner.kevinsawicki.HttpRequest $ HttpRequestException

时间:2017-01-31 18:22:45

标签: sonarqube

我在我的Docker容器上安装了Sonarqube。

它在某一点上运作良好,我能够从Web UI访问它。

我是这样运行的:

sonar.sh start
sonar-runner -e

然而,突然之间我得到了

SonarQube Runner 2.4
Java 1.8.0_111 Oracle Corporation (64-bit)
Linux 4.4.27-moby amd64
INFO: Error stacktraces are turned on.
INFO: Runner configuration file: /root/sonar-runner-2.4/conf/sonar-runner.properties
INFO: Project configuration file: NONE
INFO: Default locale: "en", source code encoding: "UTF-8" (analysis is platform dependent)
INFO: Work directory: /root/sonarqube-6.2/bin/linux-x86-64/./.sonar
ERROR: Sonar server 'http://localhost:9000' can not be reached
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 0.104s
Final Memory: 1M/31M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
org.sonar.runner.kevinsawicki.HttpRequest$HttpRequestException: java.net.ConnectException: Connection refused (Connection refused)
        at org.sonar.runner.kevinsawicki.HttpRequest.code(HttpRequest.java:1392)
        at org.sonar.runner.kevinsawicki.HttpRequest.ok(HttpRequest.java:1417)
        at org.sonar.runner.impl.ServerConnection.downloadString(ServerConnection.java:93)
        at org.sonar.runner.impl.ServerVersion.downloadVersion(ServerVersion.java:47)
        at org.sonar.runner.impl.ServerVersion.version(ServerVersion.java:38)
        at org.sonar.runner.impl.ServerVersion.is37Compatible(ServerVersion.java:58)
        at org.sonar.runner.impl.JarDownloader.checkVersionAndDownload(JarDownloader.java:36)
        at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:71)
        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: java.net.ConnectException: Connection refused (Connection refused)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1926)
        at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1921)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1920)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1490)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474)
        at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
        at org.sonar.runner.kevinsawicki.HttpRequest.code(HttpRequest.java:1390)
        ... 15 more

Sonarqube日志有以下4个错误:

ce.log:2017.01.31 13:22:29 ERROR ce[][o.s.s.c.t.CeWorkerCallableImpl] Failed to pop the queue of analysis reports
sonar.log:2017.01.31 18:13:00 ERROR app[][o.s.p.m.Monitor] Process[web] failed to start
web.2017-01-30.log:2017.01.30 18:25:59 ERROR web[AVnwoF863qSCVt7PAAAA][o.s.s.ui.JRubyFacade] Fail to render: http://localhost:9000/
web.log:2017.01.31 18:13:00 ERROR web[][o.a.c.c.StandardContext] Context [] startup failed due to previous errors

我对此感到非常惊讶,因为我没有改变任何事情。我只向jar添加了/extensions/plugins/,然后我将其删除了。

这个错误的原因是什么?

1 个答案:

答案 0 :(得分:0)

正如您的服务器日志摘录所反映的那样,与SonarQube服务器的连接被拒绝,因为它不在线。为什么?因为

  

failed to start

  

startup failed due to previous errors

启动并运行您的服务器。 然后您将能够执行分析。