问题
i was working with sonar and everything was working just fine. then after a month or so not using it i started receiving the following exception when running the sonar-runner.bat
i am using the embedded h2 db server and use the default ports.
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
回答1:
- Go to:
sonar-runner-2.3/conf/sonar-runner.properties
- Uncomment the line:
#sonar.host.url=http://localhost:9000
- Replace
localhost
with your IP and save the file! example:sonar.host.url=http://192.168.0.12:9000
回答2:
Default port used by sonar is 9000,may be this has been used by some other application on your system.
Change your listening port in sonarqube-4.2/conf/sonar.properties, sonar-runner-2.3/conf/sonar-runner.properties
Restart sonar sonarqube-4.2/bin/linux-x86-64/sonar.sh restart
回答3:
I have same problem and found that I have installed my sql but forget to reset mysql password.
I found my mistake by accessing logs under /logs/access.log
So logs will surely help you to figure out problem.
回答4:
This error is triggered by a SonarQube plugin that I'm not aware of : "kevinsawicki". I guess removing this plugin should fix your issue.
来源:https://stackoverflow.com/questions/18944690/sonar-runner-sockettimeoutexception-when-running