DotNetZip.Semverd icon indicating copy to clipboard operation
DotNetZip.Semverd copied to clipboard

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

Open basprins opened this issue 2 years ago • 0 comments

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

basprins avatar Nov 02 '22 11:11 basprins