Fail to download sonar-scanner-engine-shaded-10.3.0.82913-all.jar to /<anylocation>/

SonarQube deployed on github actions. using the latest version of sonarqube. Trying to run sonarqube on github actions. It seems there isnt much to go on with this error, but I already redid the whole setup 3 times and I heard about some write permission issues which could be related to it? Any kind of assistance is appreciated.

here’s the log file,

INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: /github/workspace/sonar-project.properties
12:23:14.534 INFO: SonarScanner 5.0.1.3006
12:23:14.545 INFO: Java 17.0.8 Alpine (64-bit)
12:23:14.545 INFO: Linux 6.2.0-1019-azure amd64
12:23:14.693 DEBUG: keyStore is :
12:23:14.694 DEBUG: keyStore type is : pkcs12
12:23:14.694 DEBUG: keyStore provider is :
12:23:14.694 DEBUG: init keystore
12:23:14.695 DEBUG: init keymanager of type SunX509
12:23:14.794 DEBUG: Create: /opt/sonar-scanner/.sonar/cache
12:23:14.795 INFO: User cache: /opt/sonar-scanner/.sonar/cache
12:23:14.795 DEBUG: Create: /opt/sonar-scanner/.sonar/cache/_tmp
12:23:14.802 DEBUG: Extract sonar-scanner-api-batch in temp...
12:23:14.806 DEBUG: Get bootstrap index...
12:23:14.806 DEBUG: Download: ***/batch/index
12:23:15.857 DEBUG: Get bootstrap completed
12:23:15.861 DEBUG: Download ***/batch/file?name=sonar-scanner-engine-shaded-10.3.0.82913-all.jar to /opt/sonar-scanner/.sonar/cache/_tmp/fileCache13960506048782843013.tmp
12:23:21.390 DEBUG: Create isolated classloader...
12:23:21.402 DEBUG: Start temp cleaning...
12:23:21.405 DEBUG: Temp cleaning done
12:23:21.406 DEBUG: Execution getVersion
12:23:21.422 INFO: Analyzing on SonarQube server 10.3.0.82913
12:23:21.422 INFO: Default locale: "en_US", source code encoding: "UTF-8" (analysis is platform dependent)
12:23:21.423 DEBUG: Work directory: /github/workspace/.scannerwork
12:23:21.425 DEBUG: Execution execute
12:23:21.777 DEBUG: Community 10.3.0.82913
12:23:22.037 INFO: Load global settings
12:23:23.043 DEBUG: GET 200 ***/api/settings/values.protobuf | time=1003ms
12:23:23.078 INFO: Load global settings (done) | time=1041ms
12:23:23.081 INFO: Server id: 147B411E-AY1kYm3IJLiYJLdJsfDH
12:23:23.085 DEBUG: Create : /opt/sonar-scanner/.sonar/_tmp
12:23:23.085 INFO: User cache: /opt/sonar-scanner/.sonar/cache
12:23:23.089 INFO: Load/download plugins
12:23:23.089 INFO: Load plugins index
12:23:23.322 DEBUG: GET 200 ***/api/plugins/installed | time=233ms
12:23:23.382 INFO: Load plugins index (done) | time=293ms
12:23:23.384 DEBUG: Download plugin 'csharp' to '/opt/sonar-scanner/.sonar/_tmp/fileCache2069363227400530798.tmp'
12:23:23.615 DEBUG: GET 200 ***/api/plugins/download?plugin=csharp | time=231ms
12:23:25.684 DEBUG: Download plugin 'cayc' to '/opt/sonar-scanner/.sonar/_tmp/fileCache1594305774256507547.tmp'
12:23:25.914 DEBUG: GET 200 ***/api/plugins/download?plugin=cayc | time=229ms
12:23:25.926 DEBUG: Download plugin 'config' to '/opt/sonar-scanner/.sonar/_tmp/fileCache9949249959494058386.tmp'
12:23:26.155 DEBUG: GET 200 ***/api/plugins/download?plugin=config | time=228ms
12:23:26.159 DEBUG: Download plugin 'flex' to '/opt/sonar-scanner/.sonar/_tmp/fileCache840449018184734026.tmp'
12:23:26.388 DEBUG: GET 200 ***/api/plugins/download?plugin=flex | time=229ms
12:23:26.414 DEBUG: Download plugin 'go' to '/opt/sonar-scanner/.sonar/_tmp/fileCache14343126879358571265.tmp'
12:23:26.644 DEBUG: GET 200 ***/api/plugins/download?plugin=go | time=230ms
12:23:27.332 DEBUG: Download plugin 'web' to '/opt/sonar-scanner/.sonar/_tmp/fileCache6080359013663939432.tmp'
12:23:27.561 DEBUG: GET 200 ***/api/plugins/download?plugin=web | time=229ms
12:23:27.574 DEBUG: Download plugin 'iac' to '/opt/sonar-scanner/.sonar/_tmp/fileCache2280569482692730222.tmp'
12:23:27.802 DEBUG: GET 200 ***/api/plugins/download?plugin=iac | time=228ms
12:23:27.836 DEBUG: Download plugin 'jacoco' to '/opt/sonar-scanner/.sonar/_tmp/fileCache5584185012937608347.tmp'
12:23:28.065 DEBUG: GET 200 ***/api/plugins/download?plugin=jacoco | time=229ms
12:23:28.069 DEBUG: Download plugin 'java' to '/opt/sonar-scanner/.sonar/_tmp/fileCache3717615229549101998.tmp'
12:23:28.298 DEBUG: GET 200 ***/api/plugins/download?plugin=java | time=228ms
12:23:29.680 DEBUG: Download plugin 'javascript' to '/opt/sonar-scanner/.sonar/_tmp/fileCache10557600115428215835.tmp'
12:23:29.914 DEBUG: GET 200 ***/api/plugins/download?plugin=javascript | time=234ms
12:23:31.544 DEBUG: Download plugin 'kotlin' to '/opt/sonar-scanner/.sonar/_tmp/fileCache14184769130590879317.tmp'
12:23:31.774 DEBUG: GET 200 ***/api/plugins/download?plugin=kotlin | time=229ms
12:23:32.026 INFO: Load/download plugins (done) | time=8937ms
12:23:32.042 INFO: ------------------------------------------------------------------------
12:23:32.042 INFO: EXECUTION FAILURE
12:23:32.042 INFO: ------------------------------------------------------------------------
12:23:32.043 INFO: Total time: 17.563s
12:23:32.068 INFO: Final Memory: 6M/27M
12:23:32.068 INFO: ------------------------------------------------------------------------
12:23:32.069 ERROR: Error during SonarScanner execution
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.sonarsource.scanner.api.internal.IsolatedClassloader@67a20f67-org.sonar.scanner.bootstrap.ScannerPluginRepository': Initialization of bean failed; nested exception is java.lang.IllegalStateException: Fail to download plugin [kotlin] into /opt/sonar-scanner/.sonar/_tmp/fileCache14184769130590879317.tmp
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:628)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:920)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
    at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:200)
    at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:180)
    at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:71)
    at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:65)
    at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
    at jdk.proxy1/jdk.proxy1.$Proxy0.execute(Unknown Source)
    at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
    at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
    at org.sonarsource.scanner.cli.Main.execute(Main.java:126)
    at org.sonarsource.scanner.cli.Main.execute(Main.java:81)
    at org.sonarsource.scanner.cli.Main.main(Main.java:62)
Caused by: java.lang.IllegalStateException: Fail to download plugin [kotlin] into /opt/sonar-scanner/.sonar/_tmp/fileCache14184769130590879317.tmp
    at org.sonar.scanner.bootstrap.PluginFiles.downloadBinaryTo(PluginFiles.java:144)
    at org.sonar.scanner.bootstrap.PluginFiles.download(PluginFiles.java:106)
    at org.sonar.scanner.bootstrap.PluginFiles.get(PluginFiles.java:88)
    at org.sonar.scanner.bootstrap.ScannerPluginInstaller.loadPlugins(ScannerPluginInstaller.java:78)
    at org.sonar.scanner.bootstrap.ScannerPluginInstaller.installRemotes(ScannerPluginInstaller.java:61)
    at org.sonar.scanner.bootstrap.ScannerPluginRepository.start(ScannerPluginRepository.java:63)
    at org.sonar.core.platform.StartableBeanPostProcessor.postProcessBeforeInitialization(StartableBeanPostProcessor.java:33)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:440)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620)
    ... 24 more
Caused by: java.net.ProtocolException: unexpected end of stream
    at okhttp3.internal.http1.Http1ExchangeCodec$ChunkedSource.read(Http1ExchangeCodec.kt:423)
    at okhttp3.internal.connection.Exchange$ResponseBodySource.read(Exchange.kt:281)
    at okio.RealBufferedSource$inputStream$1.read(RealBufferedSource.kt:161)
    at java.base/java.io.InputStream.read(InputStream.java:218)
    at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1485)
    at org.apache.commons.io.IOUtils.copy(IOUtils.java:1105)
    at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1458)
    at org.apache.commons.io.IOUtils.copy(IOUtils.java:1083)
    at org.apache.commons.io.FileUtils.copyToFile(FileUtils.java:1030)
    at org.apache.commons.io.FileUtils.copyInputStreamToFile(FileUtils.java:938)
    at org.sonar.scanner.bootstrap.PluginFiles.downloadBinaryTo(PluginFiles.java:142)
... 33 more
12:23:32.079 ERROR:
12:23:32.080 ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.

Hi,

My bet is that you have something “helpful” on your network interfering here. I’ll (further) bet that if you check the $SONARQUBE-HOME/logs/access.log, you’ll see a 200 status for that plugin download. Meaning that SonarQube sent it, but it got fumbled in the middle.

You should probably talk to your network folks.

 
HTH,
Ann