Error during SonarQube Scanner execution - SocketTimeoutException

(verdi) #1

Hello ,

I am trying to run sonar-scanner on my local machine (windows10) but I have an error when the reports are trying to be sent.
Could you please help me solving this issue ?

NB1: if I reduce the size of the reports - by limiting the analysed source to only a part of my sources, it works fine.
NB 2: sonar.ws.timeout=3000 does not seems to have any impact

SonarQube Scanner 3.3.0.1492
SonarQube server 6.7.2

here 's the error :

16:25:14.922 INFO: Analysis report generated in 3038ms, dir size=990 KB
16:25:16.416 INFO: Analysis reports compressed in 1493ms, zip size=537 KB
16:25:16.417 INFO: Analysis report generated in C:\DEV\SAAS\software-ui\.scannerwork\scanner-report
16:25:16.418 DEBUG: Upload report
16:25:26.602 INFO: ------------------------------------------------------------------------
16:25:26.602 INFO: EXECUTION FAILURE
16:25:26.605 INFO: ------------------------------------------------------------------------
16:25:26.605 INFO: Total time: 34.643s
16:25:26.686 INFO: Final Memory: 44M/1325M
16:25:26.687 INFO: ------------------------------------------------------------------------
16:25:26.688 ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: Fail to request http://sonarqube.hub.genesaas.io/api/ce/submit?projectKey=software-ui&projectName=com.experian.eda.saas.software-ui
        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.execute(Batch.java:71)
        at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
        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:185)
        at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:137)
        at org.sonarsource.scanner.cli.Main.execute(Main.java:111)
        at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
        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$1.write(AsyncTimeout.java:183)
        at okio.RealBufferedSink.emitCompleteSegments(RealBufferedSink.java:171)
        at okio.RealBufferedSink.write(RealBufferedSink.java:41)
        at okhttp3.internal.http1.Http1Codec$FixedLengthSink.write(Http1Codec.java:286)
        at okio.RealBufferedSink.emitCompleteSegments(RealBufferedSink.java:171)
        at okio.RealBufferedSink.writeAll(RealBufferedSink.java:99)
        at okhttp3.RequestBody$3.writeTo(RequestBody.java:118)
        at okhttp3.MultipartBody.writeOrCountBytes(MultipartBody.java:171)
        at okhttp3.MultipartBody.writeTo(MultipartBody.java:113)
        at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:62)
        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.SocketException: Socket closed
        at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:118)
        at java.net.SocketOutputStream.write(SocketOutputStream.java:155)
        at okio.Okio$1.write(Okio.java:78)
        at okio.AsyncTimeout$1.write(AsyncTimeout.java:179)
        ... 62 more
(G Ann Campbell) #2

Hi,

To be clear, does the SonarQube instance reside on your machine? I.e. nothing on the network in between the analysis and the server? Also, what’s your DB flavor?

 
Ann

(Lukas) #3

Hello,

we are getting the exact same error. It seems to happen if the report upload takes longer than 10 seconds. The upload works once every ~10 times (if the request is able to finish in time I guess).

I am running sonar scanner 3.3.0.1492 on java 1.8.0_121 (Oracle 64-bit). It failed on Mac OSX as well as on Linux.
We are running Sonarqube with a PostgreSQL database. I checked the server logs and they didn’t show any exceptions.

If you need any further information let me know.
Lukas

(G Ann Campbell) #4

Hi Lukas,

Is there a proxy between the analysis machine and SonarQube?

 
Ann