-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Files extracted from zip are currupt #271
Comments
I have another code sample. Unzipping works when you send the zip file as one large chunk, but not when you slice it like this (I discovered this by piping the file from https download, so I suppose these are some transmission window sizes). Code: const fs = require("node:fs");
const unzipper = require("unzipper");
const data = fs.readFileSync("a.zip");
const extractor = unzipper.Extract({ path: "./test" });
extractor.write(Uint8Array.prototype.slice.call(data, 0, 1378));
extractor.write(Uint8Array.prototype.slice.call(data, 1378, 1378 * 2));
extractor.write(Uint8Array.prototype.slice.call(data, 1378 * 2, 1378 * 3));
extractor.write(Uint8Array.prototype.slice.call(data, 1378 * 3)); The zipfile: a.zip As a result, the Corrupted file
Node: 18.16.0 |
The build started failing due to changes in the Azure Build agent, as reported at actions/runner-images#7467 It appears that the underlying problem is a bug in the Node library being used to extract files from packages: ZJONSSON/node-unzipper#271 The problem was that this corrupted some of the files being unpacked. This meant that when we tried to run `func` we got errors complaining about an invalid executable. Although it looks like the underlying issue has not yet been fixed, the comment at actions/runner-images#7467 (comment) suggests that a new build agent image has been created that will not run into this problem. (Presumably they've done something to avoid the problematic package.) This means we should no longer need our workaround.
The build started failing due to changes in the Azure Build agent, as reported at actions/runner-images#7467 It appears that the underlying problem is a bug in the Node library being used to extract files from packages: ZJONSSON/node-unzipper#271 The problem was that this corrupted some of the files being unpacked. This meant that when we tried to run `func` we got errors complaining about an invalid executable. Although it looks like the underlying issue has not yet been fixed, the comment at actions/runner-images#7467 (comment) suggests that a new build agent image has been created that will not run into this problem. (Presumably they've done something to avoid the problematic package.) This means we should no longer need our workaround.
The existing lib was erratic with node 18. Using `adm-zip` instead. Relates to ZJONSSON/node-unzipper#271
Downgrading to 18.14.0 fixed issues for me. |
Same situation for me after update Node 16 to Node 18.16.0. This is the Node changelog for Node 18.16. https://github.com/nodejs/node/releases/tag/v18.16.0 @ZJONSSON can you help me to identify the cause, please? |
unzipper is broken with Node v18.16 (ZJONSSON/node-unzipper#271)
Same thing is happening on Node 20.7.0, using unzipper version 0.10.14. In my case it's usually blocks of 2^14 bytes that are being swapped, but it also happens with files much smaller than this. Would love to see this fixed, as Node 16 has reached end-of-life. There are alternatives, but I really like unzipper's api best, especially the ability to stream archived data without loading it into a buffer first. Very cool! |
Very simple application here, all data corrupted by this library |
unzipper is broken with Node v18.16 (ZJONSSON/node-unzipper#271)
Same issue here. |
Also same issue, if I didn't find this page I would have wasted many more hours debugging. |
CR v20.10.0 |
same issue here. all data corrupted by this library. please fix it. |
https://www.npmjs.com/package/yauzl#no-streaming-unzip-api - wondering if that's the reason? |
node-unzipper is broken on nodejs > 18.15.0, corrupting files related: ZJONSSON/node-unzipper#271
So is this library dead? Same issas as almost a year later |
Thanks @dy-dx for identifying the underlying issue as a bug with As far as extract goes we have moved from unmaintained |
previous bug should be fixed in recent node versions b03e462 ZJONSSON/node-unzipper#271 (comment)
The extracted files are getting corrupts, this started to happen after upgrading from Node 18 to Node.js 19.8.1 on Windows 10 (haven't tested if broader issue)
Below is a code sample to reproduce the issue. Have incorporated the decompress library to demonstrate an non-corrupt file
The text was updated successfully, but these errors were encountered: