Sonar Scanner network issue

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
  • what are you trying to achieve
  • what have you tried so far to achieve this

Hi,
I have set up SonarQube on a server and trying to scan files from my laptop.
The server instance works fine and there is no issue.

However, wen I try to scan from my laptop by connecting to the SonarQube server instance it fails.
I’m using “sonar-scanner-cli-3.3.0.1492-windows” version for the scanner and sonarqube-7.6 for the server.
Is this a network connectivity issue ? How can we fix this please ?

C:\pharmacy>
C:\pharmacy>
C:\pharmacy>sonar-scanner -X
12:01:36.718 INFO: Scanner configuration file: C:\sonar-scanner\bin\..\conf\sonar-scanner.properties
12:01:36.725 INFO: Project root configuration file: NONE
12:01:36.762 INFO: SonarQube Scanner 3.3.0.1492
12:01:36.762 INFO: Java 1.8.0_121 Oracle Corporation (64-bit)
12:01:36.762 INFO: Windows 10 10.0 amd64
12:01:37.001 DEBUG: keyStore is :
12:01:37.002 DEBUG: keyStore type is : jks
12:01:37.002 DEBUG: keyStore provider is :
12:01:37.002 DEBUG: init keystore
12:01:37.004 DEBUG: init keymanager of type SunX509
12:01:37.904 DEBUG: Create: C:\Users\SESA475934\.sonar\cache
12:01:37.914 INFO: User cache: C:\Users\SESA475934\.sonar\cache
12:01:37.915 DEBUG: Create: C:\Users\SESA475934\.sonar\cache\_tmp
12:01:37.919 DEBUG: Extract sonar-scanner-api-batch in temp...
12:01:37.931 DEBUG: Get bootstrap index...
12:01:37.931 DEBUG: Download: http://wswftdit4966.gad.schneider-electric.com:8081/sonarqube-dev/batch/index
12:01:39.619 DEBUG: Get bootstrap completed
12:01:39.675 DEBUG: Create isolated classloader...
12:01:39.700 DEBUG: Start temp cleaning...
12:01:39.718 DEBUG: Temp cleaning done
12:01:39.720 DEBUG: Execution getVersion
12:01:39.728 INFO: SonarQube server 7.6.0
12:01:39.729 INFO: Default locale: "en_US", source code encoding: "windows-1252" (analysis is platform dependent)
12:01:39.730 DEBUG: Work directory: C:\pharmacy\.scannerwork
12:01:39.732 DEBUG: Execution execute
12:01:40.659 INFO: Load global settings
12:01:41.580 DEBUG: GET 200 http://wswftdit4966.gad.schneider-electric.com:8081/sonarqube-dev/api/settings/values.protobuf | time=909ms
12:01:41.621 INFO: Load global settings (done) | time=962ms
12:01:41.624 INFO: Server id: E176CC90-AWlW5bLAF7fIbeCVydml
12:01:41.677 INFO: User cache: C:\Users\SESA475934\.sonar\cache
12:01:41.907 INFO: Load/download plugins
12:01:41.907 INFO: Load plugins index
12:01:43.233 DEBUG: GET 200 http://wswftdit4966.gad.schneider-electric.com:8081/sonarqube-dev/api/plugins/installed | time=1325ms
12:01:43.326 INFO: Load plugins index (done) | time=1419ms
12:01:43.356 DEBUG: Download plugin 'cssfamily' to 'C:\Users\SESA475934\.sonar\_tmp\fileCache1845549410849498600.tmp'
12:01:43.897 DEBUG: GET 200 http://wswftdit4966.gad.schneider-electric.com:8081/sonarqube-dev/api/plugins/download?plugin=cssfamily&acceptCompressions=pack200 | time=536ms
12:01:44.689 INFO: Load/download plugins (done) | time=2783ms
12:01:44.703 INFO: ------------------------------------------------------------------------
12:01:44.703 INFO: EXECUTION FAILURE
12:01:44.704 INFO: ------------------------------------------------------------------------
12:01:44.707 INFO: Total time: 8.061s
12:01:44.747 INFO: Final Memory: 38M/121M
12:01:44.748 INFO: ------------------------------------------------------------------------
12:01:44.748 ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: Fail to download plugin [cssfamily] into C:\Users\SESA475934\.sonar\_tmp\fileCache1845549410849498600.tmp
        at org.sonar.scanner.bootstrap.PluginFiles.downloadBinaryTo(PluginFiles.java:152)
        at org.sonar.scanner.bootstrap.PluginFiles.download(PluginFiles.java:108)
        at org.sonar.scanner.bootstrap.PluginFiles.get(PluginFiles.java:89)
        at org.sonar.scanner.bootstrap.ScannerPluginInstaller.loadPlugins(ScannerPluginInstaller.java:80)
        at org.sonar.scanner.bootstrap.ScannerPluginInstaller.installRemotes(ScannerPluginInstaller.java:62)
        at org.sonar.scanner.bootstrap.ScannerPluginRepository.start(ScannerPluginRepository.java:59)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110)
        at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89)
        at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84)
        at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169)
        at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132)
        at org.picocontainer.behaviors.Stored.start(Stored.java:110)
        at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1016)
        at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1009)
        at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
        at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:73)
        at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
        at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        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:185)
        at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:137)
        at org.sonarsource.scanner.cli.Main.execute(Main.java:111)
        at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
        at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: java.net.SocketException: Connection reset
        at java.net.SocketInputStream.read(SocketInputStream.java:210)
        at java.net.SocketInputStream.read(SocketInputStream.java:141)
        at okio.Okio$2.read(Okio.java:138)
        at okio.AsyncTimeout$2.read(AsyncTimeout.java:236)
        at okio.RealBufferedSource.read(RealBufferedSource.java:45)
        at okhttp3.internal.http1.Http1Codec$ChunkedSource.read(Http1Codec.java:429)
        at okio.RealBufferedSource$1.read(RealBufferedSource.java:429)
        at java.io.InputStream.read(InputStream.java:101)
        at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:2314)
        at org.apache.commons.io.IOUtils.copy(IOUtils.java:2270)
        at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:2291)
        at org.apache.commons.io.IOUtils.copy(IOUtils.java:2246)
        at org.apache.commons.io.FileUtils.copyToFile(FileUtils.java:1530)
        at org.apache.commons.io.FileUtils.copyInputStreamToFile(FileUtils.java:1506)
        at org.sonar.scanner.bootstrap.PluginFiles.downloadBinaryTo(PluginFiles.java:150)
        ... 34 more

Thanks,
Arka

Hi Arka,

It looks like analysis failed with a timeout downloading the first plugin. I would start by trying to manually download the failed plugin ( http://wswftdit4966.gad.schneider-electric.com:8081/sonarqube-dev/api/plugins/download?plugin=cssfamily&acceptCompressions=pack200) and see whether you’re successful and how long it it takes. That plugin downloads for me in a couple seconds from from our test server which I’m pretty sure is located in Europe (I’m not, at the moment).

Assuming the manual download takes a similarly-significant time, it’s probably time to look at your network. BTW, I can’t offer any pointers there. Hopefully you have Ops folks that can help you with that.

 
Ann

Hi Ann,
Yes, I tried downloading the plugin from the browser and it fails there too. Error says "Failed Network Error’. So it does seem like something is blocking the download from the server which is a EC2 instance. Just not sure what exactly it is. Maybe a firewall rule or something ?
Let me check with n/w guys.
Thanks for your help.

Arka