Doc Holiday
Doc Holiday

Reputation: 10254

cloudfoundry - Settng environment variable -Failed

Trying to set an env variable based off documentation

https://github.com/cloudfoundry/java-buildpack/blob/master/docs/container-tomcat.md

$ cf set-env my-application JBP_CONFIG_TOMCAT '{tomcat: { context_path: /first-segment/second-segment }}'

Getting the following:

FAILED Incorrect Usage. Requires 'app-name env-name env-value' as arguments

Upvotes: 0

Views: 1510

Answers (3)

Pratik Prakash
Pratik Prakash

Reputation: 100

Raeason for this error is invalid JSON from CF point oif view due to space. It treats space as end of param and start of another input.

You can see from here : Below is valid one

Valid commnand : cf set-env my-application JBP_CONFIG_TOMCAT {aaa:{ff:/kk}}

Invalid command : due to space in JSON: cf set-env my-application JBP_CONFIG_TOMCAT {aaa: {ff:/kk}}

It has nothing to do with . BOSH installation and warden container make filesystem OS agnostic.

Upvotes: 2

Scott Frederick
Scott Frederick

Reputation: 5115

What operating system are you using? Those examples assume a Linux variant. The escaping rules for the json string will be different for Windows.

Upvotes: 1

Corbin
Corbin

Reputation: 162

The CF CLI team tries to handle all user issues and bug reports through Github issues, would you mind opening one? https://github.com/cloudfoundry/cli/issues/new

Upvotes: 0

Related Questions