Sonar Scanner Failed to close server

Dear Support/Community,

I’m analyzing an angular monorepo (typescript) during a jenkins pipeline. I noticed the issue (warning) mentioned below and I can’t recall having this one before. It might also relate to the upgrade to Angular 9/Typescript 3.8.3, but the exception trace concludes otherwise. I cannot exclude the possibility that the non closable server connection comes from some typescript/SonarJS scan itself.

It must be said that the analyses as well as the upload of the results to our sonar server instance (on-premise) of the project (all modules) are successfull. It only seems that the sonar scanner has problems closing the connection to the server.

Versions in use:
SonarQube 8.2
Jenkins SonarQube Scanner: 2.11
Jenkins Sonar Quality Gates Plugin: 1.3.1
Java: 11.0.5 AdoptOpenJDK
OS: Windows Server 2016

If there is a similar issue, I apologize for not finding it. Maybe you can point me into the right direction :wink:

Steps to reproduce: None that I know of unfortunately besides the setup

Call of Sonar Scanner:
sonar-scanner“my branch Name” -Dproject.settings=/libs/ui-layout/ -Dsonar.javascript.node.maxspace=2048
Error stack

09:50:36  INFO: Analysis report generated in 142ms, dir size=159 KB
09:50:36  INFO: Analysis report compressed in 77ms, zip size=42 KB
09:50:37  INFO: Analysis report uploaded in 33ms
09:50:37  INFO: ANALYSIS SUCCESSFUL, you can browse https://sonarqube.*********
09:50:37  INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
09:50:37  INFO: More about the report processing at https://sonarqube.*****/api/ce/task?id=AXUmFujKYP1pakYm-MOh
09:50:39  WARN: Failed to close server
09:50:39 Failed to connect to localhost/0:0:0:0:0:0:0:1:53079
09:50:39  	at okhttp3.internal.connection.RealConnection.connectSocket(
09:50:39  	at okhttp3.internal.connection.RealConnection.connect(
09:50:39  	at okhttp3.internal.connection.StreamAllocation.findConnection(
09:50:39  	at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(
09:50:39  	at okhttp3.internal.connection.StreamAllocation.newStream(
09:50:39  	at okhttp3.internal.connection.ConnectInterceptor.intercept(
09:50:39  	at okhttp3.internal.http.RealInterceptorChain.proceed(
09:50:39  	at okhttp3.internal.http.RealInterceptorChain.proceed(
09:50:39  	at okhttp3.internal.cache.CacheInterceptor.intercept(
09:50:39  	at okhttp3.internal.http.RealInterceptorChain.proceed(
09:50:39  	at okhttp3.internal.http.RealInterceptorChain.proceed(
09:50:39  	at okhttp3.internal.http.BridgeInterceptor.intercept(
09:50:39  	at okhttp3.internal.http.RealInterceptorChain.proceed(
09:50:39  	at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(
09:50:39  	at okhttp3.internal.http.RealInterceptorChain.proceed(
09:50:39  	at okhttp3.internal.http.RealInterceptorChain.proceed(
09:50:39  	at okhttp3.RealCall.getResponseWithInterceptorChain(
09:50:39  	at okhttp3.RealCall.execute(
09:50:39  	at org.sonar.plugins.javascript.eslint.EslintBridgeServerImpl.request(
09:50:39  	at org.sonar.plugins.javascript.eslint.EslintBridgeServerImpl.clean(
09:50:39  	at org.sonar.plugins.javascript.eslint.EslintBridgeServerImpl.stop(
09:50:39  	at org.sonar.core.platform.StartableCloseableSafeLifecyleStrategy.stop(
09:50:39  	at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.stop(
09:50:39  	at org.picocontainer.behaviors.AbstractBehavior.stop(
09:50:39  	at org.picocontainer.behaviors.Stored$RealComponentLifecycle.stop(
09:50:39  	at org.picocontainer.behaviors.Stored.stop(
09:50:39  	at org.picocontainer.DefaultPicoContainer.stopAdapters(
09:50:39  	at org.picocontainer.DefaultPicoContainer.stop(
09:50:39  	at org.sonar.core.platform.ComponentContainer.stopComponents(
09:50:39  	at org.sonar.core.platform.ComponentContainer.execute(
09:50:39  	at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(
09:50:39  	at org.sonar.core.platform.ComponentContainer.startComponents(
09:50:39  	at org.sonar.core.platform.ComponentContainer.execute(
09:50:39  	at org.sonar.batch.bootstrapper.Batch.doExecute(
09:50:39  	at org.sonar.batch.bootstrapper.Batch.execute(
09:50:39  	at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(
09:50:39  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
09:50:39  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(
09:50:39  	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(
09:50:39  	at java.base/java.lang.reflect.Method.invoke(
09:50:39  	at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(
09:50:39  	at com.sun.proxy.$Proxy0.execute(Unknown Source)
09:50:39  	at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(
09:50:39  	at org.sonarsource.scanner.api.EmbeddedScanner.execute(
09:50:39  	at org.sonarsource.scanner.cli.Main.execute(
09:50:39  	at org.sonarsource.scanner.cli.Main.execute(
09:50:39  	at org.sonarsource.scanner.cli.Main.main(
09:50:39  Caused by: Connection refused: connect
09:50:39  	at java.base/ Method)
09:50:39  	at java.base/
09:50:39  	at java.base/
09:50:39  	at java.base/
09:50:39  	at java.base/
09:50:39  	at java.base/
09:50:39  	at java.base/
09:50:39  	at okhttp3.internal.platform.Platform.connectSocket(
09:50:39  	at okhttp3.internal.connection.RealConnection.connectSocket(
09:50:39  	... 46 common frames omitted
09:50:51  INFO: Analysis total time: 1:10.647 s
09:50:51  INFO: ------------------------------------------------------------------------
09:50:51  INFO: ------------------------------------------------------------------------
09:50:51  INFO: Total time: 1:11.530s
09:50:51  INFO: Final Memory: 23M/94M
09:50:51  INFO: ------------------------------------------------------------------------
[Pipeline] }
09:50:51  Deleting 1 temporary files
[Pipeline] // nodejs
[Pipeline] }
[Pipeline] // withSonarQubeEnv
[Pipeline] waitForQualityGate
09:50:54  Checking status of SonarQube task 'AXUmFujKYP1pakYm-MOh' on server 'SonarQube'
09:50:54  SonarQube task 'AXUmFujKYP1pakYm-MOh' status is 'SUCCESS'
09:50:54  SonarQube task 'AXUmFujKYP1pakYm-MOh' completed. Quality gate is 'OK' 
09:50:54  QualityGate.status returned from SonarQube for ui-layout: OK
09:50:54  currentBuild.result was set to: SUCCESS

Do you know of this issue? Do you have any suggestions why and how to solve this? Am I even be able to influence the behaviour somehow?

I’m planning to upgrade all the components (except Java) in the next weeks. If this solves this issue I will update my post.

Best regards

Hi Benjamin,

Welcome to the community!

The error you see happens after the analysis report is submitted to the server. I.E. analysis is done at that point, and some other process is taking over. You (very helpfully!) list that you’re using the Jenkins Sonar Quality Gates Plugin. Since that’s something that would happen after analysis, and since it’s not something we support (it’s not ours) could you start by uninstalling it and trying agian?