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?

Tyll'a
  • 255

1 Answers1

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'
harrymc
  • 498,455