2

I have been trying for the past day to load some encrypted text to a Ceph object storage, but whenever I try, I get the following error:

botocore.exceptions.ClientError: An error occurred (InvalidRequest) when calling the PutObject operation: Unknown

The code I am using is this:

random_key = os.urandom(32)

s3.put_object(Bucket=BUCKET_NAME,
              Key=KEY,
              Body='the quick brown fox jumps over the lazy dog',
              SSECustomerKey=random_key,
              SSECustomerAlgorithm='AES256'
              )

I am mentioning that if I remove SSECustomerKey=random_key,SSECustomerAlgorithm='AES256' then it loads the text.

jellycsc
  • 10,904
  • 2
  • 15
  • 32
Nisu
  • 230
  • 2
  • 10
  • I created a fresh new bucket with the default settings, and I tried your code snippet. The PutObject action succeeded. – jellycsc Apr 16 '21 at 14:33
  • Have you uploaded this to Ceph? – Nisu Apr 16 '21 at 15:40
  • No, I uploaded it to S3. – jellycsc Apr 16 '21 at 15:48
  • 1
    Okay. I think this might be a Ceph related problem. I need to find a way to talk to the devs so I can test my setup.. – Nisu Apr 16 '21 at 15:50
  • any updates? @Nisu – Rm4n Aug 09 '23 at 07:04
  • @Rm4n this was a long time ago and I am not sure if this is right, but I thing that I have replaced the put_object function with upload_fileobj: s3.upload_fileobj(file, name, file.filename, ExtraArgs={"ContentType": file.content_type}) You can see a basic interface that worked two years ago on my GitHub: https://github.com/AlexNisulescu/WebInterface-for-s3/tree/master – Nisu Aug 17 '23 at 12:08

0 Answers0