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

InvalidConfigDataPropertyException thrown when server processed ConfigData contains profiles #24890

philwebb opened this issue Jan 19, 2021 · 1 comment


Copy link

@philwebb philwebb commented Jan 19, 2021

With Spring Cloud Config Server any and spring.profiles.include properties should only apply to the server-side. The config should ignore them. See #24876 and spring-cloud/spring-cloud-config#1788 for additional background.

Since we don't want to revert #24733, we need to find a way for Spring Cloud's ConfigServerConfigDataLocationResolver to indicate that a property source should not process any of it's profile properties. It looks like we might be able to do this by adding a ConfigData.IGNORE_PROFILES option that Spring Cloud can set.

Copy link
Member Author

@philwebb philwebb commented Jan 20, 2021

I've got a fix that should restore previous Spring Cloud Config Server behavior. There is one unfortunate issue that I can't fix until Spring Boot 2.5. If you have a property defined only on the server-side, there is no way to not have it apply to the client-side. This is due to AbstractEnvironment.doGetActiveProfiles().

I think we can live with this limitation for now, since the same thing happened with previous versions of Spring Cloud/Boot.

@philwebb philwebb modified the milestones: 2.4.x, 2.4.3 Jan 20, 2021
@philwebb philwebb closed this in 80dbbaf Jan 20, 2021
philwebb added a commit that referenced this issue Apr 9, 2021
Add custom `ApplicationEnvironment`, `ApplicationServletEnvironment`
and `ApplicationReactiveWebEnvironment` subclasses for use with
`SpringApplication`. The subclasses all disable the resolution of
active and default profiles using properties since this is handled
directly by the `ConfigDataEnvironmentPostProcessor`.

Closes gh-24892
See gh-24890
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant