Hi!
We’re having some issues with uploading the report to the SonarQube deployment using SonarScanner in an Azure pipeline. The strange thing is that this is working for other branches, but this specific feature branch causes this to fail. The pipeline for dealing with installing/uploading with SonarScanner is shared for all branches and should work the same way.
The exception showing up in the logs is java.lang.IllegalStateException: Fail to request <URI to SonarQube deployment>
(same URI used in the branches where it’s working).
This is the full exception:
INFO: Sensor C# [csharp] (done) | time=932ms
INFO: Sensor C# Tests Coverage Report Import [csharp]
INFO: Parsing the OpenCover report /home/vsts/work/1/s/TestResults/Coverage/coverage.opencover.xml
INFO: Adding this code coverage report to the cache for later reuse: /home/vsts/work/1/s/TestResults/Coverage/coverage.opencover.xml
INFO: Coverage Report Statistics: 329 files, 329 main files, 329 main files with coverage, 0 test files, 0 project excluded files, 0 other language files.
INFO: Sensor C# Tests Coverage Report Import [csharp] (done) | time=1061ms
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=5ms
INFO: SCM Publisher SCM provider for this project is: git
INFO: SCM Publisher 37 source files to be analyzed
INFO: SCM Publisher 37/37 source files have been analyzed (done) | time=678ms
INFO: CPD Executor 128 files had no CPD blocks
INFO: CPD Executor Calculating CPD for 373 files
INFO: CPD Executor CPD calculation finished (done) | time=142ms
INFO: Analysis report generated in 242ms, dir size=5 MB
INFO: Analysis report compressed in 1137ms, zip size=2 MB
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 16.408s
INFO: Final Memory: 9M/34M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
java.lang.IllegalStateException: Fail to request <URI to SonarQube deployment>
at org.sonarqube.ws.client.HttpConnector.doCall(HttpConnector.java:200)
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.DefaultScannerWsClient.call(DefaultScannerWsClient.java:73)
at org.sonar.scanner.report.ReportPublisher.upload(ReportPublisher.java:205)
at org.sonar.scanner.report.ReportPublisher.execute(ReportPublisher.java:142)
at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:366)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:144)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)
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:126)
at org.sonarsource.scanner.cli.Main.execute(Main.java:81)
at org.sonarsource.scanner.cli.Main.main(Main.java:62)
Caused by: okhttp3.internal.http2.StreamResetException: stream was reset: NO_ERROR
at okhttp3.internal.http2.Http2Stream.checkOutNotClosed$okhttp(Http2Stream.kt:648)
at okhttp3.internal.http2.Http2Stream$FramingSink.emitFrame(Http2Stream.kt:560)
at okhttp3.internal.http2.Http2Stream$FramingSink.write(Http2Stream.kt:535)
at okio.ForwardingSink.write(ForwardingSink.kt:29)
at okhttp3.internal.connection.Exchange$RequestBodySink.write(Exchange.kt:218)
at okio.RealBufferedSink.emitCompleteSegments(RealBufferedSink.kt:255)
at okio.RealBufferedSink.writeAll(RealBufferedSink.kt:194)
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:208)
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:198)
... 25 more
We’ve tried running it with verbose logging on, but it doesn’t return any more details about the upload or exception.
The only difference in the info between the working upload and the failing one is the final memory, which is 8M in the upload that succeeds instead of 9M for the upload that fails. In other words, there are more tests in this branch.
The SonarScanner version is 4.8.0.2856 and the SonarQube deployment is Community Edition Version 8.6.1.
Is it possible to debug this on the SonarQube-side? The report never gets there, but is it possible to detect why the request failed?
We also have other services/projects running and using the same pipeline-script template that is working completely fine.
Anyone has any idea on what could cause this? Any help would be greatly appreciated!