Chris
Chris

Reputation: 311

CF push stopped working for no apparent reason

It used to work in the past, but started failing today without apparent reason. I have not deployed for quite some time.

The application is deployed on Bluemix GB.

-----> IBM SDK for Node.js Buildpack v3.8-20161006-1211
   Based on Cloud Foundry Node.js Buildpack v1.5.20
-----> Creating runtime environment
   NPM_CONFIG_LOGLEVEL=error
   NPM_CONFIG_PRODUCTION=true
   NODE_ENV=production
   NODE_MODULES_CACHE=false
-----> Installing binaries
   engines.node (package.json):  >=6.7.0
   engines.npm (package.json):   >=3.10.3
   Resolving node version >=6.7.0 via 'node-version-resolver'
   Installing IBM SDK for Node.js (6.7.0) from cache
   Resolving npm version >=3.10.3 via semver.io...
   Downloading and installing npm 3.10.9 (replacing version 3.10.3)...
-----> Restoring cache
   Skipping cache restore (disabled by config)
-----> Checking and configuring service extensions before installing dependencies
-----> Building dependencies
   Installing node modules (package.json)
   npm ERR! Linux 3.19.0-33-generic
   npm ERR! argv "/tmp/staged/app/vendor/node/bin/node" "/tmp/staged/app/vendor/node/bin/npm" "install" "--unsafe-perm" "--userconfig" "/tmp/staged/app/.npmrc"
   npm ERR! node v6.7.0
   npm ERR! npm  v3.10.9
   npm ERR! code EREADFILE
   npm ERR! Error extracting /home/vcap/.npm/fs/0.0.0/package.tgz archive: ENOENT: no such file or directory, open '/home/vcap/.npm/fs/0.0.0/package.tgz'
   npm ERR!
   npm ERR!     <https://github.com/npm/npm/issues>
   npm ERR! If you need help, you may report this error at:
   npm ERR! Please include the following file with any support request:
   npm ERR!     /tmp/staged/app/npm-debug.log
-----> Build failed

package.json - it definitely used to work in the past, and there was no changes there, maybe except updating node version and npm (but I have tested also without them)

    {
      "name": "Atlas2",
      "version": "0.0.2",
      "private": true,
      "scripts": {
        "start": "node app.js",
        "test": "mocha server-tests/tests*"
      },
      "dependencies": {
        "babel-core": "^6.11.4",
        "babel-loader": "^6.2.4",
        "babel-plugin-react-transform": "^2.0.2",
        "babel-preset-es2015": "^6.9.0",
        "babel-preset-react": "^6.11.1",
        "babel-preset-stage-0": "^6.5.0",
        "babel-runtime": "^6.9.2",
        "body-parser": "^1.15.2",
        "bootstrap": "^3.3.7",
        "cfenv": "1.0.x",
        "express": "^4.14.0",
        "express-stormpath": "^3.1.3",
        "flux": "*",
        "globals": "^9.9.0",
        "history": "^3.0.0",
        "imports-loader": "^0.6.5",
        "jquery": "*",
        "jsplumb": "2.1.8",
        "keymirror": "*",
        "mongoose": "*",
        "morgan": "^1.7.0",
        "path": "*",
        "react": "^15.3.0",
        "react-bootstrap": "^0.30.3",
        "react-document-title": "^2.0.2",
        "react-dom": "^15.3.0",
        "react-router": "^2.6.0",
        "react-router-bootstrap": "*",
        "react-stormpath": "^1.2.2",
        "script-loader": "^0.7.0",
        "underscore": "*",
        "webpack": "1.13.1",
        "log4js" : "*",
        "fs" :"*",
        "key-mirror-nested": "^1.2.4",
        "webpack-dev-middleware": "^1.6.1",
        "q" : "*"
      },
      "devDependencies": {
          "mocha": "*",
          "should": "10.0.0",
          "supertest": "*"
      },
      "repository": {},
      "engines": {
        "node": "6.7.0",
        "npm" : "3.10.9"
      }
    }

The cf push -v displays a lot of request (without any sign of error). Then there is the message that I have put at the beginning of this post, and there there is a status json:

"package_state": "FAILED",
"health_check_type": "port",
"health_check_timeout": 60,
"staging_failed_reason": "BuildpackCompileFailed",
"staging_failed_description": "App staging failed in the buildpack compile phase",
"diego": false,
"docker_image": null,
"package_updated_at": "2016-10-27T17:19:07Z",
"detected_start_command": "./vendor/initial_startup.rb",

Things got even weirder as removing .cfignore and uploading node_modules workarounded the problem.

EDIT: Thank you everyone for looking into this. The problem turned out to be in one of the babel* packages, which were used to translate jsx into javascript. Once I have moved them to dev dependencies and started running compile scripts on my local machine, the problem is gone.

Upvotes: 0

Views: 637

Answers (2)

nitind
nitind

Reputation: 20003

Try a cf restage of the app, unless you can just cf delete it and recreate it (with the .cfignore still excluding node_modules).

Upvotes: 0

Andrew L
Andrew L

Reputation: 5486

This line stood out to me npm ERR! Error extracting /home/vcap/.npm/fs/0.0.0/package.tgz archive: ENOENT: no such file or directory, open '/home/vcap/.npm/fs/0.0.0/package.tgz'

The fs module is one of nodes core modules and does not need to be installed. I think by trying to install it you are getting some problems.

Try removing "fs" :"*", from your package.json and repush.

Upvotes: 2

Related Questions