node-unzip icon indicating copy to clipboard operation
node-unzip copied to clipboard

Invalid signature: 0x8080014 when piping from HTTP

Open Cyberuben opened this issue 9 years ago • 11 comments

I am getting the following error when running node-unzip in combination with a http.get request, then piping it into node-unzip.

The code I use:

var extractor = unzip.Extract({path: tempPath});
extractor.on("close", function() {
    log.debug("Done downloading "+file);
    callback(null, file);
});
extractor.on("error", function (err) {
    log.error(err);
    callback(err, null);
});

http.get(url, function (res) {
    res.pipe(extractor);
});

tempPath is defined properly, and the said code works fine on Windows. Now, on my CentOS server, it outputs the error like this: invalid signature: 0x8080014

I'm 100% sure the XML file is valid, the exact file works on Windows.

Cyberuben avatar Feb 13 '15 14:02 Cyberuben

+1

nmehta6 avatar Feb 17 '15 19:02 nmehta6

Have the same issue on Mac. Strange thing is that if I write http response to the zip file on disk and then process it from file it works.

stream.js:94
  throw er; // Unhandled stream error in pipe.
        ^
 Error: invalid signature: 0x8080014

pbochynski avatar Feb 18 '15 08:02 pbochynski

Same here @pbochynski

Cyberuben avatar Feb 21 '15 17:02 Cyberuben

+1 :(

izqui avatar Mar 28 '15 12:03 izqui

Bad news: This repo appears to be abandoned. Good news: https://www.npmjs.com/package/unzip2 patches this problem and streaming of uncompressed zip content.

It comes down to the lines in lib/parse.js:161

setImmediate(function() {
  self._pullStream.unpipe();
  self._pullStream.prepend(extra);
  self._processDataDescriptor(entry);
});

should be

self._pullStream.unpipe();
self._pullStream.prepend(extra);
setImmediate(function() {
  self._processDataDescriptor(entry);
});

dvalentiate avatar Mar 30 '15 10:03 dvalentiate

Thank you @dvalentiate

woodedlawn avatar Apr 01 '15 03:04 woodedlawn

Same here @pbochynski

snowdream avatar Oct 16 '15 07:10 snowdream

Thanks you as well!! unzip2 fixed a similar problem I had in unzipping folders made with the archiver module.

joswhite avatar Nov 14 '15 01:11 joswhite

Thank you @dvalentiate for the tip. Swichting to unzip2 fixed it for me: :two_men_holding_hands:

roboshoes avatar Nov 24 '15 04:11 roboshoes

Thank you @dvalentiate for the tip. Swichting to unzip2 fixed it for me: 👬

tlianglstyle avatar Jun 02 '17 09:06 tlianglstyle

Thanks !!!

marcusflat avatar Nov 07 '18 19:11 marcusflat