Repository navigation
invalid distance too far back #22839
Copy link
Copy link
Closed
Labels
freebsdIssues and PRs related to the FreeBSD platform.Issues and PRs related to the FreeBSD platform.zlibIssues and PRs related to the zlib module and its compression dependencies.Issues and PRs related to the zlib module and its compression dependencies.
Description
Hello,
I'm getting a invalid distance too far back error message with npm/yarn (see yarnpkg/yarn#6357). It happens consistently and looks like a zlib error for corrupt data (?).
- v10.9.0
- FreeBSD dev.lan 10.3-RELEASE FreeBSD 10.3-RELEASE #0 r297264: Fri Mar 25 02:10:02 UTC 2016 root@releng1.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64
- Zlib
~/code/projects/amnesiabbpf/amnesiabbpf/frontend/ npm update webpack
npm ERR! code Z_DATA_ERROR
npm ERR! errno -3
npm ERR! invalid distance too far back
npm ERR! A complete log of this run can be found in:
npm ERR! /home/jcigar/.npm/_logs/2018-09-13T11_39_20_299Z-debug.log
~/code/projects/amnesiabbpf/amnesiabbpf/frontend/ more /home/jcigar/.npm/_logs/2018-09-13T11_39_20_299Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'update',
1 verbose cli 'webpack' ]
2 info using npm@6.4.0
3 info using node@v10.9.0
4 verbose npm-session 0d2be4137d87cb91
5 verbose update computing outdated modules to update
6 silly mapToRegistry name webpack
7 silly mapToRegistry using default registry
8 silly mapToRegistry registry https://registry.npmjs.org/
9 silly mapToRegistry data { type: 'tag',
9 silly mapToRegistry registry: true,
9 silly mapToRegistry where: undefined,
9 silly mapToRegistry raw: 'webpack',
9 silly mapToRegistry name: 'webpack',
9 silly mapToRegistry escapedName: 'webpack',
9 silly mapToRegistry scope: undefined,
9 silly mapToRegistry rawSpec: '',
9 silly mapToRegistry saveSpec: null,
9 silly mapToRegistry fetchSpec: 'latest',
9 silly mapToRegistry gitRange: undefined,
9 silly mapToRegistry gitCommittish: undefined,
9 silly mapToRegistry hosted: undefined }
10 silly mapToRegistry uri https://registry.npmjs.org/webpack
11 verbose request uri https://registry.npmjs.org/webpack
12 verbose request no auth needed
13 info attempt registry request try #1 at 1:38:10 PM
14 verbose request id 81b3118c03482bfc
15 http request GET https://registry.npmjs.org/webpack
16 info retry will retry, error on last attempt: Error: invalid distance too far back
17 info attempt registry request try #2 at 1:38:20 PM
18 http request GET https://registry.npmjs.org/webpack
19 info retry will retry, error on last attempt: Error: invalid distance too far back
20 info attempt registry request try #3 at 1:39:20 PM
21 http request GET https://registry.npmjs.org/webpack
22 verbose stack Error: invalid distance too far back
22 verbose stack at Zlib.zlibOnError [as onerror] (zlib.js:153:17)
23 verbose cwd /usr/home/jcigar/code/projects/amnesiabbpf/amnesiabbpf/frontend
24 verbose FreeBSD 10.3-RELEASE
25 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "update" "webpack"
26 verbose node v10.9.0
27 verbose npm v6.4.0
28 error code Z_DATA_ERROR
29 error errno -3
30 error invalid distance too far back
31 verbose exit [ -3, true ]
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
freebsdIssues and PRs related to the FreeBSD platform.Issues and PRs related to the FreeBSD platform.zlibIssues and PRs related to the zlib module and its compression dependencies.Issues and PRs related to the zlib module and its compression dependencies.
Activity
silenius commentedon Sep 13, 2018
see RocketChat/Rocket.Chat#12024 too
silenius commentedon Sep 13, 2018
Downgrading from v10.9.0 to v8.11.4 fixed the issue.
this is with:
jasnell commentedon Sep 13, 2018
ping @addaleax ... any ideas here?
Trott commentedon Sep 13, 2018
@nodejs/zlib
addaleax commentedon Sep 13, 2018
@silenius Do you think you might be able to look at the file that decompression is failing on? Is this happening with every npm package you try to install?
silenius commentedon Sep 13, 2018
@addaleax : yes, it is happening with every package
addaleax commentedon Sep 13, 2018
@silenius Are you behind a proxy? Can you check whether this only happens on FreeBSD or not? Do you think you might be able to look into what exactly the data is that is being passed to zlib here?
silenius commentedon Sep 13, 2018
@addaleax I'm not behind a proxy. I just tested on a freshly installed 11.2-RELEASE and it works as expected, so I think it only happens on FreeBSD <= 10.3.
silenius commentedon Sep 13, 2018
mmh apparently zlib has been upgraded in 10.4 (https://svnweb.freebsd.org/base?view=revision&revision=313796), so maybe it should work (unfortunately I don't have any 10.4 to test at the moment)
addaleax commentedon Sep 14, 2018
@silenius I think there’s a good chance that this would be a fix, yes. You can also try compiling Node.js from source, I think? We ship our own copy of zlib in our main tarball, so that could be unaffected by whatever bug you’re hitting?
silenius commentedon Sep 25, 2018
I'm closing this issue as it works on "officially supported" FreeBSD releases (> 10.3).. thanks for your help and sorry for the noise (:
tmst commentedon Dec 28, 2018
I'm getting this on OpenSuse Leap 42.3. I have no idea what I'm doing and was just playing around with a default project created with
vue init webpack-simple my-vue-appand decided to deletenode_modulesto see if it could be recreated withvue install. Maybe it's the wronginstallcommand?Looking at the 7K+ line
npmlog file, you'd think I was compiling a kernel.m-u-xyz commentedon Mar 19, 2019
The fix is to update your zlb. On Debian testing, as of now, 1.2.8 caused nodejs/npm to exhibit the fault while 1.2.11 did not.
soederpop commentedon Mar 25, 2019
what do you mean by update zlib @smurfix ? doesn't it come as part of node itself? we're having this error and other random zlib errors regularly from node 11.9 on debian
m-u-xyz commentedon Mar 25, 2019
Debian dislikes vendorized libraries and uses the system's libraries wherever possible.
In any case, I had that exact error last week and fixed it by changing nothing – except updating the system's zlib.
quantumpacket commentedon Jun 1, 2019
Updating zlib was what worked for me. Thanks.
Frenkie64 commentedon Mar 25, 2020
How do I update zlib on a Synology?
PaulFPV commentedon Mar 26, 2020
Yes... how?
bourgeoa commentedon Mar 28, 2020
@Frenkie64 @paulsview
https://stackoverflow.com/questions/60288671/npm-install-on-synology-gives-zlib-invalid-distance-error
If you don't want to install entware you can find
zlib.so.1.2.11inside the entware package for your machine. Example for x86_64 : https://pkg.entware.net/binaries/x86-64/Packages.htmlI used
chmod 755in lieu ofchmod +xdavwheat commentedon Dec 31, 2021
I had this issue recently, but deleting
.yarn/install-state.gzfixed the issue.