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

A configserver import in a profile-specific file doesn't import anything #26950

Closed
wyhasany opened this issue Jun 17, 2021 · 5 comments
Closed
Labels
status: duplicate A duplicate of another issue type: regression A regression from a previous release

Comments

@wyhasany
Copy link

Describe the bug
Integration with importing aka spring.config.import seems broken since Spring Boot 2.5.1 with newest spring-cloud-config 3.0.4.

Sample
Actually I don't know on which side the bug is. Here:
spring-config.zip
you can find example based on tutorial. You should unpack zip at /tmp/spring-cloud and then run server + client. Client should be run with dev profile. Once you call endpoint http://127.0.0.1:8080/message you should see Hello Dev!. With Spring Boot 2.5.0 it works as expected. However after changing build.gradle of client to:

	id 'org.springframework.boot' version '2.5.1'

Configurations are no longer fetched from the server. So you can see only the default value Hello default on http://127.0.0.1:8080/message

You can also verify if property message was fetched with help of:
http://127.0.0.1:8080/actuator/env/message

This bug was also reported at spring-cloud-config:
spring-cloud/spring-cloud-config#1913

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 17, 2021
@wilkinsona wilkinsona changed the title [Regression] Importing additional data (properties) won't work with Spring Boot 2.5.1 A configserver import in a profile-specific file doesn't import anything Jun 17, 2021
@wilkinsona
Copy link
Member

The change in behaviour is due to #26753. The spring.config.import will work if you move it into application.properties.

@wilkinsona wilkinsona added the for: team-attention An issue we'd like other members of the team to review label Jun 17, 2021
@wyhasany
Copy link
Author

@wilkinsona that's correct. It fixes my case. I think it should be a bit better described maybe in docs, but definitely here:
https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.5-Release-Notes
Anyway it solves my issue. Thanks a lot 👍

@wyhasany
Copy link
Author

What should I do if I use different URLs of configserver for different environments but I don't use a default one?

@kaliy
Copy link
Contributor

kaliy commented Jun 18, 2021

Hi, I have the same issue, I described it in #26858 because I thought it is related to my case: #26858 (comment)

I think this is a really breaking change that shouldn't be part of the minor release.

@wilkinsona
Copy link
Member

#26960 is going to restore the previous behaviour.

@wilkinsona wilkinsona added status: duplicate A duplicate of another issue type: regression A regression from a previous release and removed for: team-attention An issue we'd like other members of the team to review status: waiting-for-triage An issue we've not yet triaged labels Jun 19, 2021
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 type: regression A regression from a previous release
Projects
None yet
Development

No branches or pull requests

4 participants