1
votes

My process to use SonarQube:

  1. I installed SonarQube in Azure App Service and start it by StartSonar.bat.
  2. Add a new project and generate a token.
  3. Add service connection in Azure Devops with the token.
  4. Add SonarQube tasks in pipeline with process provide by https://docs.sonarqube.org/latest/analysis/scan/sonarscanner-for-azure-devops/.

When I run this pipeline, I got java.lang.IllegalStateException: Fail to download plugin error in SonarQubeAnalyze task, shown as following:

ERROR: Error during SonarQube Scanner execution java.lang.IllegalStateException: Fail to download plugin [kotlin] into C:\Users\VssAdministrator.sonar_tmp\fileCache6519814482966957451.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:77) at org.sonar.scanner.bootstrap.ScannerPluginInstaller.installRemotes(ScannerPluginInstaller.java:60) at org.sonar.scanner.bootstrap.ScannerPluginRepository.start(ScannerPluginRepository.java:59) at org.sonar.core.platform.StartableCloseableSafeLifecyleStrategy.start(StartableCloseableSafeLifecyleStrategy.java:40) 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)

The log shows that error was caused by java.net.SocketException: Connection reset (sometimes Read Timeout)

Caused by: java.net.SocketException: Connection reset at java.net.SocketInputStream.read(SocketInputStream.java:210) at java.net.SocketInputStream.read(SocketInputStream.java:141) at sun.security.ssl.InputRecord.readFully(InputRecord.java:465) at sun.security.ssl.InputRecord.readV3Record(InputRecord.java:593) at sun.security.ssl.InputRecord.read(InputRecord.java:532) at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:975) at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:933) at sun.security.ssl.AppInputStream.read(AppInputStream.java:105)

I have no idea about how this error happens or how to solve it.

Hope someone could help me, thank you.

2

2 Answers

0
votes

Please check if you have a sonar plugin added to your project. Also, add the sonar host url and token properties to the project and give it a try.

For maven :-

<sonar.host.url>sonar host url</sonar.host.url>
<sonar.login> token you generated on sonarqube server</sonar.login>

<plugin>
    <groupId>org.sonarsource.scanner.maven</groupId>
    <artifactId>sonar-maven-plugin</artifactId>
    <version>3.7.0.1746</version>
</plugin>
0
votes

I solved this issue by turn on Web Sockets in Azure App Service Configuration.