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

Invalid non-string/buffer chunk

Open satazor opened this issue 11 years ago • 11 comments

Since 0.1.6 there's been a lot of errors like this. One of the packages that have this issue is: http://reality.sgiweb.org/maxw/tmp/bower/Open_Sans.zip

With 0.1.5 it works with the above zip file. Also works with common tools to extract zip files on OS. Unfortunately, 0.1.5 is not compatible with node 0.10.x.

satazor avatar May 03 '13 10:05 satazor

@EvanOxfeld turns out that sometimes weird things arrive to the readable-stream:

<Buffer 6f 66 20 57 61 72 72 61 6e 74 79 2e 20 55 6e 6c 65 73 73 20 72 65 71 75 69 72 65 64 20 62 79 20 61 70 70 6c 69 63 61 62 6c 65 20 6c 61 77 20 6f 72 0d 0a ...>
null
<Buffer 7d 92 47 52 6e 83 1d b8 3d 92 b2 1a ec 71 f6 b4 bf 9e 84 bf 0a e8 17 ba 23 7e a1 3b 92 f2 16 8e 3c 0d c3 2f 17 47 b0 74 04 0f 47 cc fa 48 45 b8 62 1e a9 ...>
{ buffers: [], length: 0 } <<<< this is strange!

satazor avatar May 03 '13 12:05 satazor

I've been getting this too

With a setup of something like

var rs = fs.createReadStream(filename);
rs.on('data', function(data) {
  console.log(data);
}).on('close', function() {
  console.log('close');  
});

rs.pipe(unzip.Parse());

I get the following output

<Buffer 50 4b 03 04 0a 00 00 00 00 00 51 8e be 42 00 00 00 00 00 00 00 00 00 00 00 00 09 00 10 00 48 6f 67 77 61 72 74 73 2f 55 58 0c 00 6a 83 a7 51 5a 83 a7 51 ...>
<Buffer 39 64 c6 c0 1a 60 1b 1b 04 74 5e 37 f6 9d 50 07 b3 a6 fe c8 38 81 cb 92 10 1a 92 42 d4 a0 cc ec 69 c2 28 c7 d1 02 44 95 09 2b 02 5d 10 dd af 4c ca 25 cd ...>
closed
{ buffers: [], length: 0 }

so it looks like a stream somewhere is accepting input after being closed

I've reverted to 0.1.5 for now.

jamessharp avatar Jun 03 '13 10:06 jamessharp

I have the same issue with bower 0.9.2 and node 0.10.3 - it throws an error on all zip files when trying to install https://github.com/opitzconsulting/angular-jqm I works fine with git repos, so I guess it might be this package

danielzzz avatar Jul 17 '13 15:07 danielzzz

@danielzzz Same issue here, don't think it's specific to the packages you're using. Looks like the Bower guys are aware of it: https://github.com/nearinfinity/node-unzip/issues/16#issuecomment-16826243

roytruelove avatar Jul 31 '13 16:07 roytruelove

Same problem in Node v0.10.32, almost a year and a half after this issue was reported.

jednano avatar Oct 19 '14 19:10 jednano

Also getting this issue with anything that uses streams - very weird. node 0.10.32

yocontra avatar Oct 22 '14 04:10 yocontra

Same problem here...

oshingc avatar Apr 26 '16 22:04 oshingc

Same problem in Node 7.4.0

PavelPikat avatar Aug 14 '17 15:08 PavelPikat

Same problem in Node 6.9.2 fs.createReadStream(dbFilePath).pipe(zlib.createGzip()).pipe(fs.createWriteStream(dbFilePath+'.gz'));

keyiis avatar Sep 06 '17 15:09 keyiis

Got the same problem in Node v11.14.0 is there a fix yet?

Tarlord avatar Apr 19 '19 20:04 Tarlord

I get this problem using a steam created with streamifier.

adjenks avatar Oct 11 '19 17:10 adjenks