Shippable / support

Shippable SaaS customers can report issues and feature requests in this repository
101 stars 28 forks source link

Build failed on shippable_retry npm install #713

Closed matohawk closed 9 years ago

matohawk commented 9 years ago

I have this yml :

notifications: email: recipients:

language: node_js

node_js:

addons: firefox: "23.0"

branches: only:

env:

before_script:

script:

after_script:

I have this error :

npm ERR! EEXIST, open '/home/shippable/.npm/35ff2f17-adable-stream-1-0-33-package-tgz.lock' File exists: /home/shippable/.npm/35ff2f17-adable-stream-1-0-33-package-tgz.lock Move it away, and try again.

npm ERR! System Linux 3.13.0-32-generic npm ERR! command "/home/shippable/.nvm/v0.10.32/bin/node" "/home/shippable/.nvm/v0.10.32/bin/npm" "install" npm ERR! cwd /home/shippable/workspace/src/bitbucket.com/umind/otolane-apis npm ERR! node -v v0.10.32 npm ERR! npm -v 1.4.28 npm ERR! path /home/shippable/.npm/35ff2f17-adable-stream-1-0-33-package-tgz.lock npm ERR! code EEXIST npm ERR! errno 47 npm ERR! not ok code 0 npm WARN package.json log@1.4.0 No repository field. npm WARN package.json shrinkwrap@0.4.0 No README data

DanielLevin commented 9 years ago

+1 happens all the time. 30% builds fail with npm errors.

nicolasmoise commented 9 years ago

I am also having the same problem. It was inconsistent at first, now they seem to fail all of the time.

My deps:

"dependencies": { "async": "~0.9.0", "bluebird": "^2.3.6", "body-parser": "^1.9.0", "bower": "^1.3.12", "compression": "^1.2.0", "cors": "^2.4.2", "dateformat": "^1.0.8", "ejs": "~1.0.0", "env": "0.0.2", "errorhandler": "^1.2.2", "express": "^4.9.7", "gen-id": "^0.1.1", "lodash": "^2.4.1", "log": "^1.4.0", "loopback": "^2.5.0", "loopback-boot": "^2.1.0", "loopback-connector-mongodb": "^1.4.4", "loopback-connector-rest": "^1.4.0", "loopback-datasource-juggler": "^2.10.1", "minimist": "^1.1.0", "moment": "^2.8.3", "nconf": "^0.6.9", "node-uuid": "~1.4.1", "q": "^1.0.1", "request": "^2.45.0", "run-sequence": "^1.0.1", "serve-favicon": "^2.1.6", "socket.io": "~1.1.0", "strong-agent": "^1.0.2", "strong-cluster-control": "^0.5.1", "strong-cluster-socket.io-store": "^0.1.4", "strong-logger": "0.0.3", "strong-mq": "0.0.7", "strong-store-cluster": "^0.1.3", "strong-task-emitter": "0.0.5", "xml2json": "^0.5.1" }, "optionalDependencies": { "shuffle": "~0.2.1", "text-table": "~0.2.0", "strong-agent": "^1.0.2", "strong-cluster-control": "^0.5.1", "loopback-explorer": "^1.3.0" }, "devDependencies": { "chalk": "^0.5.1", "del": "^0.1.3", "gulp": "^3.8.8", "gulp-concat": "^2.4.1", "gulp-connect": "^2.0.6", "gulp-cssmin": "^0.1.6", "gulp-ejs": "^0.3.1", "gulp-fixmyjs": "0.0.10", "gulp-htmlmin": "^0.2.0", "gulp-ignore": "^1.2.1", "gulp-install": "^0.2.0", "gulp-jsbeautifier": "0.0.3", "gulp-jscs": "^1.2.0", "gulp-jshint": "^1.8.5", "gulp-jsonminify": "0.0.2", "gulp-less": "^1.3.6", "gulp-lintspaces": "^0.2.2", "gulp-load-utils": "0.0.4", "gulp-loopback-sdk-angular": "^0.1.2", "gulp-mobilizer": "0.0.3", "gulp-nodemon": "^1.0.4", "gulp-notify": "^2.0.0", "gulp-plumber": "^0.6.6", "gulp-rename": "^1.2.0", "gulp-shell": "^0.2.10", "gulp-sourcemaps": "^1.2.4", "gulp-spawn-mocha": "^0.4.1", "gulp-uglify": "^1.0.1", "gulp-util": "^3.0.1", "gulp-watch": "^1.1.0", "istanbul": "^0.3.2", "jshint": "^2.5.6", "jshint-stylish": "^1.0.0", "loopback-angular": "^1.1.0", "mocha": "^1.21.5", "multipipe": "^0.1.1", "precommit-hook": "^1.0.7", "shrinkwrap": "~0.4.0", "streamqueue": "^0.1.1", "supertest": "^0.14.0" }

rageshkrishna commented 9 years ago

This is happening because of a race condition bug in npm 2.0. Details are at https://github.com/npm/npm/issues/6240, https://github.com/npm/npm/issues/6309, https://github.com/npm/npm/issues/6238, https://github.com/npm/npm/issues/6318

From what I've read on those issues, you should be able to get around this by forcing an npm upgrade to 2.1.x with

  - npm install -g npm@next

Please let me know if it doesn't work for your builds. Thanks!

matohawk commented 9 years ago

Where in our yml we need to put this?

notifications: email: recipients:

language: node_js

node_js:

addons: firefox: "23.0"

branches: only:

env:

before_script:

script:

after_script:

manishas commented 9 years ago

in before_install

matohawk commented 9 years ago

Thanks

matohawk commented 9 years ago

I change for your hack but it doesn't seems to resolve the problem. Can you have a look on my project : 5429e08b80088cee586d0685 It seems like a problem of npm cache or access. Can we try a npm cache clean or something to clean the .lock???

manishas commented 9 years ago

can you send me a link to the build?

rageshkrishna commented 9 years ago

@matohawk I've looked at build 111 and it's failing because of the same npm race condition bug I described above. From the error I see that it's still running an old version of npm:

npm ERR! System Linux 3.13.0-32-generic
npm ERR! command "/home/shippable/.nvm/v0.10.32/bin/node" "/home/shippable/.nvm/v0.10.32/bin/npm" "install"
npm ERR! cwd /home/shippable/workspace/src/bitbucket.com/umind/otolane-web
npm ERR! node -v v0.10.32
npm ERR! npm -v 1.4.28
npm ERR! path /home/shippable/.npm/1dcecac2-pable-npm-glob-4-0-6-package-tgz.lock
npm ERR! code EEXIST
npm ERR! errno 47
npm ERR! not ok code 0

Have you updated your YML file to include the following:

before_install:
  - npm install -g npm@next

If you've already done that, can you please verify that the change has been made in the develop branch as well? We pick the YML file from the branch that is going to be built, not from master.

matohawk commented 9 years ago

Here my yml file in the branch develop, I can't reproduce this on my local machine so I'm stuck a little bit : image

rageshkrishna commented 9 years ago

Thanks. I see the problem now -- you need to do the npm upgrade in before_install step, not in before_script. It's the install step that's failing in your builds, so npm needs to be upgraded before the installation begins.

matohawk commented 9 years ago

yep sorry I did it in the late hours, thanks for your time

matohawk commented 9 years ago

works