eirslett / frontend-maven-plugin

"Maven-node-grunt-gulp-npm-node-plugin to end all maven-node-grunt-gulp-npm-plugins." A Maven plugin that downloads/installs Node and NPM locally, runs NPM install, Grunt, Gulp and/or Karma.
Apache License 2.0
4.26k stars 870 forks source link

Corrupted file #439

Open testn opened 8 years ago

testn commented 8 years ago

When running it on an unstable network, the file could be downloaded partially. This makes the subsequent operation to fail with " Could not extract the npm archive: Could not extract archive: ....". Is it possible to detect such corruption and re-download it?

eirslett commented 8 years ago

I'm not sure. Another mvn clean install will probably work as a retry.

testn commented 8 years ago

It didn't because the cache file is installed into local maven repo

eirslett commented 8 years ago

Maybe we should catch the exception and delete the file?

testn commented 8 years ago

When you download, you should download to the temp folder before moving to the correct location.

moribellamy commented 7 years ago

i'm seeing this too:

file .m2/repository/com/github/eirslett/node/6.2.2/node-6.2.2-linux-x64.tar.gz

gives: .m2/repository/com/github/eirslett/node/6.2.2/node-6.2.2-linux-x64.tar.gz: gzip compressed data, was "node-v6.2.2-linux-x64.tar", last modified: Fri Jun 17 14:32:16 2016, max compression, from Unix

du .m2/repository/com/github/eirslett/node/6.2.2/node-6.2.2-linux-x64.tar.gz

gives: 2372 .m2/repository/com/github/eirslett/node/6.2.2/node-6.2.2-linux-x64.tar.gz

tar xvf .m2/repository/com/github/eirslett/node/6.2.2/node-6.2.2-linux-x64.tar.gz .

gives: gzip: stdin: unexpected end of file tar: Unexpected EOF in archive tar: Error is not recoverable: exiting now

moribellamy commented 7 years ago

the only thing i can deduce on my end is that whatever java HTTP download client you are using will silently accept a broken transmission, or that the nodejs.org/dist server silently gave a partial file.

in any case, application logic to not get stuck in a bad state would be the fix :). our builds will keep trying to use that cached (and corrupted) file.