Spring-boot-admin: No option to update env or refresh properties.

Created on 8 Jan 2020  路  6Comments  路  Source: codecentric/spring-boot-admin

Hi,

I am using spring-boot-admin this is my pom for server:

<dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter -->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter</artifactId>
            <version>2.1.4.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.junit.vintage</groupId>
                    <artifactId>junit-vintage-engine</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>de.codecentric</groupId>
            <artifactId>spring-boot-admin-starter-server</artifactId>
            <version>2.1.6</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
    </dependencies>

In the client I have this:

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

I have enabled all actuator endpoint and made all security to false:

<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-config-server</artifactId>
            <version>2.2.0.RELEASE</version>
        </dependency>
management.endpoints.web.exposure.include=*
management.endpoint.health.show-details=always



md5-3ee1a8223a9bef22d808311ac7176ccf



http.csrf().disable();
http.authorizeRequests()
         .antMatchers("/actuator/**") 
         .permitAll()
         .anyRequest()
         .authenticated()
         .and()
         .oauth2Login()
         .userInfoEndpoint()
         .oidcUserService(userService)

I am able to refresh properties from Postman by sending post request to /actuator refresh. But I do not see any option on spring-boot-admin page to change and refresh the configuration property.
Is is supported? Did I miss any configuration?

invalid

Most helpful comment

same issue but after upgraded springboot/springcloud version.
For people that have the same thing, the issue reference : https://github.com/spring-projects/spring-boot/issues/20509 and https://github.com/spring-cloud/spring-cloud-commons/issues/681

All 6 comments

This is the output of /applications

[
   {
      "name":"Backend",
      "buildVersion":null,
      "status":"UP",
      "statusTimestamp":"2020-01-08T03:15:36.843Z",
      "instances":[
         {
            "id":"1d6dd2f89fdb",
            "version":6,
            "registration":{
               "name":"Backend",
               "managementUrl":"http://apps-Inspiron:8082/actuator",
               "healthUrl":"http://apps-Inspiron:8082/actuator/health",
               "serviceUrl":"http://apps-Inspiron:8082/",
               "source":"http-api",
               "metadata":{
                  "startup":"2020-01-07T22:15:36.302-05:00"
               }
            },
            "registered":true,
            "statusInfo":{
               "status":"UP",
               "details":{
                  "diskSpace":{
                     "status":"UP",
                     "details":{
                        "total":102674538496,
                        "free":9274589184,
                        "threshold":10485760
                     }
                  },
                  "ping":{
                     "status":"UP"
                  },
                  "discoveryComposite":{
                     "description":"Discovery Client not initialized",
                     "status":"UNKNOWN",
                     "details":{
                        "discoveryClient":{
                           "description":"Discovery Client not initialized",
                           "status":"UNKNOWN"
                        }
                     }
                  },
                  "refreshScope":{
                     "status":"UP"
                  }
               }
            },
            "statusTimestamp":"2020-01-08T03:15:36.843Z",
            "info":{
               "app":{
                  "name":"Backend",
                  "description":"This is backend application",
                  "version":"1.0.0"
               }
            },
            "endpoints":[
               {
                  "id":"caches",
                  "url":"http://apps-Inspiron:8082/actuator/caches"
               },
               {
                  "id":"loggers",
                  "url":"http://apps-Inspiron:8082/actuator/loggers"
               },
               {
                  "id":"health",
                  "url":"http://apps-Inspiron:8082/actuator/health"
               },
               {
                  "id":"refresh",
                  "url":"http://apps-Inspiron:8082/actuator/refresh"
               },
               {
                  "id":"env",
                  "url":"http://apps-Inspiron:8082/actuator/env"
               },
               {
                  "id":"heapdump",
                  "url":"http://apps-Inspiron:8082/actuator/heapdump"
               },
               {
                  "id":"features",
                  "url":"http://apps-Inspiron:8082/actuator/features"
               },
               {
                  "id":"scheduledtasks",
                  "url":"http://apps-Inspiron:8082/actuator/scheduledtasks"
               },
               {
                  "id":"mappings",
                  "url":"http://apps-Inspiron:8082/actuator/mappings"
               },
               {
                  "id":"beans",
                  "url":"http://apps-Inspiron:8082/actuator/beans"
               },
               {
                  "id":"configprops",
                  "url":"http://apps-Inspiron:8082/actuator/configprops"
               },
               {
                  "id":"threaddump",
                  "url":"http://apps-Inspiron:8082/actuator/threaddump"
               },
               {
                  "id":"metrics",
                  "url":"http://apps-Inspiron:8082/actuator/metrics"
               },
               {
                  "id":"conditions",
                  "url":"http://apps-Inspiron:8082/actuator/conditions"
               },
               {
                  "id":"info",
                  "url":"http://apps-Inspiron:8082/actuator/info"
               },
               {
                  "id":"jolokia",
                  "url":"http://apps-Inspiron:8082/actuator/jolokia"
               }
            ],
            "buildVersion":null,
            "tags":{

            }
         }
      ]
   }
]

If you have the spring-cloud-common on your classpath, the /env endpoint supports post request and the /refresh endpoint is available - then SBA will show you an environment manager section on the environment page which allows you to update the spring property as well as trigger a refresh of the refresh-scoped beans.

Well .. I just checked and I do have spring-cloud-common on my classpath. Below is screen shot

image

above screen shot is for my client app. Even SBA also have spring-cloud-commons on class path but I can not see any option of "environment manager".

image

I found the problem. I was using external configuration and in one of such file "app.cors" was enabled which was preventing the Environment Manager to be displayed.

same issue but after upgraded springboot/springcloud version.
For people that have the same thing, the issue reference : https://github.com/spring-projects/spring-boot/issues/20509 and https://github.com/spring-cloud/spring-cloud-commons/issues/681

Was this page helpful?
0 / 5 - 0 ratings