spring-cloud / spring-cloud/spring-cloud-consul

ConfigWatch double // problem

Open
#948 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

waiting-for-triage
Dominant language
Java
Stars
822
Forks
539
Avg merge
9h 31m
Merged PRs (30d)
7

Description

consul-demo.zip

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:

https://github.com/spring-cloud/spring-cloud-consul/blob/00397e92b2d71f66107ad00c1f5a76c53398c952/spring-cloud-consul-config/src/main/java/org/springframework/cloud/consul/config/ConfigWatch.java#L159

Demo project is attached
spring boot :4.0.1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.