Error: Configure project sonarcloud - gitlab private repo - php

I’m trying to configure sonarcloud analysis by gitlab (private repository)

This is my sonar-project.properties

sonar.projectKey=xxx
sonar.organization=xxx
sonar.projectName=core-api
sonar.projectVersion=1.0
sonar.sources=src
sonar.sourceEncoding=UTF-8
sonar.language=php
sonar.login=xxx
sonar.host.url=https://sonarcloud.io

This is the result

sonar-scanner
INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: /builds/platinium-group/core-api/sonar-project.properties
INFO: SonarScanner 4.7.0.2747
INFO: Java 11.0.14 Alpine (64-bit)
INFO: Linux 5.4.0-92-generic amd64
INFO: User cache: /builds/platinium-group/core-api/.sonar/cache
INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: /builds/platinium-group/core-api/sonar-project.properties
INFO: Analyzing on SonarCloud
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Load global settings
INFO: Load global settings (done) | time=239ms
INFO: Server id: 1BD809FA-AWHW8ct9-T_TB3XqouNu
INFO: User cache: /builds/platinium-group/core-api/.sonar/cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=100ms
INFO: Load/download plugins (done) | time=678ms
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 12.175s
INFO: Final Memory: 6M/24M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
java.lang.IllegalStateException: Fail to download plugin [abap]. Pack200 error.
	at org.sonar.scanner.bootstrap.PluginFiles.unpack200(PluginFiles.java:173)
	at org.sonar.scanner.bootstrap.PluginFiles.download(PluginFiles.java:114)
	at org.sonar.scanner.bootstrap.PluginFiles.get(PluginFiles.java:75)
	at org.sonar.scanner.bootstrap.ScannerPluginInstaller.loadPlugins(ScannerPluginInstaller.java:70)
	at org.sonar.scanner.bootstrap.ScannerPluginInstaller.installRemotes(ScannerPluginInstaller.java:52)
	at org.sonar.scanner.bootstrap.ScannerPluginRepository.start(ScannerPluginRepository.java:45)
	at org.sonar.core.platform.StartableCloseableSafeLifecyleStrategy.start(StartableCloseableSafeLifecyleStrategy.java:26)
	at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84)
	at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169)
	at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132)
	at org.picocontainer.behaviors.Stored.start(Stored.java:110)
	at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1016)
	at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1009)
	at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:122)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
	at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:58)
	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:52)
	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:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
	at com.sun.proxy.$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:112)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
	at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: java.util.zip.ZipException: Corrupt GZIP trailer
	at java.base/java.util.zip.GZIPInputStream.readTrailer(GZIPInputStream.java:226)
	at java.base/java.util.zip.GZIPInputStream.read(GZIPInputStream.java:120)
	at java.base/java.io.BufferedInputStream.read1(BufferedInputStream.java:290)
	at java.base/java.io.BufferedInputStream.read(BufferedInputStream.java:351)
	at java.base/java.io.BufferedInputStream.fill(BufferedInputStream.java:252)
	at java.base/java.io.BufferedInputStream.read1(BufferedInputStream.java:292)
	at java.base/java.io.BufferedInputStream.read(BufferedInputStream.java:351)
	at java.base/com.sun.java.util.jar.pack.Utils.readMagic(Utils.java:291)
	at java.base/com.sun.java.util.jar.pack.NativeUnpack.run(NativeUnpack.java:237)
	at java.base/com.sun.java.util.jar.pack.NativeUnpack.run(NativeUnpack.java:248)
	at java.base/com.sun.java.util.jar.pack.UnpackerImpl.unpack(UnpackerImpl.java:115)
	at org.sonar.scanner.bootstrap.PluginFiles.unpack200(PluginFiles.java:171)
	... 29 more
ERROR: 
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
Cleaning up project directory and file based variables 00:00
ERROR: Job failed: exit code 1

Can you tell me if I’m doing something wrong or some params of configuration are missing, please?

Any update?

Is it normal when we use sonarcloud the scanner response with

java.lang.IllegalStateException: Fail to download plugin [abap]. Pack200 error.

I understand all infrastructure is configured.

Hey there.

Can you try using an older version of the sonar-scanner docker image (4.6)?

Thank you Colin!

With 4.6 it works fine!!!

Thanks. We’ve had a few reports of issues with 4.7 of the docker image. I’ve compiled a report internally so that somebody can take a look. In the meantime – you’re safe to use v4.6

Hey @pgrau

As an update – we discovered that the latest version of the docker image is affected by this bug in zlib. We expect a fix for this bug to be merged into Alpine Linux (the base image used in the docker image) soon, and will upgrade the docker image at the point a new release is cut. This work can be tracked here.

Until then:

  • Using v4.6 of the docker image is the best workaround
  • For any users who encounter this bug outside of a Docker context, double check their Linux distributions whether they have faulty zlib 1.2.12 installed (and upgrade/downgrade as appropriate)
1 Like