Fail to download sonar-scanner-engine-shaded-

Hello and thanks for reading,

This is how I have installed my sonar-scanner:

set -e
wget -O /tmp/sonar-scanner-cli-${SONAR_SCANNER_VERSION} "${SONAR_SCANNER_VERSION}" \
    && unzip /tmp/sonar-scanner-cli-${SONAR_SCANNER_VERSION} -d /etc/lib/ \
    && rm /tmp/sonar-scanner-cli-${SONAR_SCANNER_VERSION} \
    && ln -s /etc/lib/sonar-scanner-${SONAR_SCANNER_VERSION}-linux/bin/sonar-scanner /usr/local/bin/sonar-scanner

I use it within Debian buster,

I expect the analysis to pass,

Instead I have the analysis that fail with:

 ERROR: Error during SonarQube Scanner execution
 org.sonarsource.scanner.api.internal.ScannerException: Unable to execute SonarQube
 	at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.lambda$createLauncher$0(
 	at java.base/ Method)
 	at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher(
 	at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher(
 	at org.sonarsource.scanner.api.EmbeddedScanner.doStart(
 	at org.sonarsource.scanner.api.EmbeddedScanner.start(
 	at org.sonarsource.scanner.cli.Main.execute(
 	at org.sonarsource.scanner.cli.Main.main(
 Caused by: java.lang.IllegalStateException: Fail to download sonar-scanner-engine-shaded- 

I am using Version

Any idea what is causing that error ?

Thanks a lot for your help

Hello @Kopax_Anderson,

I can’t be sure but I am suspecting that you installed the scanner in a location where the scanner has no write access. When ran, the scanner downloads on a local cache the plugins from SonarQube.
The local cache location is by default $HOME/.sonar

You can relocate the cache location by setting the environment variable $SONAR_USER_HOME to a location the scanner will be able to write. Can you check if that fixes your problem.
See also: Why is analysis “User cache” set to a strange value, and how can I set it to be cleared? :wink: