habitat: Unable to parse TOML/JSON from ENV
I am attempting to use HAB_PACKAGENAME environment variables to override default.toml config options in my docker-packaged application, and no matter what content I put in the HAB_PACKAGENAME envvar, the hab sup reports that it cannot parse the content:
Unable to start finalze/active-oversight-api, hab-sup(CF)[src/manager/service/config.rs:248:20]: Unable to find valid TOML or JSON in HAB_ACTIVE_OVERSIGHT_API ENVVAR
I have tried working with habitat versions 0.50.3 and 0.51 with the same results. The same behavior has been observed on ECS running the latest docker-optimized Amazon Linux AMI as well as locally on a machine running Docker CE 17.12.0-ce on Ubuntu Linux 17.10
docker-compose snippet:
ao-worker:
image: "finalze/active-oversight-api"
environment:
- HAB_ACTIVE_OVERSIGHT_API="{'worker':'true'}"
hostname: "ao-worker"
links:
- postgres
- elasticsearch
- redis
env content within the container:
HAB_ACTIVE_OVERSIGHT_API="{'worker':'true'}"
other env contents that have produced the same error:
HAB_ACTIVE_OVERSIGHT_API='worker="true"'
HAB_ACTIVE_OVERSIGHT_API="worker='true'"
HAB_ACTIVE_OVERSIGHT_API="worker=true"
HAB_ACTIVE_OVERSIGHT_API=""
HAB_ACTIVE_OVERSIGHT_API="{}"
HAB_ACTIVE_OVERSIGHT_API={}
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 15 (9 by maintainers)
Commits related to this issue
- Fix handling of environment-level configuration When we were trying to parse TOML from an environment variable, we weren't properly type-hinting the result of that operation, which meant Rust derived... — committed to habitat-sh/habitat by christophermaier 6 years ago
- Fix handling of environment-level configuration When we were trying to parse TOML from an environment variable, we weren't properly type-hinting the result of that operation, which meant Rust derived... — committed to habitat-sh/habitat by christophermaier 6 years ago
To just clarify a bit more on environment variables - they have to be set at process creation. This isn’t anything specific to the supervisor (and its not a bug) - it’s just the way the environment works.