dcm4che / dcm4chee-arc-light

DICOM Archive J2EE application
440 stars 242 forks source link

Make "x-amz-content-sha256: STREAMING-AWS4-HMAC-SHA256-PAYLOAD" header optional for AWS S3 storage #3253

Open mista-ken opened 3 years ago

mista-ken commented 3 years ago

I am using Oracle Cloud to deploy dcm4chee instances, and am trying to use Oracle Cloud's Amazon S3 Compatibility API integration to use as my dcm4chee storage.

I had to set the configuration a little differently than the AWS S3, as Oracle Cloud requires :

dn: dcmStorageID=oc-bucket,dicomDeviceName=dcm4chee-arc,cn=Devices,cn=DICOM Configuration,dc=dcm4chee,dc=org
objectClass: dcmStorage
dcmStorageID: oc-bucket
dcmURI: jclouds:aws-s3:https://compat.objectstorage.<region>.oraclecloud.com/<bucket-name>/
dcmProperty: container=<oraclecloud-namespace>
dcmProperty: containerExists=true
dcmProperty: credential=<secret-key>
dcmProperty: identity=<access-key>
dcmProperty: jclouds.relax-hostname=true
dcmProperty: jclouds.s3.virtual-host-buckets=false
dcmProperty: jclouds.strip-expect-header=true
dcmProperty: jclouds.trust-all-certs=true

When trying to DICOM send, among the output in the log, I get the following error:

Caused by: org.jclouds.aws.AWSResponseException: request PUT https://compat.objectstorage.<region>.oraclecloud.com/<bucket-name>/2021/06/16/3C2F156D/1AF61419/FCCA893D HTTP/1.1 failed with code 400, error: AWSError{requestId='gru-1:fF2MqkxuisHxtMUSCVxL5jfl0zx4etYYNMn-pcUvodu3PcmaepOSk8PQLZmGjUi4', requestToken='null', code='InvalidRequest', message='STREAMING-AWS4-HMAC-SHA256-PAYLOAD is not supported.'}

Although Oracle Cloud Storage support multipart uploads, researching for possible solutions I found that Oracle Cloud Storage does not support it with x-amz-content-sha256: STREAMING-AWS4-HMAC-SHA256-PAYLOAD header.

For compatibility with other providers that implements AWS S3 protocol, it should be possible to make use of this header optional.

gunterze commented 3 years ago

You may try using jclouds generic S3 BlobStore provider (jclouds:s3) instead of the AWS specific provider (jclouds:aws-s3) .

Issue has to be solved by apache jclouds - you may open an issue https://issues.apache.org/jira or ask for help there https://jclouds.apache.org/community/