Skip to content
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

IllegalArgumentException on WebClient span when downstream service returns non-standard HTTP Status code #1393

Closed
blake-bauman opened this issue Jul 5, 2019 · 2 comments

Comments

@blake-bauman
Copy link
Contributor

(This is a follow-on to #1382)

After testing the fix for #1382, the issue still persists, but it's moved to a different location. If the downstream service returns a non-standard status code (such as 499), an exception is thrown when Sleuth builds its on ClientResponse from the one supplied by WebFlux:

java.lang.IllegalArgumentException: No matching constant for [499]
	at org.springframework.http.HttpStatus.valueOf(HttpStatus.java:527) ~[spring-web-5.1.8.RELEASE.jar:5.1.8.RELEASE]
	at org.springframework.http.client.reactive.ReactorClientHttpResponse.getStatusCode(ReactorClientHttpResponse.java:90) ~[spring-web-5.1.8.RELEASE.jar:5.1.8.RELEASE]
	at org.springframework.web.reactive.function.client.DefaultClientResponse.statusCode(DefaultClientResponse.java:75) ~[spring-webflux-5.1.8.RELEASE.jar:5.1.8.RELEASE]
	at org.springframework.web.reactive.function.client.DefaultClientResponseBuilder.<init>(DefaultClientResponseBuilder.java:64) ~[spring-webflux-5.1.8.RELEASE.jar:5.1.8.RELEASE]
	at org.springframework.web.reactive.function.client.ClientResponse.from(ClientResponse.java:174) ~[spring-webflux-5.1.8.RELEASE.jar:5.1.8.RELEASE]
	at org.springframework.cloud.sleuth.instrument.web.client.TraceExchangeFilterFunction$MonoWebClientTrace$WebClientTracerSubscriber.onNext(TraceWebClientBeanPostProcessor.java:298) ~[spring-cloud-sleuth-core-2.2.0.BUILD-20190703.202916-634.jar:2.2.0.BUILD-SNAPSHOT]
	at org.springframework.cloud.sleuth.instrument.web.client.TraceExchangeFilterFunction$MonoWebClientTrace$WebClientTracerSubscriber.onNext(TraceWebClientBeanPostProcessor.java:236) ~[spring-cloud-sleuth-core-2.2.0.BUILD-20190703.202916-634.jar:2.2.0.BUILD-SNAPSHOT]
	at org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onNext(ScopePassingSpanSubscriber.java:96) ~[spring-cloud-sleuth-core-2.2.0.BUILD-20190703.202916-634.jar:2.2.0.BUILD-SNAPSHOT]
	at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:114) ~[reactor-core-3.2.10.RELEASE.jar:3.2.10.RELEASE]
	at org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onNext(ScopePassingSpanSubscriber.java:96) ~[spring-cloud-sleuth-core-2.2.0.BUILD-20190703.202916-634.jar:2.2.0.BUILD-SNAPSHOT]
	at reactor.core.publisher.FluxPeek$PeekSubscriber.onNext(FluxPeek.java:192) ~[reactor-core-3.2.10.RELEASE.jar:3.2.10.RELEASE]
	at org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onNext(ScopePassingSpanSubscriber.java:96) ~[spring-cloud-sleuth-core-2.2.0.BUILD-20190703.202916-634.jar:2.2.0.BUILD-SNAPSHOT]
	at reactor.core.publisher.FluxPeek$PeekSubscriber.onNext(FluxPeek.java:192) ~[reactor-core-3.2.10.RELEASE.jar:3.2.10.RELEASE]
	at org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onNext(ScopePassingSpanSubscriber.java:96) ~[spring-cloud-sleuth-core-2.2.0.BUILD-20190703.202916-634.jar:2.2.0.BUILD-SNAPSHOT]
	at reactor.core.publisher.MonoNext$NextSubscriber.onNext(MonoNext.java:76) ~[reactor-core-3.2.10.RELEASE.jar:3.2.10.RELEASE]
	at org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onNext(ScopePassingSpanSubscriber.java:96) ~[spring-cloud-sleuth-core-2.2.0.BUILD-20190703.202916-634.jar:2.2.0.BUILD-SNAPSHOT]

I have a sample project which demonstrates the issue at: https://github.com/blake-bauman/test-sleuth-unknown-status-code

Running this project and hitting the "/hello" endpoint will recreate the problem. If you remove the Sleuth dependency, it works fine.

@ryanjbaxter ryanjbaxter added this to To do in Hoxton.M2 via automation Jul 8, 2019
@ryanjbaxter ryanjbaxter added this to To do in Greenwich.SR3 via automation Jul 8, 2019
@ryanjbaxter ryanjbaxter added this to the 2.1.3.RELEASE milestone Jul 8, 2019
Hoxton.M2 automation moved this from To do to Done Jul 26, 2019
Greenwich.SR3 automation moved this from To do to Done Jul 26, 2019
@blake-bauman
Copy link
Contributor Author

2.1.3.Release is showing no release date. Is there a plan for when this will be released? I'm assuming sometime before Greenwich.SR3 is released on the 22nd?

@spencergibb
Copy link
Member

That is the release day

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Greenwich.SR3
  
Done
Hoxton.M2
  
Done
Development

No branches or pull requests

4 participants