2

I'm having a bit of an issue when it comes to Amazon Glacier.

I typed in the command

aws glacier initiate-multipart-upload \
    --account-id - \
    --archive-description "Qozu Chronicles May 2023 Backup" \
    --part-size 4294967296 \
    --vault-name tyllavideo

and got the following result:

{
    "location": "/953374234641/vaults/tyllavideo/multipart-uploads/-BbO80kesvItrSPcGdZrfhco87xzs1oPdWG4r1WW7lJ1aTjElIICKthnMnkFuFjej8k4kWvJvaOQFNXGufCfYNKKSuiW",
    "uploadId": "-BbO80kesvItrSPcGdZrfhco87xzs1oPdWG4r1WW7lJ1aTjElIICKthnMnkFuFjej8k4kWvJvaOQFNXGufCfYNKKSuiW"
}

Note that the uploadId starts with a -. This becomes a problem when I want to upload a part, as when I run the command

aws glacier upload-multipart-part \
    --upload-id -BbO80kesvItrSPcGdZrfhco87xzs1oPdWG4r1WW7lJ1aTjElIICKthnMnkFuFjej8k4kWvJvaOQFNXGufCfYNKKSuiW \
    --body chunkaa \
    --range 'bytes 0-6717640/*' \
    --account-id - \
    --vault-name tyllavideo

I get this error:

aws: error: argument --upload-id: expected one argument

I tried enclosing the uploadId in quotes, and I tried using a \ to escape the -. Both gave the same error. What am I doing wrong, and how do I get the upload started?

7
  • did you try single quotes the same way --range is handled? Not sure what you are using aws cli in, but you can store the uploadId as a variable and then pass it in. In powershell - $uploadId="-Bb08...." then aws glacier..... --upload-id $uploadId
    – Narzard
    May 24 at 2:39
  • @Narzard single quotes did not work, and I am using Bash on a Linux machine.
    – Tyll'a
    May 24 at 2:45
  • @KamilMaciorowski unfortunately that just gives me a different error: An error occurred (ResourceNotFoundException) when calling the UploadMultipartPart operation: The upload ID was not found: <-BbO80kesvItrSPcGdZrfhco87xzs1oPdWG4r1WW7lJ1aTjElIICKthnMnkFuFjej8k4kWvJvaOQFNXGufCfYNKKSuiW>
    – Tyll'a
    May 24 at 4:54
  • I don't think < and > are meant to be literal. Or did you try --upload-id='-Bb…'? May 24 at 4:57

1 Answer 1

2

This problem is mentioned in the bug report
aws glacier fails to work with archiveID's which start with a hyphen (-) #1319 .

This post relates to archiveId, but the suggested syntax will probably also work for uploadId instead.

The suggested workarounds all use methods for avoiding specifying directly the uploadId in the command.

Workaround 1 : Using the JSON parameter input method instead of the normal command-line inputs:

aws glacier delete-archive --account-id - --vault-name myvault --cli-input-json '{"archiveId": "-test"}'

Workaround 2 : Use the argument syntax name='value':

aws glacier delete-archive --account-id '-' --vault-name myvault --archive-id='-test'
1
  • Workaround 1 worked! Thanks!
    – Tyll'a
    May 30 at 1:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .