Scanning PHP code error

Must-share information (formatted with Markdown):

  • Community Edition 8.9.10 (build 61524)
  • Docker

When scanning PHP code with SonarQube8.9.10, I encountered the following error:

18:27:10.536 DEBUG GET 200 https://sonarqube.xxx.co/api/new_code_periods/show.protobuf?project=zhouhao03%3Awebapi%3Acodeigniter.application&branch=master_810 | time=32ms
18:27:10.537 INFO Load New Code definition (done) | time=34ms
18:27:12.241 INFO Analysis report generated in 1087ms, dir size=35 MB
18:27:21.013 INFO Analysis report compressed in 8771ms, zip size=13 MB
18:27:21.013 INFO Analysis report generated in /agileflow/code/src/client-repo/codeigniter/application/.scannerwork/scanner-report
18:27:21.013 DEBUG Upload report
18:27:21.039 INFO EXECUTION FAILURE
18:27:21.040 INFO Total time: 3:15.943s
18:27:21.040 ERROR Error during SonarScanner CLI execution
java.lang.IllegalStateException: Fail to request url: https://sonarqube.xxx.co/api/ce/submit?projectKey=zhouhao03%3Awebapi%3Acodeigniter.application&projectName=zhouhao03%3Awebapi%3Acodeigniter.application&characteristic=branch%3Dmaster_810&characteristic=branchType%3DBRANCH
at org.sonarqube.ws.client.HttpConnector.doCall(HttpConnector.java:205)
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:204)
at org.sonar.scanner.report.ReportPublisher.execute(ReportPublisher.java:141)
at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:365)
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:150)
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.lib.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:41)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.sonarsource.scanner.lib.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:62)
at jdk.proxy3/jdk.proxy3.$Proxy2.execute(Unknown Source)
at org.sonarsource.scanner.lib.InProcessScannerEngineFacade.doAnalyze(InProcessScannerEngineFacade.java:39)
at org.sonarsource.scanner.lib.ScannerEngineFacade.analyze(ScannerEngineFacade.java:61)
at org.sonarsource.scanner.cli.Main.analyze(Main.java:77)
at org.sonarsource.scanner.cli.Main.main(Main.java:63)
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:222)
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:203)
… 24 common frames omitted
Suppressed: okhttp3.internal.http2.StreamResetException: stream was reset: NO_ERROR
… 49 common frames omitted

Hi,

Welcome to the community!

Only the latest version of SonarQube Community Build is considered active, so you’ll need to upgrade and see if the situation is still replicable before we can help you.

Your upgrade path is:

8.9.10 → 9.9.8 → 24.12 → 25.5

You may find these resources helpful:

If you have questions about upgrading, feel free to open a new thread for that here.

If your error persists after upgrade, please come back to us.

 
Ann