libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <>
Subject [GitHub] [libcloud] jfharden opened a new issue #1401: Uploading to s3 encrypted with a custom KMS key fails
Date Mon, 06 Jan 2020 12:01:41 GMT
jfharden opened a new issue #1401: Uploading to s3 encrypted with a custom KMS key fails
   ## Summary
   When uploading files to s3 where the bucket has server side encryption with a custom KMS
key the upload fails
   ## Detailed Information
   Python 3.7
   Libcloud: 2.8.0
   OS: Amazon Linux 2
   Libcloud is inspecting the etag expecting it to be the md5sum of the uploaded data object
but this is not always the case (where using a custom KMS key, or doing a multi-part upload):
   > Objects created by the PUT Object, POST Object, or Copy operation, or through the
AWS Management Console, and are encrypted by SSE-C or SSE-KMS, have ETags that are not an
MD5 digest of their object data.
   > If an object is created by either the Multipart Upload or Part Copy operation, the
ETag is not an MD5 digest, regardless of the method of encryption.
   the s3 storage driver is comparing the etag to the hash calculated locally on the streamed
file ( but
where the etag is not an md5 hash of the file this will always fail
   I've included a stack trace below from cassandra-medusa (
which led to me investigating this problem
   Traceback (most recent call last):
     File "/usr/local/lib/python3.7/site-packages/medusa/", line 274, in main
       cassandra, node_backup, storage, differential_mode, config)
     File "/usr/local/lib/python3.7/site-packages/medusa/", line 320, in do_backup
       num_files = backup_snapshots(storage, manifest, node_backup, node_backup_cache, snapshot)
     File "/usr/local/lib/python3.7/site-packages/medusa/", line 388, in backup_snapshots
       manifest_objects = storage.storage_driver.upload_blobs(needs_backup, dst_path)
     File "/usr/local/lib/python3.7/site-packages/medusa/storage/", line 95,
in upload_blobs
     File "/usr/local/lib/python3.7/site-packages/medusa/storage/aws_s3_storage/",
line 87, in upload_blobs
       return job.execute(list(src))
     File "/usr/local/lib/python3.7/site-packages/medusa/storage/aws_s3_storage/",
line 51, in execute
       return list(, iterables))
     File "/usr/lib64/python3.7/concurrent/futures/", line 598, in result_iterator
       yield fs.pop().result()
     File "/usr/lib64/python3.7/concurrent/futures/", line 435, in result
       return self.__get_result()
     File "/usr/lib64/python3.7/concurrent/futures/", line 384, in __get_result
       raise self._exception
     File "/usr/lib64/python3.7/concurrent/futures/", line 57, in run
       result = self.fn(*self.args, **self.kwargs)
     File "/usr/local/lib/python3.7/site-packages/medusa/storage/aws_s3_storage/",
line 60, in with_storage
       return self.func(, connection, iterable)
     File "/usr/local/lib/python3.7/site-packages/medusa/storage/aws_s3_storage/",
line 83, in <lambda>
       storage, connection, src_file, dest, bucket, multi_part_upload_threshold
     File "/usr/local/lib/python3.7/site-packages/medusa/storage/aws_s3_storage/",
line 119, in __upload_file
       obj = _upload_single_part(connection, src, bucket, full_object_name)
     File "/usr/local/lib/python3.7/site-packages/", line 49, in wrapped_f
       return Retrying(*dargs, **dkw).call(f, *args, **kw)
     File "/usr/local/lib/python3.7/site-packages/", line 212, in call
       raise attempt.get()
     File "/usr/local/lib/python3.7/site-packages/", line 247, in get
       six.reraise(self.value[0], self.value[1], self.value[2])
     File "/usr/local/lib/python3.7/site-packages/", line 696, in reraise
       raise value
     File "/usr/local/lib/python3.7/site-packages/", line 200, in call
       attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
     File "/usr/local/lib/python3.7/site-packages/medusa/storage/aws_s3_storage/",
line 127, in _upload_single_part
       os.fspath(src), container=bucket, object_name=object_name
     File "/usr/local/lib/python3.7/site-packages/libcloud/storage/drivers/", line 492,
in upload_object
     File "/usr/local/lib/python3.7/site-packages/libcloud/storage/drivers/", line 854,
in _put_object
       object_name=object_name, driver=self)

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:

With regards,
Apache Git Services

View raw message