Skip to content

Regression: WebClient with unknown response code results in IllegalArgumentException #1462

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

Closed
blake-bauman opened this issue Oct 8, 2019 · 0 comments
Labels
Milestone

Comments

@blake-bauman
Copy link
Contributor

It appears that the issue reported in #1393 has come back in some scenarios. This was fixed in 2.1.3, but seems to be back in 2.1.4. It worked with my original test, so I didn't notice it right away, but it seemed someone found where it's no longer working.

I've modified the sample slightly from the previous issue to reproduce the problem every time: https://github.com/blake-bauman/test-sleuth-unknown-status-code

When I tested it earlier, it appeared to be working with 2.1.4, but didn't notice that the server was still throwing the same exception, even though the request was "successful". A slight change to the code (https://github.com/blake-bauman/test-sleuth-unknown-status-code/commit/e572b48e47a8d2cc48c210660c1dd1bbfe0b4cdb) gets the request itself to fail, the same as before. Both scenarios were working properly in 2.1.3.

Exception is still the same:

java.lang.IllegalArgumentException: No matching constant for [499]
	at org.springframework.http.HttpStatus.valueOf(HttpStatus.java:532) ~[spring-web-5.1.10.RELEASE.jar:5.1.10.RELEASE]
	at org.springframework.http.client.reactive.ReactorClientHttpResponse.getStatusCode(ReactorClientHttpResponse.java:90) ~[spring-web-5.1.10.RELEASE.jar:5.1.10.RELEASE]
	at org.springframework.web.reactive.function.client.DefaultClientResponse.statusCode(DefaultClientResponse.java:75) ~[spring-webflux-5.1.10.RELEASE.jar:5.1.10.RELEASE]
	at org.springframework.cloud.sleuth.instrument.web.client.TraceExchangeFilterFunction$MonoWebClientTrace$WebClientTracerSubscriber.terminateSpan(TraceWebClientBeanPostProcessor.java:349) ~[spring-cloud-sleuth-core-2.1.4.RELEASE.jar:2.1.4.RELEASE]
	at org.springframework.cloud.sleuth.instrument.web.client.TraceExchangeFilterFunction$MonoWebClientTrace$WebClientTracerSubscriber.onNext(TraceWebClientBeanPostProcessor.java:300) ~[spring-cloud-sleuth-core-2.1.4.RELEASE.jar:2.1.4.RELEASE]
	at org.springframework.cloud.sleuth.instrument.web.client.TraceExchangeFilterFunction$MonoWebClientTrace$WebClientTracerSubscriber.onNext(TraceWebClientBeanPostProcessor.java:232) ~[spring-cloud-sleuth-core-2.1.4.RELEASE.jar:2.1.4.RELEASE]
	at org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onNext(ScopePassingSpanSubscriber.java:96) ~[spring-cloud-sleuth-core-2.1.4.RELEASE.jar:2.1.4.RELEASE]
	at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:114) ~[reactor-core-3.2.12.RELEASE.jar:3.2.12.RELEASE]
	at org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onNext(ScopePassingSpanSubscriber.java:96) ~[spring-cloud-sleuth-core-2.1.4.RELEASE.jar:2.1.4.RELEASE]
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