-
Notifications
You must be signed in to change notification settings - Fork 541
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
Error getting config from consul if two profiles specified with different values of some properties #802
Comments
|
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed. |
@spencergibb But why this doen't work even in default profile? When I want to enable config from discovery. In this case, I expect that properties defined under Maybe, I don't clear understand some details. Can you advice what I need to chage in my config, if I want to enable two config sources(from config-server located via consul-discovery and from consul key-value) by default, and to disable config and discovery during tests? |
I have also tried to put New application.yml:
Error:
|
@spencergibb could you provide feedback, please? |
I don't know why it is trying to get a value from an inactive resource
I'll have to work with someone from the boot team. /cc @philwebb |
thanks |
Don't open anything in boot unless our investigation reveals that we need to |
I'm not 100% sure what's going on, but I suspect that the binder being used in this line is wrong or stale. Ideally, the binder should only be used in the @spencergibb Do you have a sample application for this one? Have you managed to reproduce it locally? |
I have reproduced it. I can share tomorrow |
If you need my help with reproducing or fixing this bug, I would be glad to help you |
Hello there, Seems like I've faced this issue as well - if "spring.cloud.config.discovery" is enabled then I can't override Consul port in another profile as ConsulClient is initialized with default ConsulProperties values in that case. Looks like issue is actually here - the Binder seems to be invalid as it doesn't bind properties from the current profile, only from initial "application.yaml" (while Binder in ConfigDataLocationResolverContext, for example, actually binds correct value). I faced this issue using following versions:
There are application properties: application.yaml
application-dev.yaml
So the ConsulProperties are initialized with default 8500 port instead of 9091 provided in "application-dev.yaml". P.S. I would like to not use ConfigServer for some profiles (like 'local') this is why "spring.config.import" is not in "application.yaml", but in other profiles which will use ConfigServer |
|
I've updated spring cloud from 2021.0.4 to 2021.0.5.
After updating I get an error while starting my spring-boot application.
I noticed, that problem is because I have
test
profile with disabled cloud services.If I comment all properties which has **.discovery.** in name - it works
Of course it doesn't work in 'test' profile, because by default, discovery is enabled.
As I understand, such behaviour happens because of #785
Is that bug? Or I have mistakes in my configuration?
my application.yml
Stacktrace:
The text was updated successfully, but these errors were encountered: