Repository navigation
zlib.createGunzip "unknown compression method" #5852
Description
Activity
- addedzlibIssues and PRs related to the zlib module and its compression dependencies.Issues and PRs related to the zlib module and its compression dependencies.
on Mar 22, 2016 @evanlucas @thealphanerd ... possible zlib regression in v5.9? Could #5120 be to blame?
@dpicky ... can you provide an example test case that demonstrates the problem reliably?
@dpicky ... can you provide an example test case that demonstrates the problem reliably?
More details would be useful. Straightforward use case does not have this problem as far as I can tell:
$ cat test.js 'use strict'; var zlib = require('zlib'); zlib.gzip('hello', function(err, data) { if (err) { return console.log('err', err); } var unzip = zlib.createGunzip(); unzip.write(data); unzip.on('data', function (data) { console.log(data.toString()); }); }); $ node -v v5.9.0 $ uname -a Darwin LIB-0S8DV17-LT 13.4.0 Darwin Kernel Version 13.4.0: Wed Mar 18 16:20:14 PDT 2015; root:xnu-2422.115.14~1/RELEASE_X86_64 x86_64 $ node test.js hello $@dpicky Could you give us some more info on what sort of files these are?
@Fishrock123 I have same issue on
5.9.0, but not on5.8.0. Seems like to reproduce you need quite big file (I get error on about 150Mb point of gzipped file). File was created through standard gzip util without any additional parameters.Just checked, this definitely was introduced in f380db2.
I can reproduce this by passing the gcc-5.3.0 tarball to
createUnzip():const fs = require('fs'); const zlib = require('zlib'); let l = 0; fs.createReadStream('gcc-5.3.0.tar.gz') .pipe(zlib.createGunzip()) .on('data', d => l += d.length); process.on('exit', () => console.log(l));
results in
598310912 events.js:155 throw er; // Unhandled 'error' event ^ Error: unknown compression method at Zlib._handle.onerror (zlib.js:363:17)/cc @kthelgason
I think I got this, PR incoming. 😄
Reacted by Harrison Powers1 remaining item
- added 2 commits that reference this issue
on Mar 30, 2016 Hi,
I just ran into this thing, is there any specific version where this is fixed ?events.js:154 throw er; // Unhandled 'error' event ^ Error: unknown compression method at Zlib._handle.onerror (zlib.js:363:17)$ node --version v5.9.1Cheers.
@thomasmodeneis Fixed in 6.0.0 and above.
- added a commit that references this issue
on Jul 27, 2026
Since upgrading to 5.9.0 getting lots of "unknown compression method" errors when trying to uncompress files (using zlib.createGunzip) that work in previous versions of Node include 5.8