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

Property replacement in bootstrap.yml broken by PropertyPlaceholderHelper in 6.2.x #34224

Closed
ph33rtehgd opened this issue Jan 9, 2025 · 1 comment
Labels
status: duplicate A duplicate of another issue

Comments

@ph33rtehgd
Copy link

ph33rtehgd commented Jan 9, 2025

After upgrading from Spring 6.1 to 6.2 we are noticing an issue that values inside our bootstrap.yml file aren't being replaced by environment properties. For example, we will use environment variables to list out of Spring Cloud Config Client names like such in our bootstrap.yml file:

spring.cloud.config.name: eureka_client,${PROPS_COMMON_FILES},${PROPS_ENV_FILES},more_properties,etc

And the above ${PROPS_COMMON_FILES} and ${PROPS_ENV_FILES} are export variables in our environment that are common across numerous services.

In Spring versions prior to 6.2.x, this worked fine, however due to changes to the PropertyPlaceholderHelper in this commit here e3aa5b6#diff-2696179dea5ac1f4777fa47ef1ce064dc4d30525b42571ec05059470c5aa85d2R112 (specifically the changes to the "parseStringValue" method), these properties aren't interpretted correctly from the environment and instead the ${PROPS_COMMON_FILES} will remain unresolved in our application's request to the Spring Cloud Config server.

This commit states that "The only noticeable side effect is that the exception is no longer an IllegalArgumentException, but rather the dedicated PlaceholderResolutionException.", however I believe there's a functional change here that maybe wasn't anticipated.

For additional context, the Spring Cloud Config client is calling the environment method "resolvePlaceholders" while passing in this value: ${spring.cloud.config.name:${spring.application.name:application}}

I have a feeling the old implementation of the PropertyPlaceholderHelper class was doing nested resolutions whereas the new version may only be doing one level of resolution.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jan 9, 2025
@ph33rtehgd
Copy link
Author

Ignore. I only just realized this was a bug introduced in 6.2.0 that was fixed in 6.2.1 by this issue: #34020

@bclozel bclozel closed this as not planned Won't fix, can't repro, duplicate, stale Jan 9, 2025
@bclozel bclozel added status: duplicate A duplicate of another issue and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

3 participants