node-unzip
node-unzip copied to clipboard
Error: invalid signature: 0x7d70fadf
I've got a script that downloads zips from github and unzips them into a temporary directory.
On machines with 4 gigs or less, it's crashing on any file over 2 megs.
https://github.com/gomobile/sample-counting-beads - that is a sample that I'm getting the zip from.
Below is the message I am seeing. The signature changes each time, but it happens on mac, linux, and windows. On my macbook pro with 8 gigs of ram, it works fine (I've pulled down 20 meg files).
Error: invalid signature: 0x7d70fadf
at C:\my_project\node_modules\unzip\lib\parse.js:1:1127
at process._tickCallback (node.js:351:13)
I got this error, and it turned out to be a bad zip file. Worked once the zip file was valid.
I got this error because there was a 'stored' (not 'deflated') entry in the zip file. That's perfectly valid, but node-unzip chokes on it.
like @cscott - having the same problem with a "STORE" compression. It has successfully unextracted one folder but fails on the rest of the archive
Getting the same issue here. Same zip, works on my Mac, not on a FreeBSD server.
Getting such error some times on extracting file via ftp. Solution was to subscribe stream to 'error' event. Simplified to fs, like
function unzipFile(file, callback) {
fs.createReadStream(file).pipe(unzip.Parse())
.once('error', function () {
unzipFile(file, callback)
})
.on('entry', function (entry) {
var data = ''
entry.on('data', function (chunk) {
data += chunk
}
entry.on('end', function () {
callback(null, data)
}
}
Should work, if you get this error not permanent, but from time to time
FYI. in case anyone still need the solution: patches in http://github.com/glebdmitriew/node-unzip-2 just resolved the problem.