spring-cloud / spring-cloud/spring-cloud-commons

Bootstrap fails when embedding config server

Open
#1,257 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

waiting-for-triage
Dominant language
Java
Stars
751
Forks
744
Avg merge
1d 14h
Merged PRs (30d)
9

Description

When embedding a Cloud Config Server and bootstrapping from that config server, the steps require using the spring.cloud.config.server.bootstrap: true flag.
https://cloud.spring.io/spring-cloud-config/multi/multi__embedding_the_config_server.html

However, the bootstrapping has been deprecated and was broken with the fix for #1158 .
Previous to this fix, when bootstrapping, two contexts would be created. The top-level was the bootstrap context and the second level was the application's context. The bootstrap context contained the bean for org.springframework.cloud.config.client.ConfigClientProperties, but the application context contained the propertySource for bootstrap.yml.

Before the fix for #1158, the ConfigurationPropertiesRebinder would bind the bean found in the bootstrap context using the application context's propertySources. I agree that this seems wrong, and can cause issues like described in #1158, however, now that the bean and propertySources need to be in the same context, I can't see a way to get an application to bootstrap properly. I believe this is a bug.

The last working version was org.springframework.cloud:spring-cloud-context: 3.1.4.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the embedding-the-config-server documentation and reproduce the bootstrap flow using spring-cloud-context 3.1.4 and the current version. Trace ConfigClientProperties and ConfigurationPropertiesRebinder across the bootstrap and application contexts, using fix #1158 as context. Done means an embedded Config Server can bootstrap correctly without the deprecated behavior breaking configuration binding.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring, spring-boot
Domain
backend, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.