Skip to content

invalid distance too far back #22839

Closed
Closed

Description

@silenius

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 ]

Activity

  1. silenius commented on Sep 13, 2018

    @silenius
    Author
  2. added
    questionIssues asking questions about Node.js.
    wrong repoIssues that should be opened in another repository.
    and removed
    wrong repoIssues that should be opened in another repository.
    on Sep 13, 2018
  3. silenius commented on Sep 13, 2018

    @silenius
    Author

    Downgrading from v10.9.0 to v8.11.4 fixed the issue.

    this is with:

    ~/tmp/yarn/src/ pkg info node8
    node8-8.11.4
    Name           : node8
    Version        : 8.11.4
    Installed on   : Thu Sep 13 16:06:14 2018 CEST
    Origin         : www/node8
    Architecture   : FreeBSD:10:amd64
    Prefix         : /usr/local
    Categories     : www
    Licenses       : MIT
    Maintainer     : bhughes@FreeBSD.org
    WWW            : https://nodejs.org/
    Comment        : V8 JavaScript for client and server (8.x LTS)
    Options        :
            BUNDLED_SSL    : on
            DOCS           : on
            NLS            : off
    Shared Libs required:
            libcares.so.2
            libuv.so.1
    Annotations    :
            FreeBSD_version: 1003000
            repo_type      : binary
            repository     : bebif
    Flat size      : 27.0MiB
    Description    :
    Node.js is a JavaScript runtime built on Chrome's V8 JavaScript
    engine. Node.js uses an event-driven, non-blocking I/O model that
    makes it lightweight and efficient. Node.js' package ecosystem,
    npm, is the largest ecosystem of open source libraries in the world.
    
    WWW: https://nodejs.org/
    
  4. jasnell commented on Sep 13, 2018

    @jasnell
    Member

    ping @addaleax ... any ideas here?

  5. Trott commented on Sep 13, 2018

    @Trott
    Member

    @nodejs/zlib

  6. added
    zlibIssues and PRs related to the zlib module and its compression dependencies.
    on Sep 13, 2018
  7. addaleax commented on Sep 13, 2018

    @addaleax
    Member

    @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?

  8. silenius commented on Sep 13, 2018

    @silenius
    Author

    @addaleax : yes, it is happening with every package

  9. addaleax commented on Sep 13, 2018

    @addaleax
    Member

    @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?

  10. silenius commented on Sep 13, 2018

    @silenius
    Author

    @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.

  11. silenius commented on Sep 13, 2018

    @silenius
    Author

    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)

  12. addaleax commented on Sep 14, 2018

    @addaleax
    Member

    @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?

  13. added
    freebsdIssues and PRs related to the FreeBSD platform.
    and removed
    questionIssues asking questions about Node.js.
    on Sep 14, 2018
  14. silenius commented on Sep 25, 2018

    @silenius
    Author

    I'm closing this issue as it works on "officially supported" FreeBSD releases (> 10.3).. thanks for your help and sorry for the noise (:

  15. tmst commented on Dec 28, 2018

    @tmst

    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-app and decided to delete node_modules to see if it could be recreated with vue install. Maybe it's the wrong install command?
    Looking at the 7K+ line npm log file, you'd think I was compiling a kernel.

  16. m-u-xyz commented on Mar 19, 2019

    @m-u-xyz

    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.

  17. soederpop commented on Mar 25, 2019

    @soederpop

    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

  18. m-u-xyz commented on Mar 25, 2019

    @m-u-xyz

    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.

  19. quantumpacket commented on Jun 1, 2019

    @quantumpacket

    Updating zlib was what worked for me. Thanks.

  20. Frenkie64 commented on Mar 25, 2020

    @Frenkie64

    How do I update zlib on a Synology?

  21. PaulFPV commented on Mar 26, 2020

    @PaulFPV

    How do I update zlib on a Synology?

    Yes... how?

  22. bourgeoa commented on Mar 28, 2020

    @bourgeoa

    @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.11 inside the entware package for your machine. Example for x86_64 : https://pkg.entware.net/binaries/x86-64/Packages.html

    I used chmod 755 in lieu of chmod +x

  23. davwheat commented on Dec 31, 2021

    @davwheat

    I had this issue recently, but deleting .yarn/install-state.gz fixed the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    freebsdIssues and PRs related to the FreeBSD platform.zlibIssues and PRs related to the zlib module and its compression dependencies.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions