[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.0.2155:sonar

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube: Community Edition
    *** Version 8.9.8 (build 54436), sonar-maven-plugin:3.9.0.2155, ** Jenkins 2.303.3, OpenJDK-11, Maven 3.6.3, ** Community Branch Plugin 1.8.1 **)
  • what are you trying to achieve: scan an application in Jenkins integrated environment and upload report to sonarqube application
  • what have you tried so far to achieve this: cleaned workspace, restarted SQ

After upgrading Sonarqube to 8.9.8 vesrion, builds fail with error:
12:18:52 [ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.0.2155:sonar (default-cli) on project xxxxxx: Fail to request url: https://xxxxx: stream was reset: NO_ERROR → [Help 1]
As i can see, from the Jenkins job output the problem occurs after analyzing the application, generating the report and compression of the report i.e. at the time when upload should be executed and furthermore this happens when report is bigger then few KB. My opinion is that the problem is related to the report size although it is not clear to me how could it be functional with lower version of Sonarqube (8.5.1) before the upgrade.

part of the output indicating upload problem:

....Analysis report generated in 230ms, dir size=3 MB 
[INFO]  Analysis report compressed in 1801ms, zip size=1 MB 
[INFO] 10:18:52.761 Analysis report generated in /var/jenkins_home/workspace/xxxx/target/sonar/scanner-report
 [DEBUG] 10:18:52.762 Upload report
 [INFO] BUILD FAILURE 
 [INFO] Total time: 01:42 min 
 [INFO] Finished at: 2022-05-19T10:18:52Z

This is happening in our DevOps CI/CD environment and it is very important to be solved as son as possible so developers can continue with their activities without interruption. Any suggestion for solution is more than welcome!

The full stacktrace is :

12:18:52  org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.0.2155:sonar (default-cli) on project ehr-ui-backend: Fail to request url: https://xxxxxx
12:18:52      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
12:18:52      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
12:18:52      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
12:18:52      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
12:18:52      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
12:18:52      at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
12:18:52      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
12:18:52      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
12:18:52      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
12:18:52      at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
12:18:52      at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
12:18:52      at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
12:18:52      at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
12:18:52      at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
12:18:52      at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
12:18:52      at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
12:18:52      at java.lang.reflect.Method.invoke (Method.java:566)
12:18:52      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
12:18:52      at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
12:18:52      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
12:18:52      at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
12:18:52  Caused by: org.apache.maven.plugin.MojoExecutionException: Fail to request url: https://xxxxx
12:18:52      at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute (ScannerBootstrapper.java:67)
12:18:52      at org.sonarsource.scanner.maven.SonarQubeMojo.execute (SonarQubeMojo.java:108)
12:18:52      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
12:18:52      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
12:18:52      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
12:18:52      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
12:18:52      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
12:18:52      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
12:18:52      at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
12:18:52      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
12:18:52      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
12:18:52      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
12:18:52      at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
12:18:52      at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
12:18:52      at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
12:18:52      at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
12:18:52      at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
12:18:52      at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
12:18:52      at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
12:18:52      at java.lang.reflect.Method.invoke (Method.java:566)
12:18:52      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
12:18:52      at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
12:18:52      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
12:18:52      at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
12:18:52  Caused by: java.lang.IllegalStateException: Fail to request url: https://xxxxxx
12:18:52      at org.sonarqube.ws.client.HttpConnector.doCall (HttpConnector.java:205)
12:18:52      at org.sonarqube.ws.client.HttpConnector.post (HttpConnector.java:155)
12:18:52      at org.sonarqube.ws.client.HttpConnector.call (HttpConnector.java:114)
12:18:52      at org.sonar.scanner.bootstrap.DefaultScannerWsClient.call (DefaultScannerWsClient.java:73)
12:18:52      at org.sonar.scanner.report.ReportPublisher.upload (ReportPublisher.java:204)
12:18:52      at org.sonar.scanner.report.ReportPublisher.execute (ReportPublisher.java:141)
12:18:52      at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart (ProjectScanContainer.java:365)
12:18:52      at org.sonar.core.platform.ComponentContainer.startComponents (ComponentContainer.java:137)
12:18:52      at org.sonar.core.platform.ComponentContainer.execute (ComponentContainer.java:123)
12:18:52      at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart (GlobalContainer.java:150)
12:18:52      at org.sonar.core.platform.ComponentContainer.startComponents (ComponentContainer.java:137)
12:18:52      at org.sonar.core.platform.ComponentContainer.execute (ComponentContainer.java:123)
12:18:52      at org.sonar.batch.bootstrapper.Batch.doExecute (Batch.java:72)
12:18:52      at org.sonar.batch.bootstrapper.Batch.execute (Batch.java:66)
12:18:52      at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute (BatchIsolatedLauncher.java:46)
12:18:52      at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
12:18:52      at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
12:18:52      at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
12:18:52      at java.lang.reflect.Method.invoke (Method.java:566)
12:18:52      at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke (IsolatedLauncherProxy.java:60)
12:18:52      at com.sun.proxy.$Proxy25.execute (Unknown Source)
12:18:52      at org.sonarsource.scanner.api.EmbeddedScanner.doExecute (EmbeddedScanner.java:189)
12:18:52      at org.sonarsource.scanner.api.EmbeddedScanner.execute (EmbeddedScanner.java:138)
12:18:52      at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute (ScannerBootstrapper.java:65)
12:18:52      at org.sonarsource.scanner.maven.SonarQubeMojo.execute (SonarQubeMojo.java:108)
12:18:52      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
12:18:52      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
12:18:52      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
12:18:52      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
12:18:52      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
12:18:52      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
12:18:52      at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
12:18:52      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
12:18:52      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
12:18:52      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
12:18:52      at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
12:18:52      at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
12:18:52      at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
12:18:52      at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
12:18:52      at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
12:18:52      at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
12:18:52      at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
12:18:52      at java.lang.reflect.Method.invoke (Method.java:566)
12:18:52      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
12:18:52      at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
12:18:52      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
12:18:52      at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
12:18:52  Caused by: okhttp3.internal.http2.StreamResetException: stream was reset: NO_ERROR
12:18:52      at okhttp3.internal.http2.Http2Stream.checkOutNotClosed$okhttp (Http2Stream.kt:648)
12:18:52      at okhttp3.internal.http2.Http2Stream$FramingSink.emitFrame (Http2Stream.kt:560)
12:18:52      at okhttp3.internal.http2.Http2Stream$FramingSink.write (Http2Stream.kt:535)
12:18:52      at okio.ForwardingSink.write (ForwardingSink.kt:29)
12:18:52      at okhttp3.internal.connection.Exchange$RequestBodySink.write (Exchange.kt:218)
12:18:52      at okio.RealBufferedSink.emitCompleteSegments (RealBufferedSink.kt:255)
12:18:52      at okio.RealBufferedSink.writeAll (RealBufferedSink.kt:194)
12:18:52      at okhttp3.RequestBody$Companion$asRequestBody$1.writeTo (RequestBody.kt:167)
12:18:52      at okhttp3.MultipartBody.writeOrCountBytes (MultipartBody.kt:157)
12:18:52      at okhttp3.MultipartBody.writeTo (MultipartBody.kt:93)
12:18:52      at okhttp3.internal.http.CallServerInterceptor.intercept (CallServerInterceptor.kt:59)
12:18:52      at okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.kt:109)
12:18:52      at org.sonarqube.ws.client.OkHttpClientBuilder.addHeaders (OkHttpClientBuilder.java:222)
12:18:52      at okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.kt:109)
12:18:52      at okhttp3.internal.connection.ConnectInterceptor.intercept (ConnectInterceptor.kt:34)
12:18:52      at okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.kt:109)
12:18:52      at okhttp3.internal.cache.CacheInterceptor.intercept (CacheInterceptor.kt:95)
12:18:52      at okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.kt:109)
12:18:52      at okhttp3.internal.http.BridgeInterceptor.intercept (BridgeInterceptor.kt:83)
12:18:52      at okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.kt:109)
12:18:52      at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept (RetryAndFollowUpInterceptor.kt:76)
12:18:52      at okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.kt:109)
12:18:52      at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp (RealCall.kt:201)
12:18:52      at okhttp3.internal.connection.RealCall.execute (RealCall.kt:154)
12:18:52      at org.sonarqube.ws.client.HttpConnector.doCall (HttpConnector.java:203)
12:18:52      at org.sonarqube.ws.client.HttpConnector.post (HttpConnector.java:155)
12:18:52      at org.sonarqube.ws.client.HttpConnector.call (HttpConnector.java:114)
12:18:52      at org.sonar.scanner.bootstrap.DefaultScannerWsClient.call (DefaultScannerWsClient.java:73)
12:18:52      at org.sonar.scanner.report.ReportPublisher.upload (ReportPublisher.java:204)
12:18:52      at org.sonar.scanner.report.ReportPublisher.execute (ReportPublisher.java:141)
12:18:52      at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart (ProjectScanContainer.java:365)
12:18:52      at org.sonar.core.platform.ComponentContainer.startComponents (ComponentContainer.java:137)
12:18:52      at org.sonar.core.platform.ComponentContainer.execute (ComponentContainer.java:123)
12:18:52      at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart (GlobalContainer.java:150)
12:18:52      at org.sonar.core.platform.ComponentContainer.startComponents (ComponentContainer.java:137)
12:18:52      at org.sonar.core.platform.ComponentContainer.execute (ComponentContainer.java:123)
12:18:52      at org.sonar.batch.bootstrapper.Batch.doExecute (Batch.java:72)
12:18:52      at org.sonar.batch.bootstrapper.Batch.execute (Batch.java:66)
12:18:52      at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute (BatchIsolatedLauncher.java:46)
12:18:52      at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
12:18:52      at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
12:18:52      at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
12:18:52      at java.lang.reflect.Method.invoke (Method.java:566)
12:18:52      at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke (IsolatedLauncherProxy.java:60)
12:18:52      at com.sun.proxy.$Proxy25.execute (Unknown Source)
12:18:52      at org.sonarsource.scanner.api.EmbeddedScanner.doExecute (EmbeddedScanner.java:189)
12:18:52      at org.sonarsource.scanner.api.EmbeddedScanner.execute (EmbeddedScanner.java:138)
12:18:52      at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute (ScannerBootstrapper.java:65)
12:18:52      at org.sonarsource.scanner.maven.SonarQubeMojo.execute (SonarQubeMojo.java:108)
12:18:52      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
12:18:52      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
12:18:52      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
12:18:52      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
12:18:52      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
12:18:52      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
12:18:52      at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
12:18:52      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
12:18:52      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
12:18:52      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
12:18:52      at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
12:18:52      at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
12:18:52      at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
12:18:52      at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
12:18:52      at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
12:18:52      at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
12:18:52      at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
12:18:52      at java.lang.reflect.Method.invoke (Method.java:566)
12:18:52      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
12:18:53      at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
12:18:53      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
12:18:53      at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
12:18:53  [ERROR] 
12:18:53  [ERROR] 
12:18:53  [ERROR] For more information about the errors and possible solutions, please read the following articles:
12:18:53  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
12:18:53  [Pipeline] }
12:18:53  WARN: Unable to locate 'report-task.txt' in the workspace. Did the SonarScanner succeed?

Thank you in advance!

Hi,

Welcome to the community!

There is likely something on your network, e.g. a proxy, that’s blocking the analysis report submission. You should check with your network folks.

 
HTH,
Ann