question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"invalid compressed data to inflate" on unzipping after addLocalFolder

See original GitHub issue

I create a new zip by adding a local directory as follows:

var zip = new AdmZip(symbolfile.oldSymbolfilePath),
    zipEntries = zip.getEntries(),
    bundleName,
    entry,
    match;

zipEntries.some(function(zipEntry) {
    match = zipEntry.entryName.match(/dSYMs\/(.+\.app\.dSYM)\/$/);

    if (match) {
        entry = zipEntry;
        return true;
    }
});

var newZip = new AdmZip(),
    tempDir = './tmp';

symbolfile.tempPath = path.resolve(path.join(tempDir, symbolfile.projectname, symbolfile.version, symbolfile.platform));
// Extract original ZIP to a temporary location.
zip.extractAllTo(symbolfile.tempPath);

newZip.addLocalFolder(path.join(symbolfile.tempPath, entry.entryName), bundleName);

console.log('Saving a new ZIP file to', symbolfile.targetPath);
newZip.writeZip(symbolfile.targetPath);

After a new zip file is written to a disk, I try to extract and it gives me the following error:

$ unzip BundleName.app.dSYM.zip
Archive:  /Users/user/BundleName.app.dSYM.zip
creating: BundleName.app.dSYM/Contents/
inflating: BundleName.app.dSYM/Contents/Info.plist
creating: BundleName.app.dSYM/Contents/Resources/
creating: BundleName.app.dSYM/Contents/Resources/DWARF/
inflating: BundleName.app.dSYM/Contents/Resources/DWARF/BundleName
error:  invalid compressed data to inflate

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:10

github_iconTop GitHub Comments

2reactions
pixelOneZerocommented, Jan 28, 2015

Does anyone know if this will be accepted into the build as an official fix?

1reaction
rainbow-alexcommented, Nov 10, 2014

Temporary workaround may be to use STORE mode (no compression), that worked.

To do so, I replaced Utils.Constants.DEFLATED with Utils.Constants.STORED in zipEntry.js on line 176. This worked fine for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to resolve "Invalid compressed data to inflate" error
Resolution: 1. First delete the corrupted unzipped file copied to the server. 2. Download the new monthly data file once again from Pitney...
Read more >
UNZIP error: invalid compressed data to inflate - Rocket Forum
We are trying to unzip a file on the zOS and the same error always occurs. Could it be due to the size...
Read more >
adm-zip - Bountysource
but when I decompress the zip file, the followed error occurred. error: invalid compressed data to inflate error: invalid compressed data to inflate....
Read more >
Unzipping of InfoSphere Information Server files from Passport ...
However, when trying to uncompress the file, the errors similar to "Error: invalid compressed data to inflate" or "...invalid compressed ...
Read more >
How To Work With Zip Files in Node.js - DigitalOcean
In this tutorial, you will use adm-zip module to compress, read, and decompress files. First, you'll combine multiple files into a ZIP ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found