Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node version checksum mismatch #5562

Closed
daveyarwood opened this issue Feb 2, 2016 · 18 comments
Closed

Node version checksum mismatch #5562

daveyarwood opened this issue Feb 2, 2016 · 18 comments
Labels

Comments

@daveyarwood
Copy link

Travis has stopped building our project -- we are now getting this error on every build attempt:

gyp WARN install got an error, rolling back install
gyp ERR! configure error 
gyp ERR! stack Error: node-v0.10.41.tar.gz local checksum ce579f776a177fac809d8f532a727677a30434a6de71aee0f950e8da31d3196a not match remote 79f694e2a5c42543b75d0c69f6860499d7593136d0f6b59e7163b9e66fb2c995

Adding - npm cache clean to the before_install section of the .travis.yml seems to fix the issue (builds successfully), but then after removing that line again and force-pushing, the same error occurs.

@daveyarwood
Copy link
Author

Update: adding npm cache clean to before_install worked for a couple builds, but now I'm mysteriously getting the same checksum mismatch error even though Travis is doing npm cache clean before npm install. No idea why :(

@klemmster
Copy link

We're running into the same problem and npm cache clean didn't help.

@BanzaiMan
Copy link
Contributor

Also seen in https://travis-ci.org/desert-planet/hayt/builds/103683508.

I feel that this is an issue with node-gyp: nodejs/node-gyp#645 (and a less verbose nodejs/node-gyp#693).

Similar issues:

  1. gyp ERR! stack Error: node-v0.10.37.tar.gz local checksum not match remote  agmoyano/node-jasper#8
  2. cannot npm install heimcontrol.js ni-c/heimcontrol.js#104
  3. Install fail on RPi cozy-labs/cozy-light#76

npm cache clean is supposed to resolve the issue, but I don't know why.

At any rate, there is not much we can do on our side to improve the situation for your builds, I am afraid.

@klemmster
Copy link

So for some reason node-gyp doesn't properly create the checksum of the downloaded node-headers and even 'node-gyp-install' only managed to install those unreliably.

I ended up updating node and npm (and a couple of other libraries we use) like so:

install:
  # Install node via nvm at version defined in ARCH_NODE_VERSION
  - bin/run-integration source ~/.nvm/nvm.sh && nvm install $ARCH_NODE_VERSION && nvm use $ARCH_NODE_VERSION
  - bin/run-integration npm install -g npm@$ARCH_NPM_VERSION
   # After updating npm it's saver to clean the cache
  - bin/run-integration npm cache clean
  - bin/run-integration npm install -g node-gyp-install
  - bin/run-integration node-gyp-install
  - bin/run-integration npm install --no-optional --no-progress

where

- ARCH_NODE_VERSION=2.5.0
- ARCH_NPM_VERSION=2.13.2

later versions of Node and failed to compile stuff using gyp because the default gcc doesn't seem to support c++11.

@BanzaiMan
Copy link
Contributor

Is there anything on our end to do? This seems strictly an issue with node-gyp.

@klemmster
Copy link

TLDR: It's a node-gyp issue, yes. I don't think there's anything you could do. (Other than making node_jsversion variable (in travis.yml) available even though language is not set to nodejs. That would make choosing a different node version easier.)

For some reason, node-gyp wasn't calculating the correct sha256sum of the downloaded node-v0.10.xx.tar.gz
Thanks to the ssh access I got from you, I was able to pinpoint the problem to
node-gyp configure.
Using NODE_DEBUG=request node-gyp configure it seems the file received was fine (at least the filesize was ok), so it doesn't seem to be a networking/proxy or caching issue. (I curled over the download a 100 times, file was also ok)
I wasn't able to pinpoint what's the root cause of the issue though. Something within install.js in node-gyp(v3.0.3).

@daveyarwood
Copy link
Author

This definitely seems node-gyp related, but I can't find anything where the maintainers of node-gyp have addressed it. Has anyone been able to find a related issue filed at node-gyp? If not, I might file one there.

@BanzaiMan
Copy link
Contributor

Why do you need the Node.js version in non-node_js builds? In that case, you are responsible for setting and selecting the Node.js version, so you know what version you are using.

@daveyarwood nodejs/node-gyp#693 is the closest I found.

@daveyarwood
Copy link
Author

That issue suggests this is some kind of mirror issue?

@BanzaiMan
Copy link
Contributor

@daveyarwood Perhaps. But I found a few other issues with the same message with node-gyp. Perhaps adding more information to that issue might help the maintainers track this down.

@daveyarwood
Copy link
Author

The situation is a bit complicated for us now -- we ended up pinning Travis to test only Node v0.10.26 (instead of 0.10, which was trying to use the latest in that series, 0.10.41), and that solved our immediate issue with the checksum mismatch. We figured this is a step in the right direction, since the production app is running in containers that have Node v0.10.26, so we should ensure that it builds specifically on that version. So that fixed the checksum mismatch issue, but now we're getting a handful of other node-gyp related issues. Here are a couple examples:

gyp http GET http://nodejs.org/dist/v0.10.26/node-v0.10.26.tar.gz
gyp http 200 http://nodejs.org/dist/v0.10.26/node-v0.10.26.tar.gz
gyp WARN install got an error, rolling back install
gyp ERR! configure error 
gyp ERR! stack Error: unexpected eof
gyp ERR! stack     at decorate (/home/travis/.nvm/v0.10.26/lib/node_modules/npm/node_modules/fstream/lib/abstract.js:67:36)
gyp ERR! stack     at Extract.Abstract.error (/home/travis/.nvm/v0.10.26/lib/node_modules/npm/node_modules/fstream/lib/abstract.js:61:12)
gyp ERR! stack     at Extract._streamEnd (/home/travis/.nvm/v0.10.26/lib/node_modules/npm/node_modules/tar/lib/extract.js:75:22)
gyp ERR! stack     at BlockStream.<anonymous> (/home/travis/.nvm/v0.10.26/lib/node_modules/npm/node_modules/tar/lib/parse.js:50:8)
gyp ERR! stack     at BlockStream.EventEmitter.emit (events.js:92:17)
gyp ERR! stack     at BlockStream._emitChunk (/home/travis/.nvm/v0.10.26/lib/node_modules/npm/node_modules/block-stream/block-stream.js:203:10)
gyp ERR! stack     at BlockStream.resume (/home/travis/.nvm/v0.10.26/lib/node_modules/npm/node_modules/block-stream/block-stream.js:58:15)
gyp ERR! stack     at Extract.Reader.resume (/home/travis/.nvm/v0.10.26/lib/node_modules/npm/node_modules/fstream/lib/reader.js:253:34)
gyp ERR! stack     at Entry.<anonymous> (/home/travis/.nvm/v0.10.26/lib/node_modules/npm/node_modules/tar/lib/parse.js:256:8)
gyp ERR! stack     at Entry.EventEmitter.emit (events.js:92:17)
gyp ERR! System Linux 2.6.32-042stab108.8
gyp ERR! command "node" "/home/travis/.nvm/v0.10.26/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/travis/build/adzerk/bifrost/node_modules/lru-native
gyp ERR! node -v v0.10.26
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok 

(then on subsequent build, after removing npm cache clean from before_all)

gyp http GET http://nodejs.org/dist/v0.10.26/node-v0.10.26.tar.gz
gyp http 200 http://nodejs.org/dist/v0.10.26/node-v0.10.26.tar.gz
gyp: /home/travis/.node-gyp/0.10.26/common.gypi not found (cwd: /home/travis/build/adzerk/bifrost/node_modules/lru-native) while reading includes of binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/home/travis/.nvm/v0.10.26/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:337:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Linux 2.6.32-042stab108.8
gyp ERR! command "node" "/home/travis/.nvm/v0.10.26/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/travis/build/adzerk/bifrost/node_modules/lru-native
gyp ERR! node -v v0.10.26
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok 

I'm having a hard time understanding what's going on, beyond that it appears to be node-gyp related.

@klemmster
Copy link

For some reason, node seems to receive corrupt files when downloading from a travis worker. (nodejs/node-gyp#693) Anything changed in the travis environment that could be causing that? Some cache maybe?

@BanzaiMan
Copy link
Contributor

That seems rather incredible. Does the problem persist if you re-run the previously-failing builds?

@klemmster
Copy link

@BanzaiMan I believe starting last wednesday afternoon (gmt +1), it started to slowly transition from working sometimes on previously-failing build to pretty much failing always. Take that with a grain of salt, not 100% sure about it.

@automata
Copy link

automata commented Apr 1, 2016

I believe we are experimenting the same issue with the-grid/gmr-saliency:

Running "gyp:saliency" (gyp) task
gyp: /home/travis/.node-gyp/4.4.2/common.gypi not found (cwd: /home/travis/build/the-grid/gmr-saliency) while reading includes of binding.gyp while trying to load binding.gyp
Warning: Task "gyp:saliency" failed.� Use --force to continue.

Raw log is available at https://gist.github.com/automata/fca157029dc01357b5d5d7cfd6fc62d1 and also the .travis.yml source.

The same issue already happened with Node.js 0.12 and 4.2.

@BanzaiMan
Copy link
Contributor

Is this still an issue?

@automata
Copy link

I bumped grunt-node-gyp to the latest version and this solved the issue.

@BanzaiMan
Copy link
Contributor

I'm closing this now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants