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

Handling override of environment variables behavior is unexpected #149

Closed
rsdmike opened this issue Jul 30, 2019 · 1 comment
Closed

Handling override of environment variables behavior is unexpected #149

rsdmike opened this issue Jul 30, 2019 · 1 comment
Assignees
Labels
bug Something isn't working geneva

Comments

@rsdmike
Copy link
Member

rsdmike commented Jul 30, 2019

When trying to override a value using environment variables, i.e:

export Service_Port=50001

Something a little strange seems to be happening. You can see the error that it can't convert a string to an int, but this is as it is trying to unmarshal into the configuration struct which of course port is an int. The funny thing is, that you can see that it takes effect, but not because it unmarsalled, but because it was successfully sent to consul first before unmarshalling to configuration, and then a little later it receives the configuration back from consul and gets the appropriate value.

TL;DR: It works, just not in the expected or preferred manner. Its unmarshalled into configuration coming back from Consul, not from reading env or toml directly/locally.

This issue doesn't present itself in config-seed though i do imagine it would present itself in the device-services-sdk.

Starting Configurable Application Service...
failed to initialize Registry: could not unmarshal configTree to configuration: (0, 0): Can't convert 50001(string) to int
Configuration loaded from registry with service key: AppService-rules-engine
level=INFO ts=2019-07-30T22:54:30.8862683Z app=AppService-rules-engine source=sdk.go:250 msg="Configuration and logger successfully initialized"
level=INFO ts=2019-07-30T22:54:30.8972703Z app=AppService-rules-engine source=main.go:43 msg="Loading Configurable Pipeline..."
level=INFO ts=2019-07-30T22:54:30.8972703Z app=AppService-rules-engine source=sdk.go:374 msg="Listening for changes from registry"
level=INFO ts=2019-07-30T22:54:30.9062645Z app=AppService-rules-engine source=server.go:74 msg="Registering standard routes..."
level=INFO ts=2019-07-30T22:54:30.9182679Z app=AppService-rules-engine source=sdk.go:398 msg="Writable configuration has been updated from Registry"
level=INFO ts=2019-07-30T22:54:30.9222626Z app=AppService-rules-engine source=sdk.go:199 msg="MessageBus trigger selected"
level=INFO ts=2019-07-30T22:54:30.9302673Z app=AppService-rules-engine source=sdk.go:417 msg="ReLoaded Configurable Pipeline from Registry"
level=INFO ts=2019-07-30T22:54:30.9362657Z app=AppService-rules-engine source=messaging.go:45 msg="Initializing Message Bus Trigger. Subscribing to topic: events on port 5563 , Publish Topic:  on port 5566"
level=INFO ts=2019-07-30T22:54:30.957264Z app=AppService-rules-engine source=sdk.go:100 msg="AppServiceConfigurable-rules-engine has Started"
level=INFO ts=2019-07-30T22:54:30.9642924Z app=AppService-rules-engine source=server.go:96 msg="Starting HTTP Server on port :50001
@lenny-goodell lenny-goodell added this to New Issues in Applications WG Aug 1, 2019
@lenny-goodell lenny-goodell added this to To Do in Fuji Aug 1, 2019
@lenny-goodell lenny-goodell added bug Something isn't working fuji labels Aug 23, 2019
@lenny-goodell lenny-goodell moved this from New Issues to Icebox in Applications WG Sep 4, 2019
@lenny-goodell lenny-goodell added geneva and removed fuji labels Oct 24, 2019
@lenny-goodell lenny-goodell moved this from Icebox to Bugs in Applications WG Nov 12, 2019
@rsdmike rsdmike added the hold Intended for PRs we want to flag for ongoing review label Feb 14, 2020
@lenny-goodell lenny-goodell moved this from Bugs Backlog to New Issues in Applications WG Mar 4, 2020
@lenny-goodell lenny-goodell moved this from New Issues to On Hold in Applications WG Mar 4, 2020
@lenny-goodell lenny-goodell moved this from On Hold to In Progress in Applications WG Apr 17, 2020
@lenny-goodell lenny-goodell removed the hold Intended for PRs we want to flag for ongoing review label Apr 17, 2020
lenny-goodell referenced this issue in lenny-goodell/app-functions-sdk-go Apr 17, 2020
closes #264 & #149

Signed-off-by: lenny <leonard.goodell@intel.com>
lenny-goodell referenced this issue in lenny-goodell/app-functions-sdk-go Apr 17, 2020
closes #264 & #149

Signed-off-by: lenny <leonard.goodell@intel.com>
lenny-goodell referenced this issue in lenny-goodell/app-functions-sdk-go Apr 17, 2020
closes #264 & #149

Signed-off-by: lenny <leonard.goodell@intel.com>
lenny-goodell referenced this issue in lenny-goodell/app-functions-sdk-go Apr 17, 2020
closes #264 & #149

Signed-off-by: lenny <leonard.goodell@intel.com>
lenny-goodell referenced this issue in lenny-goodell/app-functions-sdk-go Apr 17, 2020
closes #264 & #149

Signed-off-by: lenny <leonard.goodell@intel.com>
lenny-goodell referenced this issue in lenny-goodell/app-functions-sdk-go Apr 17, 2020
closes #264 & #149

Signed-off-by: lenny <leonard.goodell@intel.com>
@lenny-goodell
Copy link
Member

addressed by #325

Applications WG automation moved this from In Progress to Done Apr 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working geneva
Projects
No open projects
Fuji
  
To Do
Development

No branches or pull requests

3 participants