-
Notifications
You must be signed in to change notification settings - Fork 41.2k
spring.profiles.include is silently ignored when used in a profile-specific document #24733
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
Comments
But please allow use of legacy flags. I have reverted to old method as the new method is yet unable to address few problems( #24720 ) and will take some time to mature when new issues pop up. |
Add a test to ensure that `spring.profiles.include` is not silently ignored when used in a profile-specific file. See gh-24733
I've been unable to replicate this with the latest 2.4.x. @perilbrain Do you have a sample project that shows the silent failure? |
In #24720 I have attached a file. All you need is to remove With # ==========================
# Dont touch legacy support
# ==========================
spring.config.use-legacy-processing=true
spring.profiles.active=local
result will be $> http :8080/who
Active Profile Details: envType=application-local.properties, password=prod, common='from_common_profile' When legacy removed in # ==========================
# Dont touch legacy support
# ==========================
# spring.config.use-legacy-processing=true
spring.profiles.active=local result will be $> http :8080/who
Active Profile Details: envType=application-local.properties, password=MissingPassword, common='MissingCommon' And yes application keeps on running without any hard fail. |
Thanks @perilbrain, I made a simple typo which is why my test didn't fail 🤦 |
Hi, I'm currently in a process of migrating our services configuration from the old solution to Spring Cloud. Yesterday I created a little application which would be used for demonstrating the solution to my colleagues. I used the newest version including the bugfix for this issue. My app crashed. Reverting the Spring Boot version to 2.4.1 fixed the problem. Our configuration repository structure looks quite regular. An excerpt:
I wanted to reduce each app's configuration that is provided at startup to the bare minimum (i.e. the config server uri only, all other stuff including active profiles declarations would be externalized) so I declared that my demo app uses rabbitmq properties by adding
After upgrading the Spring Boot to 2.4.2 the app crashes at the very start with exception:
Initially I thought that maybe a dash in the app (and its config file) name is interpreted as a name/profile separator but when I moved This is a slightly trimmed response from the config server (
In my opinion it should be permitted to specify profiles in an external configuration as long as particular file is not profile-specific. I hope what I described makes sense. I'd gladly prepare a demo that reproduces this behavior. |
@konradczajka Thanks for letting us know. I'm not sure that I have followed the description of the problem. For example, it's not clear to me where |
@wilkinsona Thank you for the reply. It was a mistake - it should be |
We ran into this issue when upgrading to 2.4.2 from 2.3.x. We were using |
@workmanw It sounds like that might be a related but different issue. Can you open a new report and if possible provide a sample application that we can run? |
See #22693 for the introduction of failing hard and #22944 which relaxed things a little to allow its use in non-profile-specific documents. As things stand, it would appear that
spring.profiles.include
is being silently ignored when used in a profile-specific document.At the least, I think we should update the release notes on the wiki as there's no mention of
spring.profiles.include
at the moment. Ideally, I think we'd also fail hard whenspring.profiles.include
is used in a profile-specific document. Flagging for team attention to see what the rest of the team thinks.The text was updated successfully, but these errors were encountered: