Exception while configuring sonarlint plugin with connected mode in eclipse

  • Operating system: Windows
  • SonarLint plugin version: 7.5.0.54140
  • Programming language you’re coding in: Java
  • Is connected mode used:
    • Connected to SonarCloud or SonarQube (and which version): SonarQube Developer Edition 9.4

And a thorough description of the problem / question:
I am trying to install sonar lint plugin in my eclipse and configure it in ‘Connected Mode’. The connection to sonarqube server is successful, but when it tries to download plugins from sonarqube server and store it my local storage it throws an exception.

Note that the same sonarqube server works in connected mode in Visual studio code’s sonar line plugin.

Kindly let me know if i am missing any configuration. Thanks in advance.

[SYNC] Downloading plugin 'sonar-abap-plugin-3.10.0.3628.jar'
GET 200 http://sonarserverip:9000/api/plugins/download?plugin=abap | response time=40ms
Unable to synchronize local storage for connection 'sonarserverip'
org.sonarsource.sonarlint.core.serverconnection.storage.StorageException: Cannot save plugin sonar-abap-plugin-3.10.0.3628.jar in C:\eclipse\.sonarlint\storage\31302e3134312e392e313333\plugins
	at org.sonarsource.sonarlint.core.serverconnection.storage.PluginsStorage.store(PluginsStorage.java:64)
	at org.sonarsource.sonarlint.core.serverconnection.PluginsSynchronizer.lambda$downloadPlugin$1(PluginsSynchronizer.java:70)
	at org.sonarsource.sonarlint.core.serverapi.plugins.PluginsApi.lambda$getPlugin$4(PluginsApi.java:57)
	at org.sonarsource.sonarlint.core.serverapi.ServerApiHelper.lambda$consumeTimed$6(ServerApiHelper.java:251)
	at org.sonarsource.sonarlint.core.serverapi.ServerApiHelper.processTimed(ServerApiHelper.java:226)
	at org.sonarsource.sonarlint.core.serverapi.ServerApiHelper.consumeTimed(ServerApiHelper.java:250)
	at org.sonarsource.sonarlint.core.serverapi.plugins.PluginsApi.getPlugin(PluginsApi.java:55)
	at org.sonarsource.sonarlint.core.serverconnection.PluginsSynchronizer.downloadPlugin(PluginsSynchronizer.java:70)
	at org.sonarsource.sonarlint.core.serverconnection.PluginsSynchronizer.downloadAll(PluginsSynchronizer.java:64)
	at org.sonarsource.sonarlint.core.serverconnection.PluginsSynchronizer.synchronize(PluginsSynchronizer.java:56)
	at org.sonarsource.sonarlint.core.serverconnection.LocalStorageSynchronizer.synchronize(LocalStorageSynchronizer.java:60)
	at org.sonarsource.sonarlint.core.serverconnection.ServerConnection.sync(ServerConnection.java:131)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.sync(ConnectedSonarLintEngineImpl.java:291)
	at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacade.sync(ConnectedEngineFacade.java:599)
	at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacade.lambda$39(ConnectedEngineFacade.java:627)
	at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacade.doWithEngine(ConnectedEngineFacade.java:208)
	at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacade.autoSync(ConnectedEngineFacade.java:626)
	at org.sonarlint.eclipse.ui.internal.job.PeriodicStoragesSynchronizerJob.run(PeriodicStoragesSynchronizerJob.java:60)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.net.SocketException: Connection reset
	at java.base/java.net.SocketInputStream.read(SocketInputStream.java:186)
	at java.base/java.net.SocketInputStream.read(SocketInputStream.java:140)
	at okio.Okio$2.read(Okio.java:140)
	at okio.AsyncTimeout$2.read(AsyncTimeout.java:237)
	at okio.RealBufferedSource.read(RealBufferedSource.java:51)
	at okhttp3.internal.http1.Http1ExchangeCodec$AbstractSource.read(Http1ExchangeCodec.java:389)
	at okhttp3.internal.http1.Http1ExchangeCodec$ChunkedSource.read(Http1ExchangeCodec.java:475)
	at okhttp3.internal.connection.Exchange$ResponseBodySource.read(Exchange.java:286)
	at okio.RealBufferedSource$1.read(RealBufferedSource.java:447)
	at java.base/java.io.InputStream.read(InputStream.java:205)
	at org.sonarsource.sonarlint.shaded.org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1309)
	at org.sonarsource.sonarlint.shaded.org.apache.commons.io.IOUtils.copy(IOUtils.java:978)
	at org.sonarsource.sonarlint.shaded.org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1282)
	at org.sonarsource.sonarlint.shaded.org.apache.commons.io.IOUtils.copy(IOUtils.java:953)
	at org.sonarsource.sonarlint.shaded.org.apache.commons.io.FileUtils.copyToFile(FileUtils.java:1043)
	at org.sonarsource.sonarlint.shaded.org.apache.commons.io.FileUtils.copyInputStreamToFile(FileUtils.java:952)
	at org.sonarsource.sonarlint.core.serverconnection.storage.PluginsStorage.store(PluginsStorage.java:52)
	... 18 more

Hello Karthik,

Thanks for raising this. We don’t use the same HTTP client implementation between SonarLint Eclipse and VSCode.

Do you use the same JDK ? If not could you try to use the same ? Do you have any software installed on your machine that checks network traffic and could close the connection ? I’m thinking some kind of antivirus that sometimes scan the network traffic

Thanks Damien for your response.

JDK version looks to be different between Eclipse and VSCode.
Eclipse uses JDK11, but VSCode uses JDK17 internally which was not explicitly configured.
Could you please let me know the correct version of sonarlint eclipse plugin to work with JDK11. I had tried with sonarlint versions of 7.5, 7.4, 7.3 and 7.2. All are throwing similar errors as it thrown earlier.

May i know how could i find if any softwares blocking the network traffic here? Since VSCode does work on the same machine without any issues, i believe that there is no issue with network.

You should always use the latest version, which is 7.5 to date.

The connection gets closed when SonarLint tries to download plugins from the server, it doesn’t seem to be a problem within SonarLint. Could you try to monitor network traffic with a tool like Wireshark, and try to see if there is a difference between VSCode and Eclipse HTTP requests ?