Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

zip file extracts without problems in 7zip, DotNetZip fails to open the archive (BZ_DATA_ERROR) #267

Open
basprins opened this issue Nov 2, 2022 · 0 comments

Comments

@basprins
Copy link

basprins commented Nov 2, 2022

We are facing an issue with DotNetZip. We create zip files and extract them on user interaction. We received an issue from a customer that extracting the zip failed.

We received the zip file, and tried to extract it. The problem reproduces. DotNetZip throws an exception


System.Exception : BZ_DATA_ERROR
   at Ionic.BZip2.BZip2InputStream.SetupBlock()
   at Ionic.BZip2.BZip2InputStream.init()
   at Ionic.Zip.ZipEntry.GetExtractDecompressor(Stream input2)
   at Ionic.Zip.ZipEntry.ExtractAndCrc(Stream archiveStream, Stream targetOutput, Int16 compressionMethod, Int64 compressedFileDataSize, Int64 uncompressedSize)
   at Ionic.Zip.ZipEntry.ExtractToStream(Stream archiveStream, Stream output, EncryptionAlgorithm encryptionAlgorithm, Int32 expectedCrc32)
   at Ionic.Zip.ZipEntry.InternalExtractToBaseDir(String baseDir, String password, ZipContainer zipContainer, ZipEntrySource zipEntrySource, String fileName)
   at Ionic.Zip.ZipFile._InternalExtractAll(String path, Boolean overrideExtractExistingProperty)

We can open the archive in 7zip, and extract it without any problem.

We create the archives as follows


            using var archive = new ZipFile(mainArchivePath);
            archive.CompressionLevel = Ionic.Zlib.CompressionLevel.BestSpeed; 
            archive.CompressionMethod = CompressionMethod.BZip2;

Is there experience with this problem? Any hints?

I attached the zip archive in case you would be interested to reproduce. We removed all files except the one file that gives this problem.

PS: The functionality which is zipping/unzipping is extensively world wide. We haven't received this issue before. So it occurs very rarely.

SYSTEM - SingleFile.zip

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant