When the server has Spring Security, like a basic auth username and password, and the client is misconfigured you get this error:
Caused by: org.springframework.web.client.UnknownContentTypeException: Could not extract response: no suitable HttpMessageConverter found for response type [class org.springframework.cloud.config.environment.Environment] and content type [text/html;charset=UTF-8]
This is very misleading to the user. Since the endpoint does return a 403, it should be simple to improve the error handling for the user. Here is an example of someone running into the error on StackOverflow https://stackoverflow.com/questions/59941635/spring-boot-2-2-2-release-could-not-locate-propertysource-could-not-extract
Comment From: sharkdeng
How to solve this?
Comment From: hpoettker
This problem usually appears when form login is enabled in the config server, which is often the case as the auto-configured SecurityFilterChain
has form login enabled. When the config client sends the wrong credentials, the server will then respond with the HTML for the login page, which the client does not know how to handle.
If you don't need form login in the config server, you can disable it to solve the issue.