java.lang.IllegalStateException: Fail to download plugin [iac] into /opt/sonar-scanner/.sonar/_tmp/fileCache2582033732133438722.tmp

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    SQ: * Community Edition Version 9.3 (build 51899)
  • what are you trying to achieve
    Scan maven repo
  • what have you tried so far to achieve this
    Using Github actions tried to scan a maven repo. Created a sonar.properties file and build.yaml

sonar.projectKey=HELLOWORLD

build.yml

name: Build-HELLOWORLD
on:
push:
branches:
- main # or the name of your main branch
jobs:
build:
name: Build-HELLOWORLD
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: sonarsource/sonarqube-scan-action@master
with:
args: >
-Dsonar.verbose=true
-Dsonar.ws.timeout=360
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: https://sonarqubeinternal.XXXXX.org

Below Error

with:

19:57:05.407 INFO: Final Memory: 5M/20M

68java.lang.IllegalStateException: Fail to download plugin [iac] into /opt/sonar-scanner/.sonar/_tmp/fileCache2582033732133438722.tmp

This is my env
Running SQ CE - * Community Edition

  • Version 9.3 (build 51899) on Ec2-instance.
    AWS Loadbalancer Controller

using this Github action file to trigger analysis on Sonar host

name: Hello World-GITHUBRUNNER
on:
push:
branches:
- main # or the name

jobs:
build:
name: Hello World-GITHUBRUNNER
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Cache SonarQube packages
uses: actions/cache@v1
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Maven packages
uses: actions/cache@v1
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles(’**/pom.xml’) }}
restore-keys: ${{ runner.os }}-m2
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: SONAR HOSTURL
run: *mvn -X -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.web.http.keepAliveTimeout=3600 -Dsonar.projectKey=github-runner-repo```

I’ve increased the time-out on AWS Loadbalancer in AWS Console to 3600 & passed this -Dsonar.web.http.keepAliveTimeout=3600 argument in the command but still action fails with plugin download error

[DEBUG] 17:38:48.123 GET 200 [https://sonarqubeinternal.XXXXXX.org/api/plugins/download?plugin=web&acceptCompressions=pack200](https://sonarqubeinternal.xxxxxx.org/api/plugins/download?plugin=web&acceptCompressions=pack200) | time=48ms

[2788](https://github.com/repo-org/github-runner-repo/runs/5574325129?check_suite_focus=true#step:6:2788)[DEBUG] 17:38:48.610 Download plugin ‘iac’ to ‘/home/runner/.sonar/_tmp/fileCache1103158437726286267.tmp’
[DEBUG] 17:38:48.659 GET 200 [https://sonarqubeinternal.XXXXXXX.org/api/plugins/download?plugin=iac&acceptCompressions=pack200](https://sonarqubeinternal.xxxxxxx.org/api/plugins/download?plugin=iac&acceptCompressions=pack200) | time=48ms

[2790](https://github.com/repo-org/github-runner-repo/runs/5574325129?check_suite_focus=true#step:6:2790)[INFO] 17:43:48.663 Load/download plugins (done) | time=308827ms

[2791](https://github.com/repo-org/github-runner-repo/runs/5574325129?check_suite_focus=true#step:6:2791)[INFO] ------------------------------------------------------------------------

[2792](https://github.com/repo-org/github-runner-repo/runs/5574325129?check_suite_focus=true#step:6:2792)[INFO] BUILD FAILURE

Error: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar (default-cli) on project helloworld: Fail to download plugin [iac] into /home/runner/.sonar/_tmp/fileCache1103158437726286267.tmp: timeout: Socket closed → [Help 1]

How to resolve it?

Thanks,
Srikanth

Hi Srikanth,

Your log is showing a 200 response for the plugin. I would talk to your network folks about this to see if there’s something interfering with the request.

 
Ann

We are also facing a similar issue.

Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar (default-cli) on project xxxx-xxxxxxx: Fail to download plugin [javascript] into /home/runner/.sonar/_tmp/fileCache13033292672026628544.tmp: stream was reset: INTERNAL_ERROR → [Help 1]

Can someone please help us in fixing this.

@raosri1992 Were you able to fix your issue?

6 posts were split to a new topic: Slow plugin download