0
votes

I have created a new Glacier vault to use in development. I setup SNS and SQS for job completion notifications.

I am using the java SDK from AWS. I am able to successfully add archives to the vault but I get an error when creating a retrieval job.

The code I am using is from the SDK

InitiateJobRequest initJobRequest = new InitiateJobRequest()
        .withVaultName(vaultName)
        .withJobParameters(new JobParameters().withType("archive-retrieval").withArchiveId(archiveId));

I use the same code in Test and Production and it works fine, yet in development I get this error:

Status Code: 400, AWS Service: AmazonGlacier, AWS Request ID: xxxxxxxx, AWS Error Code: InvalidParameterValueException, AWS Error Message: Invalid vault name: arn:aws:glacier:us-west-2:xxxxxxx:vaults/xxxxxx

I know the vault name is correct and it exists as I use the same name to run the add archive job and it completes fine.

I had a suspicion that the vault may take a bit of time after creation before it will allow retrieval requests, but I couldn't find any documentation to confirm this.

Anyone had any similar issues? Or know if there are delays on vaults before you can initiate a retrieval request?

2

2 Answers

0
votes
    try {
        // Get the S3 directory file.
        S3Object object = null;
        try {
            object = s3.getObject(new GetObjectRequest(s3BucketName, key));
        } catch (com.amazonaws.AmazonClientException e) {
            logger.error("Caught an AmazonClientException");
            logger.error("Error Message: " + e.getMessage());
            return;
        }

        // Show
        logger.info("\tContent-Type: "
                + object.getObjectMetadata().getContentType());
        GlacierS3Dir dir = GlacierS3Dir.digestS3GlacierDirectory(object
                .getObjectContent());
        logger.info("\tGlacier object ID is " + dir.getGlacierFileID());

        // Connect to Glacier
        ArchiveTransferManager atm = new ArchiveTransferManager(client,credentials);
        logger.info("\tVault: " + vaultName);

        // create a name
        File f = new File(key);
        String filename = f.getName();
        filename =  path + filename.replace("dir", "tgz");

        logger.info("Downloading to '" + filename
                + "'. This will take up to 4 hours...");
        atm.download(vaultName, dir.getGlacierFileID(), new File(filename));
        logger.info("Done.");

    } catch (AmazonServiceException ase) {
        logger.error("Caught an AmazonServiceException.");
        logger.error("Error Message:    " + ase.getMessage());
        logger.error("HTTP Status Code: " + ase.getStatusCode());
        logger.error("AWS Error Code:   " + ase.getErrorCode());
        logger.error("Error Type:       " + ase.getErrorType());
        logger.error("Request ID:       " + ase.getRequestId());
    } catch (AmazonClientException ace) {
        logger.error("Caught an AmazonClientException.");
        logger.error("Error Message: " + ace.getMessage());
    }
0
votes

Error message "Invalid vault name" means this archive is located in a different Vault. Proof link: https://forums.aws.amazon.com/message.jspa?messageID=446187