[
https://issues.apache.org/jira/browse/COMPRESS-705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18039646#comment-18039646
]
Gary D. Gregory commented on COMPRESS-705:
------------------------------------------
Hi [~niels.doucet]
I feel like we are getting close. I can cut a release candidate anytime but let
me check on of couple of things before I say 1, 2, or 4 weeks, or pick a random
date.
> GZip IOException: Extra subfield lenght exceeds remaining bytes in extra field
> ------------------------------------------------------------------------------
>
> Key: COMPRESS-705
> URL: https://issues.apache.org/jira/browse/COMPRESS-705
> Project: Commons Compress
> Issue Type: Bug
> Components: Compressors
> Affects Versions: 1.28.0
> Environment: $ sw_vers
>
> ProductName: macOS
> ProductVersion: 15.6
> BuildVersion: 24G84
> $ java -version
>
> java version "24.0.1" 2025-04-15
> Java(TM) SE Runtime Environment Oracle GraalVM 24.0.1+9.1 (build
> 24.0.1+9-jvmci-b01)
> Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 24.0.1+9.1 (build
> 24.0.1+9-jvmci-b01, mixed mode, sharing)
> Reporter: Mario Fredenhagen
> Priority: Major
> Fix For: 1.29.0
>
> Attachments: grafana-9.2.9.tgz
>
>
> We try to read the content of a helm chart via a method like this:
> {noformat}
> $ helm repo add grafana https://grafana.github.io/helm-charts && helm repo
> update grafana
> $ cd /tmp && helm pull grafana/grafana --version 9.2.9{noformat}
>
> {noformat}
> import org.apache.commons.compress.archivers.tar.TarArchiveInputStream;
> import org.apache.commons.compress.archivers.tar.TarArchiveEntry;
> import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream;
> import java.io.IOException;
> import java.nio.file.Files;
> import java.io.File;
> import java.util.ArrayList;
> import java.util.List;
> public class Main {
> public static void main(String[] args) throws IOException {
> var tarZippedArchive = new File("/tmp/grafana-9.2.9.tgz");
> var fileNames = getFileNamesFromTarGz(tarZippedArchive);
> fileNames.forEach(System.out::println);
> }
> private static List<String> getFileNamesFromTarGz(File tarZippedArchive)
> throws IOException {
> var fileNames = new ArrayList<String>();
> var input = Files.newInputStream(tarZippedArchive.toPath());
> try (TarArchiveInputStream tar = new TarArchiveInputStream(new
> GzipCompressorInputStream(input))) {
> TarArchiveEntry entry;
> while ((entry = tar.getNextEntry()) != null) {
> fileNames.add(entry.getName());
> }
> }
> return fileNames;
> }
> } {noformat}
> and get this error:
> {noformat}
> Exception in thread "main" java.io.IOException: Extra subfield lenght exceeds
> remaining bytes in extra: 21064 > 37
> at
> org.apache.commons.compress.compressors.gzip.ExtraField.fromBytes(ExtraField.java:154)
> at
> org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream.init(GzipCompressorInputStream.java:388)
> at
> org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream.<init>(GzipCompressorInputStream.java:273)
> at
> org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream.<init>(GzipCompressorInputStream.java:286)
> at Main.getFileNamesFromTarGz(Main.java:23)
> at Main.main(Main.java:15){noformat}
> The same was working with version 1.27.1, so it is a regression. Command-line
> utilities like `tar` can handle this archive without problems.
>
> Also note the typo in the exception message lenght > length ;)
--
This message was sent by Atlassian Jira
(v8.20.10#820010)