Re: CF212 - golang app crash - how to perform the troubleshooting?


Gwenn Etourneau
 

These are env. variable in Go you can easily get it with os.Getenv("
VCAP_SERVICES") or you can use go-cfenv [1] as helper.


[1] https://github.com/cloudfoundry-community/go-cfenv/

On Wed, Apr 13, 2016 at 1:38 AM, JT Archie <jarchie(a)pivotal.io> wrote:

They are passed via environment variables and then your start command is
used to start the app.

This is an example of the startup script
<https://github.com/cloudfoundry/dea_ng/blob/master/lib/dea/starting/startup_script_generator.rb>
generated.

Does this help?


On Tue, Apr 12, 2016 at 7:52 AM, Rafal Radecki <radecki.rafal(a)gmail.com>
wrote:

Hi :)

I am starting an app and it crashes. In the meantime when it is trying to
start I login to appropriate warden container and after the app crashes I
try to start the go binary manually. The problem is that I am not able to
see in the environment variables like VCAP_SERVICES and I cannot pass its
content correctly to my app.

Can you tell me how to start my app inside the warden container once I
login through wsh with proper environment setup? I tried below:

root(a)19g7korv77m:/app# export
VCAP_SERVICES='{"mongodb26":[{"credentials":{"dbname":"...}
root(a)19g7korv77m:/app# bin/my_go_binary

but it is obviously not the proper way. How does cloudfoundry pass
variables to the process started in the warden container?

BR,
Rafal.

Join cf-dev@lists.cloudfoundry.org to automatically receive all group messages.