-
Notifications
You must be signed in to change notification settings - Fork 38.4k
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
Confusing WebClient exception message in case of Reactor-Netty PrematureCloseException
during response
#33127
Comments
If you'd like us to spend some time investigating, please take the time to provide a complete minimal sample (something that we can unzip or git clone, build, and deploy) that reproduces the problem. At a very minimum, more details like the full stacktrace. Please also have a look at this FAQ from the Reactor-Netty project: https://projectreactor.io/docs/netty/release/reference/index.html#faq.connection-closed |
Thanks for the link, was not aware of that (but i was able to reproduce it with curl nevertheless). Please find a example here that reproduces this error: https://github.com/david0/mre-spring-issue-33127-webclient/blob/main/src/test/java/com/github/david0/webclient_prematureend/WebclientTest.java#L29 Example stacktrace:
|
PrematureCloseException
during response
Mmh the faq I have provided is perhaps not that relevant, as it is about a I think this is more symptomatic of an issue on the remote server's side (which could be triggered by the payload on your client side). The test you have provided is representative of that, as it triggers an IO error in the wiremock server by writing a content-length header then an incomplete body that doesn't match. However the exception message's signal-to-noise ratio seems a bit off balance here, indeed. I'll discuss with the team how we can best improve the situation without masking the need for an actual root cause investigation on the user's part. |
@david0 this has now been enhanced in upcoming 6.1.11 and 6.2.0-M5 releases. in your case, the message would now be: |
Way better, thanks a lot! |
We are using WebClient+netty. We have run into
reactor.netty.http.client.PrematureCloseException: Connection prematurely closed DURING response
.Unfortunately the
WebClientResponseException.getMessage()
will just return200 OK from POST http://localhost:50457/foo
in this case, not giving any helpful detail what the problem was.
Maybe the original exception message (
Connection prematurely closed DURING response
) should be shown or just some genericAn error happend while reading the response
? Everything would be better than200 OK from ...
The text was updated successfully, but these errors were encountered: