Shasum check failed
Closed this issue · 4 comments
Hi,
thank you first for the great idea beyond npm_lazy
;)
I've started the server on localhost:8080, and I tried to get package threw it. I get the packages in the local db
cache directory as expected, but the npm client is throwing me an error :
npm --registry http://localhost:8080/ install socket.io
npm http GET http://localhost:8080/socket.io
npm http 200 http://localhost:8080/socket.io
...
npm http GET http://localhost:8080/xmlhttprequest/-/xmlhttprequest-1.4.2.tgz
npm ERR! Error: shasum check failed for /home/cde/tmp/npm-15627-B5R2mz-5/1378487407726-0.8498195898719132/tmp.tgz
npm ERR! Expected: 089b89b37145ff1d9ec74af6530be5526cae1f1a
npm ERR! Actual: da39a3ee5e6b4b0d3255bfef95601890afd80709
npm ERR! at /usr/local/lib/node_modules/npm/node_modules/sha/index.js:38:8
npm ERR! at ReadStream.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/sha/index.js:85:7)
npm ERR! at ReadStream.EventEmitter.emit (events.js:117:20)
npm ERR! at _stream_readable.js:910:16
npm ERR! at process._tickCallback (node.js:415:13)
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-@googlegroups.com>
npm ERR! System Linux 3.8.0-22-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "--registry" "http://localhost:8080/" "install" "socket.io"
npm ERR! cwd /tmp
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5
npm http 200 http://localhost:8080/ws
npm http 200 http://localhost:8080/xmlhttprequest/-/xmlhttprequest-1.4.2.tgz
npm http GET http://localhost:8080/ws/-/ws-0.4.30.tgz
npm http 200 http://localhost:8080/ws/-/ws-0.4.30.tgz
npm http 200 http://localhost:8080/uglify-js/1.2.5
npm http GET http://localhost:8080/uglify-js/-/uglify-js-1.2.5.tgz
npm http 200 http://localhost:8080/uglify-js/-/uglify-js-1.2.5.tgz
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /tmp/npm-debug.log
npm ERR! not ok code 0
Any idea of what it come from ? Is it related to my node version (0.10.15) ?
Yeah, sometimes the http requests to the registry are corrupted in transit - this is why npm does the checksumming in the first place. You need to delete the .tgz file from the cache to resolve this issue (or just clear the cache). After that, the checksum should be ok.
After cleaning the db, the issue still persist running npm_lazy 0.0.2
. I tried to install other packages such as express
, mocha
and the same problem occur. I use the 1.3.5 version of npm
.
@jokesterfr Thanks for being persistent on this. It turns out there was a race condition which was probably introduced by npm doing requests with more parallelism. While debugging this, I also added more verification into npm_lazy
, so that it will always check the sha1sum when reading from the cache. Published as v0.1.0
Many thanks to you for the fix ;-)