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

No option to update env or refresh properties. #1344

Closed
agamgupta6 opened this issue Jan 8, 2020 · 6 comments
Closed

No option to update env or refresh properties. #1344

agamgupta6 opened this issue Jan 8, 2020 · 6 comments
Labels

Comments

@agamgupta6
Copy link

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
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?

@agamgupta6
Copy link
Author

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":{

            }
         }
      ]
   }
]

@joshiste
Copy link
Collaborator

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.

@agamgupta6
Copy link
Author

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

image

@agamgupta6
Copy link
Author

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

@agamgupta6
Copy link
Author

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.

@guerricmerleHUG
Copy link

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

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

No branches or pull requests

3 participants