Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatiblity with CF diego release #11

Closed
vvraskin opened this issue Oct 2, 2015 · 6 comments
Closed

Incompatiblity with CF diego release #11

vvraskin opened this issue Oct 2, 2015 · 6 comments

Comments

@vvraskin
Copy link

vvraskin commented Oct 2, 2015

Hello,

Recently we have tested our "HelloWorld" nodejs apps on the diego part of CF. As can be followed from the release notes https://github.com/cloudfoundry-incubator/diego-design-notes, several env variables inside of containers were deprecated.

The call of 'cfenv.getAppEnv' causes the following error: 'Error: cfenv: expecting VCAP_APPLICATION to contain uris when not runninng locally'

Could you please test the code on diego or let me know if I can somehow help here?

Thanks in advance.

Regards,
Vadim

@pmuellr
Copy link
Member

pmuellr commented Oct 2, 2015

Could you please test the code on diego or let me know if I can somehow help here?

I don't have a clue as to how I would test on diego. I'm not set up to run a CF install. If there's a Docker image that just runs, zero setup time, that I can test with - or something similar - let me know. Or is anyone running some kind of a sandbox live?

With regard to the changes, I guess this is the relevant info?

Looks like we can make a fix here: lib-src/cfenv.coffee

Something like from:

uris = appEnv.app?.uris

to:

uris = appEnv.app?.uris || []

Might work. Wanna give it a try?

The equivalent line in the js file, if you don't want to futz with a build, and just whack it to try it, is here: lib/cfenv.js

That change would be something like from:

uris = (ref = appEnv.app) != null ? ref.uris : void 0;

to:

uris = (ref = appEnv.app) != null ? ref.uris : [];

@pmuellr
Copy link
Member

pmuellr commented Oct 2, 2015

Not a breaker, but will also want to change the reference of VCAP_APP_PORT to CF_INSTANCE_PORT. That's why you should always use the PORT environment variable (he says, wiping his brow, thankful they didn't deprecate the PORT environment variable).

@pmuellr
Copy link
Member

pmuellr commented Oct 3, 2015

@vvraskin - I have a branch for you to try. In your package.json dependencies, use the following instead of the cfenv version number:

cloudfoundry-community/node-cfenv#pmuellr/issue-11

You can also use that from the command-line, to install locally, without referencing your package.json:

npm install cloudfoundry-community/node-cfenv#pmuellr/issue-11

Let me know if it works, I'll push it up to npm as a new version.

@vvraskin
Copy link
Author

vvraskin commented Oct 4, 2015

I've checked my code with the updated version of cfenv on Diego, it seems to be working fine.
So you may push it to npm.

Could you please let me know once you do that.

Thanks.

@pmuellr
Copy link
Member

pmuellr commented Oct 4, 2015

@vvraskin - npm has been updated to 1.0.3

@pmuellr
Copy link
Member

pmuellr commented Oct 9, 2015

closing as I believe this has been resolved

@pmuellr pmuellr closed this as completed Oct 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants