Skip to content

Support Reading HTTP Response When Request Isn't Fully Sent #530

@dzelemba

Description

@dzelemba

Environment details

  • OS: Ubuntu
  • Java version: openjdk-1.8.0
  • google-http-java-client version: 1.23

Steps to reproduce

  1. Use the HTTP Client to send a large post request that aborts early (e.g. permission denied to any Google API)

Stacktrace

org.dcm4che3.net.service.DicomServiceException: java.io.IOException: Error writing request body to server( status = 272 )
        at com.google.cloud.healthcare.imaging.dicomadapter.CStoreService.store(CStoreService.java:81)
        at org.dcm4che3.net.service.BasicCStoreSCP.onDimseRQ(BasicCStoreSCP.java:72)
        at org.dcm4che3.net.service.DicomServiceRegistry.onDimseRQ(DicomServiceRegistry.java:86)
        at org.dcm4che3.net.ApplicationEntity.onDimseRQ(ApplicationEntity.java:485)
        at org.dcm4che3.net.Association.onDimseRQ(Association.java:650)
        at org.dcm4che3.net.PDUDecoder.decodeDIMSE(PDUDecoder.java:459)
        at org.dcm4che3.net.Association.handlePDataTF(Association.java:634)
        at org.dcm4che3.net.State$4.onPDataTF(State.java:103)
        at org.dcm4che3.net.Association.onPDataTF(Association.java:630)
        at org.dcm4che3.net.PDUDecoder.nextPDU(PDUDecoder.java:177)
        at org.dcm4che3.net.Association$2.run(Association.java:478)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: Error writing request body to server
        at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.checkError(HttpURLConnection.java:3587)
        at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.write(HttpURLConnection.java:3570)
        at com.google.api.client.util.ByteStreams.copy(ByteStreams.java:55)
        at com.google.api.client.util.IOUtils.copy(IOUtils.java:94)
        at com.google.api.client.http.AbstractInputStreamContent.writeTo(AbstractInputStreamContent.java:72)
        at com.google.api.client.http.MultipartContent.writeTo(MultipartContent.java:107)
        at com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:80)
        at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:981)
        at com.google.cloud.healthcare.imaging.dicomadapter.CStoreService.store(CStoreService.java:78)
        ... 13 more

External references such as API reference guides used

Any additional information below

This was identified by using the following tool: https://github.com/GoogleCloudPlatform/healthcare/tree/master/imaging/dicom_adapter#import-adapter which uses this HTTP Client underneath

I've played around with the library a bit but can't seem to find any way for it to return meaningful errors in this context. If I send a regular curl request it handles this just find and return the actual HTTP Response.

Making sure to follow these steps will guarantee the quickest resolution possible.

Thanks!

Metadata

Metadata

Assignees

Labels

type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions