Traceback (most recent call last):
...
ds3.ds3network.RequestFailed: Return Code: Expected [200] - Received 400
Code=BadRequest
HttpError=400
BadRequest[400]: End-to-end CRC is required for this bucket. You are required to calculate and transmit a MD5 to ensure data integrity.
Traceback (most recent call last):
...
ds3.ds3network.RequestFailed: Return Code: Expected [200] - Received 403
Code=InvalidSecurity
HttpError=403
InvalidSecurity[403]: Authorization signature is invalid.
Caused by IllegalArgumentException: Authorization digest from client was incorrect. Valid string to sign was:PUT\n\napplication/octet-stream\nWed, 30 Oct 2019 15:00:09 -0000\nx-amz-meta-content-md5:kkEfdcoYfPtXbWMRpKwXwA==\n/e2-**********/Data/**********%20data/Final_BSCardBackup1/FILE_AA.BSWdef get_MD5_of_chunk(data_chunk):
hasher = hashlib.md5()
hasher.update(repr(data_chunk).encode('utf-8')) # to overcome: TypeError: object supporting the buffer API required
return base64.b64encode(hasher.digest()).decode("utf-8")...
ds3_put_object_request = ds3.PutObjectRequest(
bucket_name=ds3_target_bucket,
object_name=ds3_obj['Name'],
length=ds3_obj['Length'],
stream=object_data_stream,
offset=int(ds3_obj['Offset']),
job=bulk_put_result.result['JobId'])
# as an attempt to sort out end-to-end CRC issue with the DS3 API here we generate
# the MD5 checksum of the file chunk, and append it to the HTTP header
chunk_MD5 = get_MD5_of_chunk(ds3_put_object_request.body)
ds3_put_object_request.headers['Content-MD5'] = chunk_MD5
client_handle.put_object(ds3_put_object_request)
...