A small issue observed after migration.

Disclaimer: I am filing this issue on Spring Cloud Config Server, but if you believe this issue should be for Spring Cloud, or Spring Boot, please let me know, I will close and amend.

Background: I had a very simple Spring Cloud Config Server application: with version Jubilee 2021.0.0-M1 + 2.6.0-M1. Working fine, very happy.

@EnableConfigServer
@SpringBootApplication
public class Application {

    public static void main(String[] args) {
        SpringApplication.run(Application.class);
    }

}

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.6.0-M1</version>
        <relativePath/>
    </parent>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>2021.0.0-M1</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

The M2 got announced here: https://spring.io/blog/2021/08/19/spring-boot-2-6-0-m2-is-now-available Therefore, I went to do the version bump up to Jubilee 2021.0.0-M1 + 2.6.0-M2 a bit excited!

Unfortunately, after the version bump, application cannot startup, with this error

***************************
APPLICATION FAILED TO START
***************************

Description:

The dependencies of some of the beans in the application context form a cycle:

   pathMappedEndpoints defined in class path resource [org/springframework/boot/actuate/autoconfigure/endpoint/web/WebEndpointAutoConfiguration.class]
      ↓
   healthEndpoint defined in class path resource [org/springframework/boot/actuate/autoconfigure/health/HealthEndpointConfiguration.class]
      ↓
   healthContributorRegistry defined in class path resource [org/springframework/boot/actuate/autoconfigure/health/HealthEndpointConfiguration.class]
      ↓
   configServerHealthIndicator defined in class path resource [org/springframework/cloud/config/server/config/EnvironmentRepositoryConfiguration$ConfigServerActuatorConfiguration.class]
      ↓
   org.springframework.cloud.config.server.config.CompositeConfiguration
      ↓
   vaultEnvironmentRepository defined in class path resource [org/springframework/cloud/config/server/config/SpringVaultRepositoryConfiguration.class]
      ↓
   vaultEnvironmentRepositoryFactory defined in class path resource [org/springframework/cloud/config/server/config/EnvironmentRepositoryConfiguration$SpringVaultFactoryConfig.class]
┌─────┐
|  org.springframework.cloud.config.server.environment.vault.SpringVaultClientConfiguration
└─────┘


Action:

Relying upon circular references is discouraged and they are prohibited by default. Update your application to remove the dependency cycle between beans. As a last resort, it may be possible to break the cycle automatically be setting spring.main.allow-circular-references to true if you have not already done so.

Fore sure, it is the version bump, as I just change one number in the whole project (revert back to 2.6.0-M1 = work 2.6.0-M2 = does not work)

May I ask what is the issue? Maybe some workaround?

Hope this issue is helpful, thank you for your time.

Comment From: ryanjbaxter

Can you try 2021.0.0-SNAPSHOT?

Comment From: patpatpat123

Hello,

What kind of magic is that! Indeed, issue resolved. Thanks @ryanjbaxter

Comment From: patpatpat123

(If I may ask, what is the root cause, and can the fix of this issue be expected for 2.6.0-M3 please?)

Comment From: ryanjbaxter

There was a change in Spring Boot https://github.com/spring-projects/spring-boot/issues/27652

Our next Spring Cloud 2021.0.0 milestone will be compatible.

You can try using Spring Cloud 2021.0.0-M1 and set spring.main.allow-circular-references=true and see if that makes things work temporarily.

Comment From: patpatpat123

Hello @ryanjbaxter,

As announce today https://spring.io/blog/category/releases "Spring Boot 2.6.0-M3 available now"

This is super exciting, thank you Spring Team.

Unfortunately, even after bumping to

<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.6.0-M3</version>
        <relativePath/>
    </parent>

PLUS

<dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>2021.0.0-M1</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

The problem still persists.

May I ask what is the correct way please? I was hoping this M3 release would fix the issue.

Thank you for your time

Comment From: ryanjbaxter

The next Spring Cloud Milestone will address this, until that is released you will need to continue to use the property above.

The milestone should be released this week.

Comment From: patpatpat123

Hello @ryanjbaxter,

Thank you for your input. Confirmed, I just updated and the issue is resolved. Thank you!