5

我正在使用声纳,一切正常。然后在一个月左右不使用它之后,我在运行 sonar-runner.bat 时开始收到以下异常

我正在使用嵌入式 h2 db 服务器并使用默认端口。

INFO: Error stacktraces are turned on.
INFO: Runner configuration file: C:\sonar\sonar-runner-2.2.2\conf\sonar-runner.properties
INFO: Project configuration file: c:\eclipse\workspaces\projName\sonar-project.properties
INFO: Default locale: "iw_IL", source code encoding: "UTF-8"
INFO: Work directory: c:\eclipse\workspaces\projName\.sonar
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 1:00.553s
Final Memory: 1M/242M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
org.sonar.runner.kevinsawicki.HttpRequest$HttpRequestException: java.net.SocketTimeoutException: Read timed out
        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:83)
        at org.sonar.runner.impl.ServerVersion.downloadVersion(ServerVersion.java:49)
        at org.sonar.runner.impl.ServerVersion.version(ServerVersion.java:40)
        at org.sonar.runner.impl.ServerVersion.is35Compatible(ServerVersion.java:64)
        at org.sonar.runner.impl.JarDownloader.download(JarDownloader.java:39)
        at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:59)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:57)
        at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
        at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:71)
        at org.sonar.runner.api.Runner.execute(Runner.java:89)
        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:41)
Caused by: java.net.SocketTimeoutException: Read timed out
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1491)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1485)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1139)
        at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:379)
        at org.sonar.runner.kevinsawicki.HttpRequest.code(HttpRequest.java:1390)
        ... 15 more
Caused by: java.net.SocketTimeoutException: Read timed out
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.read(SocketInputStream.java:129)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
        at java.io.BufferedInputStream.read1(BufferedInputStream.java:258)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:317)
        at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:697)
        at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:640)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1195)
        at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:2300)
        at org.sonar.runner.kevinsawicki.HttpRequest.header(HttpRequest.java:1903)
        at org.sonar.runner.kevinsawicki.HttpRequest.contentType(HttpRequest.java:2308)
        at org.sonar.runner.impl.ServerConnection.downloadString(ServerConnection.java:79)
        ... 13 more
4

4 回答 4

1
  1. 去:sonar-runner-2.3/conf/sonar-runner.properties
  2. 取消注释该行:#sonar.host.url=http://localhost:9000
  3. 替换localhost为您的 IP 并保存文件!例子:sonar.host.url=http://192.168.0.12:9000
于 2014-10-19T09:21:38.050 回答
0

我有同样的问题,发现我已经安装了我的 sql 但忘记重置 mysql 密码。

我通过访问 /logs/access.log 下的日志发现了我的错误

所以日志肯定会帮助你找出问题。

于 2014-12-04T09:42:58.877 回答
0

声纳使用的默认端口是 9000,可能这已被系统上的其他应用程序使用。

在 sonarqube-4.2/conf/sonar.properties、sonar-runner-2.3/conf/sonar-runner.properties 中更改您的监听端口

重启声纳 sonarqube-4.2/bin/linux-x86-64/sonar.sh restart

于 2014-04-29T10:31:54.040 回答
-2

此错误是由我不知道的 SonarQube 插件触发的:“kevinsawicki”。我想删除这个插件应该可以解决你的问题。

于 2013-09-26T16:01:16.230 回答