spring-cloud / spring-cloud/spring-cloud-consul
ConfigWatch double // problem
Open
Nobody has claimed this yet.
waiting-for-triage
- Dominant language
- Java
- Stars
- 822
- Forks
- 539
- Avg merge
- 9h 31m
- Merged PRs (30d)
- 7
Description
Describe the bug
consul returns 301 moved permanently
spring.config.import=consul:/test
The Problem is double //
StackTrace:
26-01-12T12:06:47.569+01:00 ERROR 35132 --- [zbm-parts-service] [TaskScheduler-1] o.s.s.s.TaskUtils$LoggingErrorHandler : Unexpected error occurred in scheduled task
org.springframework.web.client.UnknownContentTypeException: Could not extract response: no suitable HttpMessageConverter found for response type [java.util.List<org.springframework.cloud.consul.model.http.kv.GetValue>] and content type [text/html;charset=utf-8]
at org.springframework.web.client.DefaultRestClient.readWithMessageConverters(DefaultRestClient.java:258) ~[spring-web-7.0.2.jar:7.0.2]
at org.springframework.web.client.DefaultRestClient$DefaultResponseSpec.readBody(DefaultRestClient.java:903) ~[spring-web-7.0.2.jar:7.0.2]
at org.springframework.web.client.DefaultRestClient$DefaultResponseSpec.lambda$toEntityInternal$0(DefaultRestClient.java:843) ~[spring-web-7.0.2.jar:7.0.2]
at org.springframework.web.client.DefaultRestClient$DefaultRequestBodyUriSpec.exchangeInternal(DefaultRestClient.java:612) ~[spring-web-7.0.2.jar:7.0.2]
at org.springframework.web.client.DefaultRestClient$DefaultRequestBodyUriSpec.exchange(DefaultRestClient.java:567) ~[spring-web-7.0.2.jar:7.0.2]
at org.springframework.web.client.RestClient$RequestHeadersSpec.exchange(RestClient.java:750) ~[spring-web-7.0.2.jar:7.0.2]
at org.springframework.web.client.DefaultRestClient$DefaultResponseSpec.executeAndExtract(DefaultRestClient.java:896) ~[spring-web-7.0.2.jar:7.0.2]
at org.springframework.web.client.DefaultRestClient$DefaultResponseSpec.toEntityInternal(DefaultRestClient.java:842) ~[spring-web-7.0.2.jar:7.0.2]
problematic rest call:
Demo project is attached
spring boot :4.0.1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with spring-cloud-consul-config/src/main/java/org/springframework/cloud/consul/config/ConfigWatch.java at line 159, then reproduce the request using the attached consul-demo.zip project. Check the generated Consul request for the reported double slash and verify that the request no longer receives a 301 response.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring-boot
- Domain
- backend, cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100