Why is using Java SDK SecretsManagerClient to connect to SecretsManager having long delays with many "software.amazon.awssdk.core.exception.SdkClientException: Unable to execute HTTP request" retries?

0

Hello, since about September 25th, we have been noticing that our connection attempts to SecretsManager in almost all environments are experiencing long delays.

The errors are almost always this: "software.amazon.awssdk.core.exception.SdkClientException: Unable to execute HTTP request" and they are occurring when we run this code:

    public static String getSecretValue(Logger logger, String secretRegion, String secretName, String secretKey) {

        String result = "";

        Region region = Region.of(secretRegion);

        SecretsManagerClient client = SecretsManagerClient.builder()
                .region(region)
                .build();

        GetSecretValueRequest getSecretValueRequest = GetSecretValueRequest.builder()
                .secretId(secretName)
                .build();
        GetSecretValueResponse getSecretValueResponse = null;

        try {
            getSecretValueResponse = client.getSecretValue(getSecretValueRequest);
        } catch (DecryptionFailureException e) {
            logger.error("getSecretValue DecryptionFailureException: {}", e.getMessage());
            throw e;
        } catch (InternalServiceErrorException e) {
            logger.error("getSecretValue InternalServiceErrorException: {}", e.getMessage());
            throw e;
        } catch (InvalidParameterException e) {
            logger.error("getSecretValue InvalidParameterException: {}", e.getMessage());
            throw e;
        } catch (InvalidRequestException e) {
            logger.error("getSecretValue InvalidRequestException: {}", e.getMessage());
            throw e;
        } catch (ResourceNotFoundException e) {
            logger.error("getSecretValue ResourceNotFoundException: {}", e.getMessage());
            throw e;
        }

        String secret = getSecretValueResponse.secretString();

        try {
            JSONObject jsonObject = new JSONObject(secret);
            result = jsonObject.get(secretKey).toString();
        } catch (JSONException je) {
            logger.error("getSecretValue : {}", je.getMessage());
        }

        return result;
    }

Up until that date, we have had almost no issues with this particular function. Did something happen to SecretsManager? Is there something we can do on our side?

profile picture
已提問 7 個月前檢視次數 116 次
沒有答案

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南