Timeout to send analysis report to sonarcloud

I have several projects on sonarcloud and they all work fine, however, I’m setting up a new java project that is too big (450k lines) and I’m having timeout issues to send analytics to sonarcloud

I’m performing the local analysis using the docker image from sonarsource/sonar-scanner-cli, as I do with the other projects using this command

docker create \
-e SONAR_SCANNER_VERSION=4.7.0.2747 \
-e SONAR_SCANNER_OPTS=-server \
--name sonar-cli \
sonarsource/sonar-scanner-cli \
-Dsonar.organization=**** \
-Dsonar.projectKey=**** \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.login=***** \
-Dsonar.ws.timeout=99999999 \
&& docker cp . sonar-cli:/usr/src \
&& docker start sonar-cli -a

the config file sonar-project.properties

sonar.sources=.
sonar.exclusions=**/*.html
sonar.inclusions=src/main/java/**
sonar.test.inclusions=src/test/java/**
sonar.sourceEncoding=ISO-8859-1
sonar.java.source=1.8
sonar.java.binaries=target

And I get this error log on completion process

INFO: ------------- Run sensors on project
INFO: Sensor Analysis Warnings import [csharp]
INFO: Sensor Analysis Warnings import [csharp] (done) | time=1ms
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=369ms
INFO: Sensor Java CPD Block Indexer
INFO: Sensor Java CPD Block Indexer (done) | time=2806ms
INFO: CPD Executor 1824 files had no CPD blocks
INFO: CPD Executor Calculating CPD for 5210 files
INFO: CPD Executor CPD calculation finished (done) | time=480ms
INFO: Analysis report generated in 667ms, dir size=39 MB
INFO: Analysis report compressed in 10167ms, zip size=20 MB
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 26:49.731s
INFO: Final Memory: 1363M/2336M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
java.lang.IllegalStateException: Fail to request https://sonarcloud.io/api/ce/submit?organization=****&projectKey=****
        at org.sonarqube.ws.client.HttpConnector.doCall(HttpConnector.java:186)
        at org.sonarqube.ws.client.HttpConnector.post(HttpConnector.java:141)
        at org.sonarqube.ws.client.HttpConnector.call(HttpConnector.java:100)
        at org.sonar.scanner.bootstrap.DefaultScannerWsClient.call(DefaultScannerWsClient.java:59)
        at org.sonar.scanner.report.ReportPublisher.upload(ReportPublisher.java:222)
        at org.sonar.scanner.report.ReportPublisher.execute(ReportPublisher.java:159)
        at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:408)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
        at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:128)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
        at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:58)
        at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:52)
        at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        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:189)
        at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
        at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
        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.SocketAsyncTimeout.newTimeoutException(JvmOkio.kt:143)
        at okio.AsyncTimeout.access$newTimeoutException(AsyncTimeout.kt:162)
        at okio.AsyncTimeout$sink$1.write(AsyncTimeout.kt:340)
        at okio.RealBufferedSink.emitCompleteSegments(RealBufferedSink.kt:235)
        at okio.RealBufferedSink.write(RealBufferedSink.kt:145)
        at okhttp3.internal.http1.Http1ExchangeCodec$KnownLengthSink.write(Http1ExchangeCodec.kt:271)
        at okio.ForwardingSink.write(ForwardingSink.kt:29)
        at okhttp3.internal.connection.Exchange$RequestBodySink.write(Exchange.kt:218)
        at okio.RealBufferedSink.emitCompleteSegments(RealBufferedSink.kt:235)
        at okio.RealBufferedSink.writeAll(RealBufferedSink.kt:184)
        at okhttp3.RequestBody$Companion$asRequestBody$1.writeTo(RequestBody.kt:167)
        at okhttp3.MultipartBody.writeOrCountBytes(MultipartBody.kt:157)
        at okhttp3.MultipartBody.writeTo(MultipartBody.kt:93)
        at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.kt:59)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at org.sonarqube.ws.client.OkHttpClientBuilder.addHeaders(OkHttpClientBuilder.java:201)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:34)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
        at okhttp3.internal.connection.RealCall.execute(RealCall.kt:154)
        at org.sonarqube.ws.client.HttpConnector.doCall(HttpConnector.java:184)
        ... 25 more
Caused by: java.net.SocketException: Operation timed out (Write failed)
        at java.base/java.net.SocketOutputStream.socketWrite0(Native Method)
        at java.base/java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:110)
        at java.base/java.net.SocketOutputStream.write(SocketOutputStream.java:150)
        at java.base/sun.security.ssl.SSLSocketOutputRecord.deliver(SSLSocketOutputRecord.java:340)
        at java.base/sun.security.ssl.SSLSocketImpl$AppOutputStream.write(SSLSocketImpl.java:1299)
        at okio.OutputStreamSink.write(JvmOkio.kt:53)
        at okio.AsyncTimeout$sink$1.write(AsyncTimeout.kt:103)
        ... 50 more

this error does not occur when I reduce the parsing scope

Thank you in advanced for any help!

Hi,

You don’t mention your CI. Is it also in the cloud or local to your organization? And if the latter, can you make sure there’s nothing on your end blocking the transmission? E.G. some “helpful” proxy on your network?

 
Ann

I’m using buildkite CI, but in these tests I’m working locally

Hi,

So can you check with your network folks? Typically when we see a failure uploading the analysis report, it’s a proxy blocking it because of the file size.

 
Ann

I don’t really have any proxy.

I’m thinking of a way to get the parsing data to send to api in another way.

It’s possible?

Hi,

It’s not. Is there a way you can dig in to see which side of the transaction closed the socket?

 
Ann

Ann,

It seems that the problem was in fact my internet. I ran several tests and got different results from each of them.

Some with errors after many minutes and others with success after few seconds

1 Like