Incompatiblity with CF diego release #11

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

Comments

Projects
None yet
2 participants
@vvraskin

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

This comment has been minimized.

Show comment
Hide comment
@pmuellr

pmuellr Oct 2, 2015

Member

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 : [];
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

This comment has been minimized.

Show comment
Hide comment
@pmuellr

pmuellr Oct 2, 2015

Member

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).

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

This comment has been minimized.

Show comment
Hide comment
@pmuellr

pmuellr Oct 3, 2015

Member

@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.

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

This comment has been minimized.

Show comment
Hide comment
@vvraskin

vvraskin 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.

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

This comment has been minimized.

Show comment
Hide comment
@pmuellr

pmuellr Oct 4, 2015

Member

@vvraskin - npm has been updated to 1.0.3

Member

pmuellr commented Oct 4, 2015

@vvraskin - npm has been updated to 1.0.3

@pmuellr

This comment has been minimized.

Show comment
Hide comment
@pmuellr

pmuellr Oct 9, 2015

Member

closing as I believe this has been resolved

Member

pmuellr commented Oct 9, 2015

closing as I believe this has been resolved

@pmuellr pmuellr closed this Oct 9, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment