0

I need to restore a lot of object from aws s3 glacier deep archive. So i try to use a s3 batch jobs. For that i use a python code to create a manifest as a csv with to columns Bucket,Key. But my first issue : some Key contain a comma so the job failed.

To solve (partialy) this issue i just cut the csv file to keep only the first two columns hoping that there are not many files involved.

But now i have another issue:

ErrorMessage: Task target couldn't be URL decoded

Any Idea ?

1 Answers1

0

As mentioned on https://docs.aws.amazon.com/AmazonS3/latest/userguide/batch-ops-create-job.html#specify-batchjob-manifest, the manifest CSV file must be URL encoded. The , character in a key name gets converted to %2C with URL encoding so the resulting file will be valid CSV even with commas in the key name

arjunrawal
  • 101
  • 3
  • 1
    Yes i finally solve the issue by using urlib3 to URL encode the Key: key_url_encode = quote_plus(object.key, safe = '/') manifest.write(f'{bucket},{key_url_encode}\n') – Quentin Chartreux Feb 04 '23 at 00:16