-
Notifications
You must be signed in to change notification settings - Fork 38.5k
restTemplate.exchange have exception "insufficient data written" with springboot 3.3 #33015
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
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. |
@automvc please stop creating duplicate issues. Can you provide the sample that we requested? |
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed. |
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue. |
Sample code is like: @Autowired try {
|
Additional information from me duplicating on a service under test: Exception is being thrown here: this.connection.getResponseCode(); //throws java.io.IOException ("Incomplete output stream") after the connection.connect(), the body and status code are empty response works fine using curl/postman errors with all of the following factory attempts
spring boot version 3.4 Response information:
|
@ericdriggs unfortunately this doesn't help much. We can revisit this if you open a new issue with a minimal sample application we can run that reproduces the problem. |
|
@gearkim0614 suggestion fixes "insufficient data" case. But this causes redirection issue. It throws 421 when there is redirection to a public website, for example google.com, because http/2 is forced on background. This is so annoying that there isn't currently a solution that fixes both redirection and insufficent data issues. result is always same ->>>>>> 421 Misdirected Request on GET request for .... |
The example use springboot 3.0 is normal, but use springboot 3.3 have exception.
Maybe it is different from #31902
detail error:
org.springframework.web.client.ResourceAccessException: I/O error on POST request for "https://someurl/api/": insufficient data written
at org.springframework.web.client.RestTemplate.createResourceAccessException(RestTemplate.java:915)
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:895)
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:830)
at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:691)
The text was updated successfully, but these errors were encountered: