SonarQube Scanner execution error - Connection reset while downloading plugins


I am facing an issue when running the Sonarqube Scanner within a Jenkins pipeline to a dockerised Sonarqube server. The scanner sometimes fails to download some plugins and throws a Connection reset SocketException.

My issue is similar to the one described in this post and I followed the hints from @Krzysztof_Jazgara about requirements. I ensured that the following requirements were met on the host running the dockerised Sonarqube server:

  • vm.max_map_count is greater than or equal to 524288
  • fs.file-max is greater than or equal to 131072
  • the user running SonarQube can open at least 131072 file descriptors
  • the user running SonarQube can open at least 8192 threads

Has anyone also experienced this before ?

Hippolyte V.

  • Versions used

    • SonarQube 9.2.4
    • SonarQube Scanner
    • Java 11.0.13 Ubuntu (64-bit)
    • Linux 4.9.0-11-amd64
  • Error observed

INFO: SonarQube Scanner
INFO: Java 11.0.13 Ubuntu (64-bit)
INFO: Linux 4.9.0-11-amd64 amd64
INFO: User cache: /root/.sonar/cache
INFO: SonarQube server 9.2.4
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Load global settings
INFO: Load global settings (done) | time=181ms
INFO: Server id: <redacted>
INFO: User cache: /root/.sonar/cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=57ms
INFO: Load/download plugins (done) | time=520ms
INFO: ------------------------------------------------------------------------
INFO: ------------------------------------------------------------------------
INFO: Total time: 2.531s
INFO: Final Memory: 6M/108M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: Fail to download plugin [java] into /root/.sonar/_tmp/fileCache4019529017129664578.tmp
	at org.sonar.scanner.bootstrap.PluginFiles.downloadBinaryTo(
	at org.sonar.scanner.bootstrap.PluginFiles.get(
	at org.sonar.scanner.bootstrap.ScannerPluginInstaller.loadPlugins(
	at org.sonar.scanner.bootstrap.ScannerPluginInstaller.installRemotes(
	at org.sonar.scanner.bootstrap.ScannerPluginRepository.start(
	at org.sonar.core.platform.StartableCloseableSafeLifecyleStrategy.start(
	at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(
	at org.picocontainer.behaviors.AbstractBehavior.start(
	at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(
	at org.picocontainer.behaviors.Stored.start(
	at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(
	at org.picocontainer.DefaultPicoContainer.startAdapters(
	at org.picocontainer.DefaultPicoContainer.start(
	at org.sonar.core.platform.ComponentContainer.startComponents(
	at org.sonar.core.platform.ComponentContainer.execute(
	at org.sonar.batch.bootstrapper.Batch.doExecute(
	at org.sonar.batch.bootstrapper.Batch.execute(
	at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(
	at java.base/java.lang.reflect.Method.invoke(
	at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(
	at com.sun.proxy.$Proxy0.execute(Unknown Source)
	at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(
	at org.sonarsource.scanner.api.EmbeddedScanner.execute(
	at org.sonarsource.scanner.cli.Main.execute(
	at org.sonarsource.scanner.cli.Main.execute(
	at org.sonarsource.scanner.cli.Main.main(
Caused by: Connection reset
	at java.base/
	at java.base/
	at java.base/
	at java.base/
	at java.base/
	at java.base/
	at java.base/
	at java.base/
	at java.base/
	at java.base/$
	at okio.AsyncTimeout$source$
	at okio.RealBufferedSource.request(RealBufferedSource.kt:206)
	at okio.RealBufferedSource.require(RealBufferedSource.kt:199)
	at okhttp3.internal.http2.Http2Reader.nextFrame(Http2Reader.kt:89)
	at okhttp3.internal.http2.Http2Connection$ReaderRunnable.invoke(Http2Connection.kt:618)
	at okhttp3.internal.http2.Http2Connection$ReaderRunnable.invoke(Http2Connection.kt:609)
	at okhttp3.internal.concurrent.TaskQueue$execute$1.runOnce(TaskQueue.kt:98)
	at okhttp3.internal.concurrent.TaskRunner.runTask(TaskRunner.kt:116)
	at okhttp3.internal.concurrent.TaskRunner.access$runTask(TaskRunner.kt:42)
	at okhttp3.internal.concurrent.TaskRunner$runnable$
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(
	at java.base/java.util.concurrent.ThreadPoolExecutor$
	at java.base/
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
  • Steps to reproduce
    This error happens from time to time and is hard to reproduce but tends to happen when multiple analysis are run in a short time. Note that it does not always fail for the plugin [java] but also sometimes for other plugins.

  • Potential workaround
    The scanner downloads all plugins and performs the analysis with success after some retries.

  • Scanner command used when applicable
    The scanner is used in a Jenkins pipeline configured as follows:

    withSonarQubeEnv('Sonarqube') {
      sh "${scannerHome}/bin/sonar-scanner"

Source: SonarScanner for Jenkins - Using a Jenkins pipeline


I did not found the root cause or a fix yet. However, I found a workaround: I am sharing the sonar scanner cache between runs to prevent the scanner from downloading the plugins every time.

Hippolyte V.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.