Corrupted file error when using storage compression

When StorageCompression setting is enabled I am unable to access files neither through Orthanc REST API nor DICOMweb. Orthanc responds with a 500 status code and an error message “Corrupted file (e.g. inconsistent MD5 hash)”.

I have tested a number of Orthanc Docker image versions and found that only 22.6.4 and 22.7.0 are affected:

  • 22.3.0 - OK
  • 22.4.0 - OK
  • 22.5.0 - docker image not available
  • 22.5.1 - OK
  • 22.6.0 - OK
  • 22.6.1 - OK
  • 22.6.2 - OK
  • 22.6.3 - docker image not available
  • 22.6.4 - 500 Corrupted file (e.g. inconsistent MD5 hash)
  • 22.7.0 - 500 Corrupted file (e.g. inconsistent MD5 hash)

Below is a script I’ve used for testing:

set -ev


docker kill orthanc || true

docker run -d --rm --name orthanc -p -e ORTHANC__STORAGE_COMPRESSION=true osimis/orthanc:${ORTHANC_VERSION}
docker exec orthanc cat /tmp/orthanc.json | grep StorageCompression

sleep 1

curl -u orthanc:orthanc http://localhost:8042/instances
curl -u orthanc:orthanc -X POST http://localhost:8042/instances --data-binary @/path/to/dicom/file.dcm
curl -u orthanc:orthanc http://localhost:8042/instances
curl -u orthanc:orthanc http://localhost:8042/instances/XXXX-XXXX-XXXX-XXXX-XXXX
curl -u orthanc:orthanc http://localhost:8042/instances/XXXX-XXXX-XXXX-XXXX-XXXX/attachments/dicom/md5
curl -v -u orthanc:orthanc http://localhost:8042/instances/XXXX-XXXX-XXXX-XXXX-XXXX/file

The last curl request is expected to respond with 200 status code but in versions 22.6.4 and 22.7.0 a 500 response is received.

I have also reported this issue in Bugzilla ( but got no response.


Thanks for the detailed bug report.

I have assigned the ticket to myself and will look into it on Monday.
There has been some rework on the Cache in 1.11.1 and this is probably related.

I’ll make sure to add integration tests with compression enabled to avoid this kind of regressions.

Best regards,


This has now been fixed in this commit: [](

And new tests have been added: [](
Thanks again for the bug report and sorry for the inconvenience.
Since this is a regression with quite a big impact, I'll try to release the fix this week.
Best regards,


That’s great news, thank you very much!

Orthanc 1.11.2 has now been released with the fix