cloudfoundry / nodejs-buildpack

Cloud Foundry buildpack for Node.js
http://docs.cloudfoundry.org/buildpacks/
Apache License 2.0
173 stars 385 forks source link

Allow error log message when cf push failed for time out of installing local node_modules #151

Closed xtremerui closed 5 years ago

xtremerui commented 6 years ago

What version of Cloud Foundry and CF CLI are you using? (i.e. What is the output of running cf curl /v2/info && cf version?

api version 2.82.0
cf version 6.34.1

What version of the buildpack you are using? 1.6.26 1.6.29 all behave the same. Latest working version was 1.6.23.

If you were attempting to accomplish a task, what was it you were attempting to do?

deploy an application with vendor dependencies included in an offline env

What did you expect to happen?

the app starts successfully or fails with error message that shows details

What was the actual behaviour? The cf push stuck at install node_modules and timeout eventually without any useful stdout message indicating what is happening. BP_DEBUG is set to true already.

Restaging app push in org system / space push-notifications as gfrau...

Staging app and tracing logs...
   Downloading php_buildpack_v4_3...
   Downloading vision_buildpack_v4_9...
   Downloading staticfile_buildpack_v1_4...
   Downloading staticfile_buildpack...
   Downloaded vision_buildpack_v4_9
   Downloading vision_buildpack_v4_8...
   Downloaded staticfile_buildpack_v1_4
   Downloading ruby_buildpack...
   Downloaded php_buildpack_v4_3
   Downloading binary_buildpack_v1_0...
   Downloading nodejs_buildpack...
   Downloaded staticfile_buildpack
   Downloading nodejs_buildpack_1_6_27...
   Downloaded vision_buildpack_v4_8
   Downloading binary_buildpack...
   Downloaded ruby_buildpack
   Downloading vision_buildpack...
   Downloaded binary_buildpack
   Downloading go_buildpack...
   Downloaded vision_buildpack
   Downloading java_buildpack_offline...
   Downloaded go_buildpack
   Downloading tensorflow_buildpack...
   Downloaded java_buildpack_offline
   Downloading python_buildpack...
   Downloaded python_buildpack
   Downloading vision_buildpack_v4_11...
   Downloaded tensorflow_buildpack
   Downloading php_buildpack...
   Downloaded vision_buildpack_v4_11
   Downloading python_buildpack_v1_6...
   Downloaded nodejs_buildpack_1_6_27
   Downloading dotnet_core_buildpack...
   Downloaded binary_buildpack_v1_0
   Downloading dotnet_core_buildpack_v2_1...
   Downloaded python_buildpack_v1_6
   Downloading dotnet_core_buildpack_v2_0...
   Downloaded dotnet_core_buildpack_v2_0
   Downloading java_buildpack_offline_v4_12...
   Downloaded java_buildpack_offline_v4_12
   Downloading tensorflow_buildpack_v0_0...
   Downloaded tensorflow_buildpack_v0_0
   Downloading java_buildpack_offline_v4_13...
   Downloaded java_buildpack_offline_v4_13
   Downloading java_buildpack_offline_v4_11...
   Downloaded java_buildpack_offline_v4_11 (345.4M)
   Downloading ruby_buildpack_v1_7...
   Downloaded ruby_buildpack_v1_7
   Downloading staticfile_buildpack_v1_3...
   Downloaded staticfile_buildpack_v1_3
   Downloading go_buildpack_v1_8...
   Downloaded go_buildpack_v1_8
   Downloading nodejs_buildpack_v1_6...
   Downloaded dotnet_core_buildpack_v2_1
   Downloaded nodejs_buildpack_v1_6 (135.2M)
   Downloaded nodejs_buildpack (135.2M)
   Downloaded php_buildpack (567.6M)
   Downloaded dotnet_core_buildpack (955.1M)
   Cell e553c072-284e-4ac0-813a-61936c656b38 creating container for instance eb9213cb-bfad-40f0-820b-a524a7ac6d84
   Cell e553c072-284e-4ac0-813a-61936c656b38 successfully created container for instance eb9213cb-bfad-40f0-820b-a524a7ac6d84
   Downloading build artifacts cache...
   Downloading app package...
   Downloaded build artifacts cache (287B)
   Downloaded app package (8M)
   -----> Nodejs Buildpack version 1.6.29
          **WARNING** buildpack version changed from 1.6.23 to 1.6.29
   -----> Installing binaries
          engines.node (package.json): >=0.8.0
          engines.npm (package.json): unspecified (use default)
          **WARNING** Dangerous semver range (>) in engines.node. See: http://docs.cloudfoundry.org/buildpacks/node/node-tips.html
   -----> Installing node 10.7.0
          Copy [/tmp/buildpacks/aa80e22d68a676fc7e4b1a699de32400/dependencies/ad376024e806630ef1fafa3194654c23/node-10.7.0-linux-x64-eb62d478.tgz]
          Using default npm version: 6.1.0
   -----> Installing yarn 1.7.0
          Copy [/tmp/buildpacks/aa80e22d68a676fc7e4b1a699de32400/dependencies/6efcd2cc3b2e0d59dd3062e6d5088845/yarn-v1.7.0-e7720ee3.tar.gz]
          Installed yarn 1.7.0
   -----> Creating runtime environment
          NODE_ENV=production
          NODE_HOME=/tmp/contents153211765/deps/0/node
          NODE_MODULES_CACHE=true
          NODE_VERBOSE=false
          NPM_CONFIG_LOGLEVEL=error
          NPM_CONFIG_PRODUCTION=true
   -----> Building dependencies
          Prebuild detected (node_modules already exists)
          Rebuilding any native modules
   body-parser@1.0.2 /tmp/app/node_modules/body-parser
   type-is@1.1.0 /tmp/app/node_modules/body-parser/node_modules/type-is
   mime@1.2.11 /tmp/app/node_modules/body-parser/node_modules/type-is/node_modules/mime
   raw-body@1.1.7 /tmp/app/node_modules/body-parser/node_modules/raw-body
   bytes@1.0.0 /tmp/app/node_modules/body-parser/node_modules/raw-body/node_modules/bytes
   string_decoder@0.10.31 /tmp/app/node_modules/body-parser/node_modules/raw-body/node_modules/string_decoder
   qs@0.6.6 /tmp/app/node_modules/body-parser/node_modules/qs
   config@1.26.1 /tmp/app/node_modules/config
   json5@0.4.0 /tmp/app/node_modules/config/node_modules/json5
   os-homedir@1.0.2 /tmp/app/node_modules/config/node_modules/os-homedir
   cookie-parser@1.0.1 /tmp/app/node_modules/cookie-parser
   cookie@0.1.0 /tmp/app/node_modules/cookie-parser/node_modules/cookie
   cookie-signature@1.0.3 /tmp/app/node_modules/cookie-parser/node_modules/cookie-signature
   express@4.15.3 /tmp/app/node_modules/express
   accepts@1.3.3 /tmp/app/node_modules/express/node_modules/accepts
   mime-types@2.1.15 /tmp/app/node_modules/express/node_modules/accepts/node_modules/mime-types
   mime-db@1.27.0 /tmp/app/node_modules/express/node_modules/accepts/node_modules/mime-types/node_modules/mime-db
   negotiator@0.6.1 /tmp/app/node_modules/express/node_modules/accepts/node_modules/negotiator
   array-flatten@1.1.1 /tmp/app/node_modules/express/node_modules/array-flatten
   content-disposition@0.5.2 /tmp/app/node_modules/express/node_modules/content-disposition
   content-type@1.0.2 /tmp/app/node_modules/express/node_modules/content-type
   cookie@0.3.1 /tmp/app/node_modules/express/node_modules/cookie
   cookie-signature@1.0.6 /tmp/app/node_modules/express/node_modules/cookie-signature
   debug@2.6.7 /tmp/app/node_modules/express/node_modules/debug
   ms@2.0.0 /tmp/app/node_modules/express/node_modules/debug/node_modules/ms
   depd@1.1.0 /tmp/app/node_modules/express/node_modules/depd
   encodeurl@1.0.1 /tmp/app/node_modules/express/node_modules/encodeurl
   escape-html@1.0.3 /tmp/app/node_modules/express/node_modules/escape-html
   etag@1.8.0 /tmp/app/node_modules/express/node_modules/etag
   finalhandler@1.0.3 /tmp/app/node_modules/express/node_modules/finalhandler
   on-finished@2.3.0 /tmp/app/node_modules/express/node_modules/on-finished
   ee-first@1.1.1 /tmp/app/node_modules/express/node_modules/on-finished/node_modules/ee-first
   parseurl@1.3.1 /tmp/app/node_modules/express/node_modules/parseurl
   statuses@1.3.1 /tmp/app/node_modules/express/node_modules/statuses
   unpipe@1.0.0 /tmp/app/node_modules/express/node_modules/finalhandler/node_modules/unpipe
   fresh@0.5.0 /tmp/app/node_modules/express/node_modules/fresh
   merge-descriptors@1.0.1 /tmp/app/node_modules/express/node_modules/merge-descriptors
   methods@1.1.2 /tmp/app/node_modules/express/node_modules/methods
   path-to-regexp@0.1.7 /tmp/app/node_modules/express/node_modules/path-to-regexp
   proxy-addr@1.1.4 /tmp/app/node_modules/express/node_modules/proxy-addr
   forwarded@0.1.0 /tmp/app/node_modules/express/node_modules/proxy-addr/node_modules/forwarded
   ipaddr.js@1.3.0 /tmp/app/node_modules/express/node_modules/proxy-addr/node_modules/ipaddr.js
   qs@6.4.0 /tmp/app/node_modules/express/node_modules/qs
   range-parser@1.2.0 /tmp/app/node_modules/express/node_modules/range-parser
   send@0.15.3 /tmp/app/node_modules/express/node_modules/send
   destroy@1.0.4 /tmp/app/node_modules/express/node_modules/send/node_modules/destroy
   http-errors@1.6.1 /tmp/app/node_modules/express/node_modules/send/node_modules/http-errors
   inherits@2.0.3 /tmp/app/node_modules/express/node_modules/send/node_modules/http-errors/node_modules/inherits
   setprototypeof@1.0.3 /tmp/app/node_modules/express/node_modules/setprototypeof
   mime@1.3.4 /tmp/app/node_modules/express/node_modules/send/node_modules/mime
   ms@2.0.0 /tmp/app/node_modules/express/node_modules/send/node_modules/ms
   serve-static@1.12.3 /tmp/app/node_modules/express/node_modules/serve-static
   type-is@1.6.15 /tmp/app/node_modules/express/node_modules/type-is
   media-typer@0.3.0 /tmp/app/node_modules/express/node_modules/type-is/node_modules/media-typer
   mime-types@2.1.15 /tmp/app/node_modules/express/node_modules/type-is/node_modules/mime-types
   mime-db@1.27.0 /tmp/app/node_modules/express/node_modules/type-is/node_modules/mime-types/node_modules/mime-db
   utils-merge@1.0.0 /tmp/app/node_modules/express/node_modules/utils-merge
   vary@1.1.1 /tmp/app/node_modules/express/node_modules/vary
   express-mysql-session@1.2.0 /tmp/app/node_modules/express-mysql-session
   debug@2.2.0 /tmp/app/node_modules/express-mysql-session/node_modules/debug
   ms@0.7.1 /tmp/app/node_modules/express-mysql-session/node_modules/debug/node_modules/ms
   depd@1.1.0 /tmp/app/node_modules/express-mysql-session/node_modules/depd
   express-session@1.14.0 /tmp/app/node_modules/express-mysql-session/node_modules/express-session
   cookie@0.3.1 /tmp/app/node_modules/express-mysql-session/node_modules/express-session/node_modules/cookie
   cookie-signature@1.0.6 /tmp/app/node_modules/express-mysql-session/node_modules/express-session/node_modules/cookie-signature
   crc@3.4.0 /tmp/app/node_modules/express-mysql-session/node_modules/express-session/node_modules/crc
   on-headers@1.0.1 /tmp/app/node_modules/express-mysql-session/node_modules/express-session/node_modules/on-headers
   parseurl@1.3.1 /tmp/app/node_modules/express-mysql-session/node_modules/express-session/node_modules/parseurl
   uid-safe@2.1.4 /tmp/app/node_modules/express-mysql-session/node_modules/express-session/node_modules/uid-safe
   random-bytes@1.0.0 /tmp/app/node_modules/express-mysql-session/node_modules/express-session/node_modules/uid-safe/node_modules/random-bytes
   utils-merge@1.0.0 /tmp/app/node_modules/express-mysql-session/node_modules/express-session/node_modules/utils-merge
   mysql@2.11.1 /tmp/app/node_modules/express-mysql-session/node_modules/mysql
   bignumber.js@2.3.0 /tmp/app/node_modules/express-mysql-session/node_modules/mysql/node_modules/bignumber.js
   readable-stream@1.1.14 /tmp/app/node_modules/express-mysql-session/node_modules/mysql/node_modules/readable-stream
   core-util-is@1.0.2 /tmp/app/node_modules/express-mysql-session/node_modules/mysql/node_modules/readable-stream/node_modules/core-util-is
   isarray@0.0.1 /tmp/app/node_modules/express-mysql-session/node_modules/mysql/node_modules/readable-stream/node_modules/isarray
   string_decoder@0.10.31 /tmp/app/node_modules/express-mysql-session/node_modules/mysql/node_modules/readable-stream/node_modules/string_decoder
   inherits@2.0.3 /tmp/app/node_modules/express-mysql-session/node_modules/mysql/node_modules/readable-stream/node_modules/inherits
   sqlstring@2.0.1 /tmp/app/node_modules/express-mysql-session/node_modules/mysql/node_modules/sqlstring
   express-session@1.15.4 /tmp/app/node_modules/express-session
   cookie@0.3.1 /tmp/app/node_modules/express-session/node_modules/cookie
   cookie-signature@1.0.6 /tmp/app/node_modules/express-session/node_modules/cookie-signature
   crc@3.4.4 /tmp/app/node_modules/express-session/node_modules/crc
   debug@2.6.8 /tmp/app/node_modules/express-session/node_modules/debug
   ms@2.0.0 /tmp/app/node_modules/express-session/node_modules/debug/node_modules/ms
   depd@1.1.0 /tmp/app/node_modules/express-session/node_modules/depd
   on-headers@1.0.1 /tmp/app/node_modules/express-session/node_modules/on-headers
   parseurl@1.3.1 /tmp/app/node_modules/express-session/node_modules/parseurl
   uid-safe@2.1.4 /tmp/app/node_modules/express-session/node_modules/uid-safe
   random-bytes@1.0.0 /tmp/app/node_modules/express-session/node_modules/uid-safe/node_modules/random-bytes
   utils-merge@1.0.0 /tmp/app/node_modules/express-session/node_modules/utils-merge
   express-ws@3.0.0 /tmp/app/node_modules/express-ws
   ws@2.3.1 /tmp/app/node_modules/ws
   safe-buffer@5.0.1 /tmp/app/node_modules/ws/node_modules/safe-buffer
   ultron@1.1.0 /tmp/app/node_modules/ws/node_modules/ultron
   compression@1.7.0 /tmp/app/node_modules/compression
   accepts@1.3.3 /tmp/app/node_modules/compression/node_modules/accepts
   mime-types@2.1.15 /tmp/app/node_modules/compression/node_modules/accepts/node_modules/mime-types
   mime-db@1.27.0 /tmp/app/node_modules/compression/node_modules/accepts/node_modules/mime-types/node_modules/mime-db
   negotiator@0.6.1 /tmp/app/node_modules/compression/node_modules/accepts/node_modules/negotiator
   bytes@2.5.0 /tmp/app/node_modules/compression/node_modules/bytes
   compressible@2.0.10 /tmp/app/node_modules/compression/node_modules/compressible
   mime-db@1.29.0 /tmp/app/node_modules/compression/node_modules/compressible/node_modules/mime-db
   debug@2.6.8 /tmp/app/node_modules/compression/node_modules/debug
   ms@2.0.0 /tmp/app/node_modules/compression/node_modules/debug/node_modules/ms
   on-headers@1.0.1 /tmp/app/node_modules/compression/node_modules/on-headers
   safe-buffer@5.1.1 /tmp/app/node_modules/compression/node_modules/safe-buffer
   vary@1.1.1 /tmp/app/node_modules/compression/node_modules/vary
   lodash@2.4.2 /tmp/app/node_modules/lodash
   request@2.37.0 /tmp/app/node_modules/request
   qs@0.6.6 /tmp/app/node_modules/request/node_modules/qs
   json-stringify-safe@5.0.1 /tmp/app/node_modules/request/node_modules/json-stringify-safe
   mime-types@1.0.2 /tmp/app/node_modules/request/node_modules/mime-types
   forever-agent@0.5.2 /tmp/app/node_modules/request/node_modules/forever-agent
   node-uuid@1.4.8 /tmp/app/node_modules/request/node_modules/node-uuid
   tough-cookie@2.3.2 /tmp/app/node_modules/request/node_modules/tough-cookie
   punycode@1.4.1 /tmp/app/node_modules/request/node_modules/tough-cookie/node_modules/punycode
   form-data@0.1.4 /tmp/app/node_modules/request/node_modules/form-data
   combined-stream@0.0.7 /tmp/app/node_modules/request/node_modules/form-data/node_modules/combined-stream
   delayed-stream@0.0.5 /tmp/app/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream
   mime@1.2.11 /tmp/app/node_modules/request/node_modules/form-data/node_modules/mime
   async@0.9.2 /tmp/app/node_modules/request/node_modules/form-data/node_modules/async
   tunnel-agent@0.4.3 /tmp/app/node_modules/request/node_modules/tunnel-agent
   http-signature@0.10.1 /tmp/app/node_modules/request/node_modules/http-signature
   assert-plus@0.1.5 /tmp/app/node_modules/request/node_modules/http-signature/node_modules/assert-plus
   asn1@0.1.11 /tmp/app/node_modules/request/node_modules/http-signature/node_modules/asn1
   ctype@0.5.3 /tmp/app/node_modules/request/node_modules/http-signature/node_modules/ctype
   oauth-sign@0.3.0 /tmp/app/node_modules/request/node_modules/oauth-sign
   hawk@1.1.1 /tmp/app/node_modules/request/node_modules/hawk
   hoek@0.9.1 /tmp/app/node_modules/request/node_modules/hawk/node_modules/hoek
   boom@0.4.2 /tmp/app/node_modules/request/node_modules/hawk/node_modules/boom
   cryptiles@0.2.2 /tmp/app/node_modules/request/node_modules/hawk/node_modules/cryptiles
   sntp@0.2.4 /tmp/app/node_modules/request/node_modules/hawk/node_modules/sntp
   aws-sign2@0.5.0 /tmp/app/node_modules/request/node_modules/aws-sign2
   url@0.10.3 /tmp/app/node_modules/url
   punycode@1.3.2 /tmp/app/node_modules/url/node_modules/punycode
   querystring@0.2.0 /tmp/app/node_modules/url/node_modules/querystring
   winston@2.3.1 /tmp/app/node_modules/winston
   async@1.0.0 /tmp/app/node_modules/winston/node_modules/async
   colors@1.0.3 /tmp/app/node_modules/winston/node_modules/colors
   cycle@1.0.3 /tmp/app/node_modules/winston/node_modules/cycle
   eyes@0.1.8 /tmp/app/node_modules/winston/node_modules/eyes
   isstream@0.1.2 /tmp/app/node_modules/winston/node_modules/isstream
   stack-trace@0.0.10 /tmp/app/node_modules/winston/node_modules/stack-trace
          Installing any new modules (package.json)
FAILED

Can you provide a sample app?

could provide the node_modules that packed with the app

Please confirm where necessary:

cf-gitbot commented 6 years ago

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/159291499

The labels on this github issue will be updated when the story is started.

sclevine commented 6 years ago

Apologies for the delay. We're investing a possible regression that seems similar: https://github.com/cloudfoundry/nodejs-buildpack/issues/152

If your node_modules directory is properly generated, the buildpack should not cause npm to reach out to the internet.

It would be helpful if you could send us a sample app that fails to push without internet.

Ben16 commented 6 years ago

@sclevine We think that the internet calls are resulting from a missing package-lock.json and we are going to update our documentation for offline usage to be more clear. With that said, do we want to implement the original feature request in this issue (log message for timeouts)?

sclevine commented 5 years ago

Added warning in 0a625ebd1c63ee99efe765dd68bfdedd77605e49.