Search code examples
spring-bootspring-boot-admin

Duplicate key Endpoint exception while starting - in Spring Boot Admin Client


I'm trying to configure Spring Boot Admin Client but i'm start the client application not able to register with Server. While starting of the application I'm getting the below exception.

java.lang.IllegalStateException: Duplicate key Endpoint(id=threaddump, url=http://localhost:9082/client-web/management/actuator/dump)

i'm using dependency version of client same version which I have used it for Spring Boot Admin Server

<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.1.RELEASE</version>
        <relativePath /> <!-- lookup parent from repository -->
</parent>

<dependency>
            <groupId>de.codecentric</groupId>
            <artifactId>spring-boot-admin-starter-client</artifactId>
            <version>2.0.1</version>
</dependency>

what's causing the issue?


Solution

  • It was the known bug in 'Spring boot admin 1.x'. But has been fixed in the later version (2.0.2). Endpoints list is obtained from the AdminServerProperties class and defaults to

    {
      "health", "env", "metrics", "httptrace:trace", 
     "httptrace","threaddump:dump","threaddump", "jolokia", "info",
     "logfile", "refresh", "flyway", 
     "liquibase", "heapdump", "loggers","auditevents"
    
        };
    

    The problem with the duplicate key seems to be caused by the presence of both "httptrace:trace" and "httptrace" (and similarly for threaddump)

    Overriding this in config by adding the line seems to solve the problem.

    spring.boot.admin.probed-endpoints: [ "health", "env", "metrics", "httptrace:trace", "threaddump:dump", "jolokia", "info", "logfile", "refresh", "flyway", "liquibase", "heapdump", "loggers", "auditevents" ]
    

    Pls see this for more: https://github.com/codecentric/spring-boot-admin/issues/828

    Alternatively, you can update pom.xml as below

    <dependency>
                <groupId>de.codecentric</groupId>
                <artifactId>spring-boot-admin-starter-client</artifactId>
                <version>2.0.2 or above</version>
    </dependency>