Cannot write to file: Cannot add new file inside ZIP archive

Hello,

On testing the Orthweb steup (with orthanc.json and docker-compose file)

I tried to “Download ZIP” and “Download DICOMDIR” on a study. Clicking on either button as user, the browser prompts for download location. Once the user picks the location the download failed immediately after start, with a message “Failed - Network error”.

The Orthanc container side, with VERBOSE_ENABLED=true and TRACE_ENABLED=true, reports the followings:

app-orthanc-backend-1 | I0317 21:16:58.695833 StorageCache.cpp:101] Read attachment “f94134df-8b68-4ee4-8ec1-cc20d0d186e5” with content type 1 from cache
app-orthanc-backend-1 | I0317 21:16:58.825216 StorageCache.cpp:101] Read attachment “13930bfc-c4a6-40c0-aa28-5d86bceafce4” with content type 1 from cache
app-orthanc-backend-1 | E0317 21:16:58.825451 OrthancException.cpp:58] Error in the network protocol: HTTP client has disconnected while creating an archive in synchronous mode
app-orthanc-backend-1 | E0317 21:16:58.825488 OrthancException.cpp:58] Cannot write to file: Cannot add new file inside ZIP archive: 98.12.21/LUNG/CT Lung/CT000003.dcm
app-orthanc-backend-1 | E0317 21:16:58.825538 ArchiveJob.cpp:1310] Error while creating an archive: Cannot write to file
app-orthanc-backend-1 | I0317 21:16:58.825831 JobsRegistry.cpp:504] Job has completed with failure: 7a74d422-eb06-4168-9567-716903e6290c

I can reproduce this server-side behaviour with an equivalent curl command, such as:
curl -v --request POST --url https://orthwebdemo.digihunch.com/studies/941a16e6-2b969e8a-d3e9e31a-1bbc74f6-abcad8c3/archive --data ‘{“Asynchronous”:false}’ -u admin:password

I can also reproduce this behaviour bypassing my HTTP proxy, directing the request over to one Orthanc container. That eliminates my custom HTTP proxy config as a potential culprit.

I bolded the lines that caught my attention, which suggests that the Orthanc process was attempting to preparing the zip file at a temporary location, before serving it to the client. If that is the case then where is that location or how can I find out?

This is on osimis/orthanc image v22.12.2. Any thoughts would be appreciated. Thanks in advance!

Regards,
Yi

Hi Yi,

This line is the most important:
app-orthanc-backend-1 | E0317 21:16:58.825451 OrthancException.cpp:58] Error in the network protocol: HTTP client has disconnected while creating an archive in synchronous mode

That looks like a client side timeout. Try increasing it in curl (and then, in your HTTP proxy).

HTH,

Alain.

Thanks Alain. As you suggest, it's a client side issue where I did not set
--output to curl. After downloading the first packet curl doesn't know
where to write it to on the client side, so it fails and terminates the
connection.

On the server side, it does not write to the zip file (in synchronous mode)
because the client has given up the connection and there's no need to write
any more.

Out of curiosity I tried the bad curl argument in asynchronous mode, and
the server continues to write the file even though the client has already
cut off the connection.

- Yi

There was also a mis-configuration on the Envoy proxy side with a 3s timeout, which is fixed and downloading via proxy works fine now.

Hi,

In asynchronous mode, Orthanc continues to generate the zip asynchronously. The client is supposed to monitor the job that is returned as the response to the previous call.

Reference doc: https://book.orthanc-server.com/users/advanced-rest.html#example-asynchronous-generation-of-an-archive

Best regards

Alain