Sonarsource/sonarqube-scan-action@master failed to install sonar-scanner-cli

Hi Support team.
We are currently experiencing an issue after upgrading from sonarcloud-github-action to sonarqube-scan-action. We receive the error mv: cannot overwrite ‘/home/runner/work/_temp/sonar-scanner-cli-6.2.1.4610-Linux-X64/sonar-scanner-6.2.1.4610-linux-x64’: Directory not empty when the sonar-scanner-cli cache cannot be found and needs to be reinstalled in the self-hosted runner. could you please let me know why we are seeing this issue and how to fix this ? is it doable to remove /home/runner/work/_temp/sonar-scanner-cli-6.2.1.4610-Linux-X64 before running sonar scan, and will it cause any issue? We are using self-host runner that provisioned in AWS EC2
Logs:

Run sonarsource/sonarqube-scan-action@master

2 with:

3 projectBaseDir: .

4 args: -Dsonar.organization=aamc-org-github -Dsonar.sources=src -Dsonar.projectKey=aamc-org_ps-iam-oauth-client-secrets-nodejs-cdk -Dsonar.test.inclusions=“/testing/,/*.spec.ts,/*.test.ts” -Dsonar.javascript.lcov.reportPaths=./coverage/lcov.info -Dsonar.verbose=true -Dsonar.coverage.exclusions=“**/*spec.ts” -Dsonar.tests=src

5

6 scannerVersion: 6.2.1.4610

7 scannerBinariesUrl: https://binaries.sonarsource.com/Distribution/sonar-scanner-cli

8 env:

9 ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true

10 GITHUB_TOKEN: ***

11 SONAR_TOKEN: ***

12Run ${GITHUB_ACTION_PATH}/sanity-checks.sh

20Run actions/cache@v4.0.2

32Cache not found for input keys: sonar-scanner-cli-6.2.1.4610-Linux-X64

33Run ${GITHUB_ACTION_PATH}/install-sonar-scanner-cli.sh

42+ mkdir -p /home/runner/work/_temp/sonarscanner

43+ cd /home/runner/work/_temp/sonarscanner

44+ SCANNER_FILE_NAME=sonar-scanner-cli-6.2.1.4610-linux-x64.zip

45+ SCANNER_URI=https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.2.1.4610-linux-x64.zip

46+ command -v wget

47+ wget --no-verbose --user-agent=sonarqube-scan-action https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.2.1.4610-linux-x64.zip

482024-12-09 13:39:48 URL:https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.2.1.4610-linux-x64.zip [57996219/57996219] → “sonar-scanner-cli-6.2.1.4610-linux-x64.zip” [1]

49+ unzip -q sonar-scanner-cli-6.2.1.4610-linux-x64.zip

50+ mv sonar-scanner-6.2.1.4610-linux-x64 /home/runner/work/_temp/sonar-scanner-cli-6.2.1.4610-Linux-X64

51mv: cannot overwrite ‘/home/runner/work/_temp/sonar-scanner-cli-6.2.1.4610-Linux-X64/sonar-scanner-6.2.1.4610-linux-x64’: Directory not empty

1 Like