cloudfoundry / nodejs-buildpack

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

failing in bluemix us-east #158

Closed oprogramador closed 6 years ago

oprogramador 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? 6.30.0+decf883fc.2017-09-01

What version of the buildpack you are using? latest

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

What did you expect to happen? successful deploy

What was the actual behavior? failure related to yarn

Can you provide a sample app?

My logs:

Cell b171749c-eb7e-4024-b793-553484960cd4 creating container for instance 5851c0e8-930b-41e2-bd37-8a3436a94b25
Cell b171749c-eb7e-4024-b793-553484960cd4 successfully created container for instance 5851c0e8-930b-41e2-bd37-8a3436a94b25
Downloading app package...
Downloading build artifacts cache...
Downloaded app package (163.1K)
Downloaded build artifacts cache (113.9M)
-----> Download go 1.9.1
-----> Running go build supply
-----> Nodejs Buildpack version 1.6.31
       **WARNING** buildpack version changed from 1.6.30 to 1.6.31
-----> Installing binaries
       engines.node (package.json): >=8.6
       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.9.0
       Download [https://buildpacks.cloudfoundry.org/dependencies/node/node-10.9.0-linux-x64-cflinuxfs2-1b642d9e.tgz]
       Using default npm version: 6.2.0
-----> Installing yarn 1.9.4
       Download [https://buildpacks.cloudfoundry.org/dependencies/yarn/yarn-v1.9.4-7667eb71.tar.gz]
       Installed yarn 1.9.4
-----> Creating runtime environment
       PRO TIP: It is recommended to vendor the application's Node.js dependencies
       Visit http://docs.cloudfoundry.org/buildpacks/node/index.html#vendoring
       NODE_ENV=development-one
       NODE_HOME=/tmp/contents155775920/deps/0/node
       NODE_MODULES_CACHE=true
       NODE_VERBOSE=false
       NPM_CONFIG_LOGLEVEL=error
       NPM_CONFIG_PRODUCTION=true
       npm scripts will see NODE_ENV=production (not 'development-one')
       https://docs.npmjs.com/misc/config#production
-----> Building dependencies
       Installing node modules (yarn.lock)
       Running yarn in online mode
       To run yarn in offline mode, see: https://yarnpkg.com/blog/2016/11/24/offline-mirror
yarn install v1.9.4
[1/4] Resolving packages...
[2/4] Fetching packages...
(node:223) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
/tmp/contents155775920/deps/0/yarn/yarn-v1.9.4/lib/cli.js:84692
          reject(new (_errors || _load_errors()).MessageError(this.reporter.lang('fetchErrorCorrupt', err.message, tarballPath)));
Exit status 223
                                                                            ^
TypeError: Cannot read property 'lang' of undefined
    at Extract.<anonymous> (/tmp/contents155775920/deps/0/yarn/yarn-v1.9.4/lib/cli.js:84692:77)
    at Extract.emit (events.js:187:15)
    at Extract.onheader (/tmp/contents155775920/deps/0/yarn/yarn-v1.9.4/lib/cli.js:147293:12)
    at Extract.module.exports.Extract._write (/tmp/contents155775920/deps/0/yarn/yarn-v1.9.4/lib/cli.js:147417:8)
    at doWrite (/tmp/contents155775920/deps/0/yarn/yarn-v1.9.4/lib/cli.js:71841:64)
    at writeOrBuffer (/tmp/contents155775920/deps/0/yarn/yarn-v1.9.4/lib/cli.js:71830:5)
    at Extract.module.exports.Writable.write (/tmp/contents155775920/deps/0/yarn/yarn-v1.9.4/lib/cli.js:71747:11)
    at HashStream.ondata (_stream_readable.js:666:20)
    at HashStream.emit (events.js:182:13)
    at addChunk (_stream_readable.js:283:12)
       **ERROR** Unable to build dependencies: exit status 1
Failed to compile droplet: Failed to run all supply scripts: exit status 14
Cell b171749c-eb7e-4024-b793-553484960cd4 stopping instance 5851c0e8-930b-41e2-bd37-8a3436a94b25
Cell b171749c-eb7e-4024-b793-553484960cd4 destroying container for instance 5851c0e8-930b-41e2-bd37-8a3436a94b25
Cell b171749c-eb7e-4024-b793-553484960cd4 successfully destroyed container for instance 5851c0e8-930b-41e2-bd37-8a3436a94b25

FAILED
Error restarting application: BuildpackCompileFailed

Let's note:

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/160106939

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

sclevine commented 6 years ago

Thanks for the note @oprogramador.

We don't host node modules, so I don't think there's much we can do about this. Could you vendor your app?

oprogramador commented 6 years ago

@sclevine

if I don't resolve this issue, that seems to be another approach to try. In CI I install all the dependencies including the dev ones so it should require another building with only prod dependencies but I can do that.

ameyer-pivotal commented 6 years ago

@oprogramador We'll go ahead and close this for now, since it's not something we control. That said, please feel free to re-open if you have anymore trouble or have more questions.

oprogramador commented 6 years ago

@ameyer-pivotal

I fixed this by removing setting yarn config https://github.com/cloudfoundry/nodejs-buildpack/blob/master/src/nodejs/yarn/yarn.go#L53-L61

I didn't open a PR because I keep it in a private repo in order to have a better control