1
votes

I am getting a 406 Not Acceptable error for my spring-boot actuator endpoints like /health, /env, /info etc

I am using spring-boot version 1.5.8

Accessing endpoints like http://localhost:6061/health http://localhost:6061/env

Here is bits of my gradle build file

buildscript {            
ext {            
    springBootVersion = '1.5.8.RELEASE'            
}                
dependencies {                        
    classpath(group: 'org.springframework.boot', name: 'spring-boot- 
gradle-plugin', version:'1.5.8.RELEASE')            
}            
}                  
repositories {            
mavenLocal()            
maven {            
    url "${artifactory_url}" + "libs-release"            
    credentials {            
        username = "${artifactory_user}"            
        password = "${artifactory_password}"            
    }            
}            
maven {            
    url "${artifactory_url}" + "libs-snapshot"            
    credentials {            
        username = "${artifactory_user}"            
        password = "${artifactory_password}"            
    }            
}                   
}       
apply plugin: 'com.jfrog.artifactory'            
 apply plugin: 'java'                                 
apply plugin: 'org.springframework.boot'            
apply plugin: 'project-report'     
dependencies {               
compile("org.apache.commons:commons-csv:1.4")            
runtime 'com.google.guava:guava:19.0'                        
 compile fileTree(dir: 'src/libs/', include: '*.jar')                      
compile("org.springframework.cloud:spring-cloud-stream:1.2.2.RELEASE")            
compile('org.springframework.cloud:spring-cloud-starter-hystrix- 
dashboard:1.3.1.RELEASE')            
compile('org.springframework.cloud:spring-cloud-starter- 
hystrix:1.3.1.RELEASE')            
compile('org.springframework.cloud:spring-cloud-starter- 
eureka:1.3.1.RELEASE')            
compile('org.springframework.cloud:spring-cloud-starter- 
turbine:1.3.1.RELEASE')                  
compile("org.springframework.boot:spring-boot-starter-actuator")                   
1
I presume the question would be how to access endpoints successfully? Can you update the ticket with how you are accessing the endpoint?Boris
@Boris Added the comment above, accessing this endpoint localhost:6061/healthuser9176614
Can you also add the application properties file? Do you have any actuator related settings?Boris
@Boris I do not have any actuator related settings in my application.properties.user9176614

1 Answers

0
votes

In Spring Boot actuator endpoints are typically exposed via HTTP and are mapped to a URL with a prefix of /actuator. For example, by default, the health endpoint is mapped to /actuator/health.

If your application is running locally on port 6061, the correct URLs will be:

http://localhost:6061/actuator/health
http://localhost:6061/actuator/env

See here for more details. You can also customize the prefix for the management endpoints in application.properties, for example:

management.endpoints.web.base-path=/manage

This changes the endpoint from /actuator/{id} to /manage/{id}.