[Jenkins Sonar Scanner Plugin] Frequent java.net.SocketTimeoutException: Read timed out

918 views
Skip to first unread message

Stuart Stephen

unread,
Feb 7, 2018, 5:12:32 AM2/7/18
to SonarQube

Hi all,


We keep getting read timed out exceptions since moving to SonarQube 6.7.1 (from 5.6.6). These timeouts are failing the builds in Jenkins, however the background jobs in SonarQube appear to be executed suggesting it is doing just enough.


Is it possible to increase the timeout so that on the Jenkins side it does not fail the build? It's painting an incorrect picture as it currently stands.


We're using an embedded installation of the sonar scanner in Jenkins, version 3.0.3.778.


ERROR: Error during SonarQube Scanner execution

java.lang.IllegalStateException: Fail to request http://localhost:9000/api/ce/submit?projectKey=com.tracegroup.isys:OpenTWINS.IBA&projectName=com.tracegroup.isys:OpenTWINS.IBA

                at org.sonarqube.ws.client.HttpConnector.doCall(HttpConnector.java:190)

                at org.sonarqube.ws.client.HttpConnector.post(HttpConnector.java:155)

                at org.sonarqube.ws.client.HttpConnector.call(HttpConnector.java:114)

                at org.sonar.scanner.bootstrap.ScannerWsClient.call(ScannerWsClient.java:73)

                at org.sonar.scanner.report.ReportPublisher.upload(ReportPublisher.java:189)

                at org.sonar.scanner.report.ReportPublisher.execute(ReportPublisher.java:135)

                at org.sonar.scanner.phases.PublishPhaseExecutor.publishReportJob(PublishPhaseExecutor.java:73)

                at org.sonar.scanner.phases.PublishPhaseExecutor.executeOnRoot(PublishPhaseExecutor.java:55)

                at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:93)

                at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:180)

                at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)

                at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:121)

                at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:288)

                at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:283)

                at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:261)

                at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)

                at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:121)

                at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:48)

                at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:84)

                at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)

                at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:121)

                at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:121)

                at org.sonar.batch.bootstrapper.Batch.doExecuteTask(Batch.java:116)

                at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:111)

                at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:63)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

                at java.lang.reflect.Method.invoke(Method.java:498)

                at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)

                at com.sun.proxy.$Proxy0.execute(Unknown Source)

                at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:233)

                at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)

                at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:123)

                at org.sonarsource.scanner.cli.Main.execute(Main.java:77)

                at org.sonarsource.scanner.cli.Main.main(Main.java:61)

Caused by: java.net.SocketTimeoutException: timeout

                at okio.Okio$4.newTimeoutException(Okio.java:227)

                at okio.AsyncTimeout.exit(AsyncTimeout.java:284)

                at okio.AsyncTimeout$2.read(AsyncTimeout.java:240)

                at okio.RealBufferedSource.indexOf(RealBufferedSource.java:344)

                at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:216)

                at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:210)

                at okhttp3.internal.http1.Http1Codec.readResponseHeaders(Http1Codec.java:189)

                at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:75)

                at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)

                at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)

                at org.sonarqube.ws.client.OkHttpClientBuilder.addHeaders(OkHttpClientBuilder.java:207)

                at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)

                at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45)

                at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)

                at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)

                at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)

                at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)

                at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)

                at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)

                at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)

                at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:120)

                at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)

                at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)

                at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:185)

                at okhttp3.RealCall.execute(RealCall.java:69)

                at org.sonarqube.ws.client.HttpConnector.doCall(HttpConnector.java:188)

                ... 35 more

Caused by: java.net.SocketTimeoutException: Read timed out

                at java.net.SocketInputStream.socketRead0(Native Method)

                at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)

                at java.net.SocketInputStream.read(SocketInputStream.java:171)

                at java.net.SocketInputStream.read(SocketInputStream.java:141)

                at okio.Okio$2.read(Okio.java:138)

                at okio.AsyncTimeout$2.read(AsyncTimeout.java:236)

                ... 58 more


Thanks,

Stuart

G. Ann Campbell

unread,
Feb 7, 2018, 10:38:07 AM2/7/18
to SonarQube
Hi,

I'm a little fuzzy on the analysis stage where you get the timeout, but sonar.ws.timeout might help. If it doesn't, could you provide a little more detail on your scenario?


Ann

Stuart Stephen

unread,
Feb 8, 2018, 4:58:47 AM2/8/18
to G. Ann Campbell, SonarQube
Thanks for this, Ann. 

I found the documentation and put it into sonar-project.properties and it appears to be working.


Cheers,
Stuart


--
You received this message because you are subscribed to a topic in the Google Groups "SonarQube" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sonarqube/MQBRHr_XCI8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sonarqube+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/9c390455-3060-4af3-b4a5-896b066b6ccc%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages