Unable to install sonarscanner plugin for MSBuild from jenkins pipeline

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    Sonarqube 9.9.1, SonarScanner for MSBuild
  • Sonarqube deployed in docker container
  • Integrate with Jenkins (Jenkins is also deployed in a docker container)

Jenkins Pipeline

  •   stage('SonarQube Analysis') {
      	environment{
      		def scannerHome = tool 'SonarScanner for MSBuild 5.13'}
      	steps{
      		withSonarQubeEnv('Sonarqube-Test') {
      			bat "dotnet ${scannerHome}\\SonarScanner.MSBuild.dll begin /k:\"DCU-WEB\""
      			bat "dotnet build"
      			bat "dotnet ${scannerHome}\\SonarScanner.MSBuild.dll end"
      		}
      	}
      }
    

Logs
[Pipeline] // script
[Pipeline] }
[Pipeline] // dir
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (SonarQube Analysis)
[Pipeline] tool
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (replace-token)
Stage “replace-token” skipped due to earlier failure(s)
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
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 java.base/sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:484)
at java.base/sun.security.ssl.SSLSocketInputRecord.readHeader(SSLSocketInputRecord.java:478)
at java.base/sun.security.ssl.SSLSocketInputRecord.decode(SSLSocketInputRecord.java:160)
at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:111)
at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1507)
at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1417)
at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:456)
at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:427)
at java.base/sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:572)
at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:201)
at java.base/sun.net.www.protocol.http.HttpURLConnection.followRedirect0(HttpURLConnection.java:2802)
at java.base/sun.net.www.protocol.http.HttpURLConnection.followRedirect(HttpURLConnection.java:2714)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1854)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1520)
at java.base/java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:527)
at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:334)
at hudson.FilePath.installIfNecessaryFrom(FilePath.java:1006)
Also: org.jenkinsci.plugins.workflow.actions.ErrorAction$ErrorId: c71b3e27-02bf-4114-871d-dafc601d8cc4
Caused: java.io.IOException: Failed to install https://github.com/SonarSource/sonar-scanner-msbuild/releases/download/5.13.0.66756/sonar-scanner-msbuild-5.13.0.66756-netcoreapp2.0.zip to C:\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\SonarScanner_for_MSBuild_5.13
at hudson.FilePath.installIfNecessaryFrom(FilePath.java:1067)
at hudson.FilePath.installIfNecessaryFrom(FilePath.java:980)
at hudson.tools.DownloadFromUrlInstaller.performInstallation(DownloadFromUrlInstaller.java:77)
at hudson.tools.InstallerTranslator.getToolHome(InstallerTranslator.java:70)
at hudson.tools.ToolLocationNodeProperty.getToolHome(ToolLocationNodeProperty.java:109)
at hudson.tools.ToolInstallation.translateFor(ToolInstallation.java:221)
at hudson.plugins.sonar.MsBuildSQRunnerInstallation.forNode(MsBuildSQRunnerInstallation.java:93)
at hudson.plugins.sonar.MsBuildSQRunnerInstallation.forNode(MsBuildSQRunnerInstallation.java:44)
at org.jenkinsci.plugins.workflow.steps.ToolStep$Execution.run(ToolStep.java:157)
at org.jenkinsci.plugins.workflow.steps.ToolStep$Execution.run(ToolStep.java:138)
at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)

GitHub has been notified of this commit’s build result

Finished: FAILURE

Hey there.

I believe GitHub had some incidents yesterday – are you still facing the issue?

I discovered the issue, and it’s not related to GitHub.
Apparently, the plugin can’t be installed in the docker container while running the Jenkins job.
I had to rebuild the docker image with installation steps for plugins.