spring-cloud-config icon indicating copy to clipboard operation
spring-cloud-config copied to clipboard

specific config properties can't be loaded in v4.0.3

Open flashvayne opened this issue 2 years ago • 6 comments

After I upgrade version of spring-cloud-config-client to 4.0.3 from 4.0.2, specific properties from config-server can't be loaded. I made a demo to reproduce this. please refer to it. https://github.com/flashvayne/demo-issue-spring-cloud-config

I saw the source code and I think it is caused by the filter method. https://github.com/spring-cloud/spring-cloud-config/blob/v4.0.3/spring-cloud-config-client/src/main/java/org/springframework/cloud/config/client/ConfigServerConfigDataLoader.java#L196

flashvayne avatar Jun 20 '23 03:06 flashvayne

https://github.com/spring-cloud/spring-cloud-config/blob/662d9a8084b9c917242b99f1d50d6d4c667b89d7/spring-cloud-config-client/src/main/java/org/springframework/cloud/config/client/ConfigServerConfigDataLoader.java#L223

Cuts the first character, if the applicationName does NOT contain a slash !

jlippmann avatar Jun 20 '23 09:06 jlippmann

https://github.com/spring-cloud/spring-cloud-config/blob/662d9a8084b9c917242b99f1d50d6d4c667b89d7/spring-cloud-config-client/src/main/java/org/springframework/cloud/config/client/ConfigServerConfigDataLoader.java#L223

Cuts the first character, if the applicationName does NOT contain a slash !

It's correct. Also StringIndexOutOfBoundsException occurs in my demo due to the code.

flashvayne avatar Jun 20 '23 09:06 flashvayne

Even if StringIndexOutOfBoundsException was not thrown, my profile "uat" would not be loaded. As for below code, in my demo, the value of propertySource.getName() is configserver:Config resource 'class path resource [config-file/application.yml]' via location 'classpath:/config-file/' (document #0) which doesn't match the profile.

https://github.com/spring-cloud/spring-cloud-config/blob/662d9a8084b9c917242b99f1d50d6d4c667b89d7/spring-cloud-config-client/src/main/java/org/springframework/cloud/config/client/ConfigServerConfigDataLoader.java#L208

flashvayne avatar Jun 20 '23 10:06 flashvayne

Have the same issue - no longer able to load properties from configuration server after update to 4.0.3 (as part of update to spring cloud 2022.0.3). Had to roll back to 4.0.2.

illialean avatar Jul 20 '23 09:07 illialean

The problem remains in 4.0.4; also had to roll back to 4.0.2

magnus-larsson avatar Sep 23 '23 12:09 magnus-larsson

this appears to be resolved with 4.1.1

adamleantech avatar Apr 29 '24 11:04 adamleantech