سؤال

I have written a backup/retrieve system for Glacier using the AWS java SDK. It had been working, but the program is now unable to retrieve, and I get the following exception:

Status Code: 403,

AWS Service: AmazonSNS,

AWS Request ID: 2cf43ec9-a5f5-51bd-b6b0-74c7bf725bac,

AWS Error Code: TopicLimitExceeded,

AWS Error Message: Could not complete request: topic quota exceeded

It seems to be coming from SNS, not Glacier. Using the console, I can see SNS topics (12&). Tried deleting a couple of them but does not seem to work. Has anyone seen this ?

 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());
    }
هل كانت مفيدة؟

المحلول

UPDATE:

I have found the problem. Because of the (lazy) way the request is being done, an SNS topic is being created for each and every request. I just have hit the 127 topic limit. Deleting (manually) the topics and subscriptions takes care of the problem. In my particular case, will modify the code to use one SNS topic. Thanks! –

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top