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

(Jubilee 2021.0.0-M1 + 2.6.0-M1) to (Jubilee 2021.0.0-M1 + 2.6.0-M2) The dependencies of some of the beans in the application context form a cycle: org.springframework.cloud.config.server.environment.vault.SpringVaultClientConfiguration #1956

Closed
patpatpat123 opened this issue Aug 29, 2021 · 7 comments

Comments

@patpatpat123
Copy link

patpatpat123 commented Aug 29, 2021

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.

@ryanjbaxter
Copy link
Contributor

Can you try 2021.0.0-SNAPSHOT?

@patpatpat123
Copy link
Author

Hello,

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

@patpatpat123
Copy link
Author

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

@ryanjbaxter
Copy link
Contributor

There was a change in Spring Boot
spring-projects/spring-boot#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.

@patpatpat123
Copy link
Author

patpatpat123 commented Sep 24, 2021

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

@ryanjbaxter
Copy link
Contributor

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.

@patpatpat123
Copy link
Author

Hello @ryanjbaxter,

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants