Skip to content

[ERRORS] Issue with AWS SDK for java when adding a new feature flag to existing configuration Profile(short issue description) #5465

@prashanthparsi

Description

@prashanthparsi

Upcoming End-of-Support

  • I acknowledge the upcoming end-of-support for AWS SDK for Java v1 was announced, and migration to AWS SDK for Java v2 is recommended.

Describe the bug

I have been trying to leverage AWS SDK for java for putting a new feature flag into the existing configuration profile. So far I have no luck in getting the code working. I tried multiple ways, read all the available AWS documentation (although its shame that there isn't much), but still I am unable to resolve the code issue. I debugged AWS SDK too, but no luck. I hope I can get resolution here. I tried with Python and Java SDK but both have same issue.

Here is the use case. I need to add a new flag to existing configuration. The below is test code from my local but production grade code yet. I just want to try out before I refactor it.

Expected Behavior

The feature flag should be persisted under the given application and configuration profile.

Current Behavior

software.amazon.awssdk.services.appconfig.model.BadRequestException: Error invoking extension AppConfig Feature Flags Helper: Malformed 'Content' provided (Service: AppConfig, Status Code: 400,

Reproduction Steps

Run the below code.

import com.fasterxml.jackson.databind.ObjectMapper;
import software.amazon.awssdk.auth.credentials.ProfileCredentialsProvider;
import software.amazon.awssdk.core.SdkBytes;
import software.amazon.awssdk.http.apache.ApacheHttpClient;
import software.amazon.awssdk.http.apache.ProxyConfiguration;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.appconfig.AppConfigClient;
import software.amazon.awssdk.services.appconfig.model.CreateHostedConfigurationVersionRequest;
import software.amazon.awssdk.services.appconfig.model.CreateHostedConfigurationVersionResponse;
import software.amazon.awssdk.services.appconfig.model.StartDeploymentRequest;
import software.amazon.awssdk.services.appconfig.model.StartDeploymentResponse;
import software.amazon.awssdk.services.appconfigdata.AppConfigDataClient;
import software.amazon.awssdk.services.appconfigdata.model.GetLatestConfigurationRequest;
import software.amazon.awssdk.services.appconfigdata.model.GetLatestConfigurationResponse;
import software.amazon.awssdk.services.appconfigdata.model.StartConfigurationSessionRequest;
import software.amazon.awssdk.services.appconfigdata.model.StartConfigurationSessionResponse;

import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.charset.StandardCharsets;
import java.util.Base64;
import java.util.HashMap;
import java.util.Map;

public class AppConfigWriteExample {

    private static final String APP_ID = "my_app_id";
    private static final String ENV_ID = "development";
    private static final String CONFIG_PROFILE_ID = "my_profile_id";
    private static final String CLIENT_ID = "feature-toggle-client";
    private static final String VERSION = "1.0"; // Add version here
    private static final Region REGION = Region.US_EAST_1;

    public static void main(String[] args) throws URISyntaxException, IOException {

        ProxyConfiguration.Builder proxyConfig = ProxyConfiguration.builder()
                .endpoint(new URI("my_proxy_for_local_development"));

        ApacheHttpClient.Builder httpClientBuilder = ApacheHttpClient.builder()
                .proxyConfiguration(proxyConfig.build());

        AppConfigDataClient appConfigDataClient = AppConfigDataClient.builder()
                .region(REGION)
                .httpClientBuilder(httpClientBuilder)
                .credentialsProvider(ProfileCredentialsProvider.create("default"))
                .build();

        AppConfigClient appConfigClient = AppConfigClient.builder()
                .region(REGION)
                .httpClientBuilder(httpClientBuilder)
                .credentialsProvider(ProfileCredentialsProvider.create("default"))
                .build();

        try {
            // Start configuration session
            StartConfigurationSessionRequest startRequest = StartConfigurationSessionRequest.builder()
                    .applicationIdentifier(APP_ID)
                    .environmentIdentifier(ENV_ID)
                    .configurationProfileIdentifier(CONFIG_PROFILE_ID)
                    .build();

            StartConfigurationSessionResponse startResponse = appConfigDataClient.startConfigurationSession(startRequest);
            String sessionToken = startResponse.initialConfigurationToken();

            // Get latest configuration
            GetLatestConfigurationRequest getRequest = GetLatestConfigurationRequest.builder()
                    .configurationToken(sessionToken)
                    .build();

            GetLatestConfigurationResponse getResponse = appConfigDataClient.getLatestConfiguration(getRequest);
            String content = StandardCharsets.UTF_8.decode(getResponse.configuration().asByteBuffer()).toString();

            // Parse configuration
            ObjectMapper objectMapper = new ObjectMapper();
            Map<String, Object> config = objectMapper.readValue(content, Map.class);

            // Ensure the configuration matches the provided JSON schema and structure
            Map<String, Object> flags = (Map<String, Object>) config.getOrDefault("flags", new HashMap<>());
            Map<String, Object> values = (Map<String, Object>) config.getOrDefault("values", new HashMap<>());

            // Add or update the feature flags and their values
            Map<String, Object> flagFromUi = new HashMap<>();
            flagFromUi.put("name", "flag_from_ui");
            flagFromUi.put("description", "flag_from_ui");
            flagFromUi.put("_createdAt", "2024-08-05T19:55:27.399Z");
            flagFromUi.put("_updatedAt", "2024-08-05T19:55:27.399Z");
            flags.put("flag_from_ui", flagFromUi);

            Map<String, Object> flagFromUiValues = new HashMap<>();
            flagFromUiValues.put("enabled", true);
            flagFromUiValues.put("_createdAt", "2024-08-05T19:55:27.399Z");
            flagFromUiValues.put("_updatedAt", "2024-08-05T19:55:27.399Z");
            values.put("flag_from_ui", flagFromUiValues);

            Map<String, Object> uiRefresh = new HashMap<>();
            uiRefresh.put("name", "UI Refresh");
            uiRefresh.put("_createdAt", "2024-08-05T17:59:42.886Z");
            uiRefresh.put("_updatedAt", "2024-07-31T18:09:19.939Z");
            flags.put("ui_refresh", uiRefresh);

            Map<String, Object> uiRefreshValues = new HashMap<>();
            uiRefreshValues.put("enabled", false);
            uiRefreshValues.put("_createdAt", "2024-08-05T17:59:42.886Z");
            uiRefreshValues.put("_updatedAt", "2024-07-31T18:09:19.939Z");
            values.put("ui_refresh", uiRefreshValues);

            // Create configuration content matching the JSON schema
            Map<String, Object> configurationContent = new HashMap<>();
            configurationContent.put("version", "1");
            configurationContent.put("flags", flags);
            configurationContent.put("values", values);

            // Convert updated configuration back to JSON
            String updatedContent = objectMapper.writeValueAsString(configurationContent);

            // Validate updated configuration
            if (!isValidJson(updatedContent)) {
                throw new IllegalArgumentException("Invalid JSON content");
            }

            // Encode the updated content to Base64 using a similar method as the command line
            String base64EncodedContent = Base64.getEncoder().encodeToString(updatedContent.getBytes(StandardCharsets.UTF_8));

            // Create a new hosted configuration version
            CreateHostedConfigurationVersionRequest createHostedConfigRequest = CreateHostedConfigurationVersionRequest.builder()
                    .applicationId(APP_ID)
                    .configurationProfileId(CONFIG_PROFILE_ID)
                    .content(SdkBytes.fromByteArray(base64EncodedContent.getBytes(StandardCharsets.UTF_8)))
                    .contentType("application/json")
                    .build();

            CreateHostedConfigurationVersionResponse createHostedConfigResponse = appConfigClient.createHostedConfigurationVersion(createHostedConfigRequest);

            // Start deployment of the new configuration version
            StartDeploymentRequest startDeploymentRequest = StartDeploymentRequest.builder()
                    .applicationId(APP_ID)
                    .environmentId(ENV_ID)
                    .configurationProfileId(CONFIG_PROFILE_ID)
                    .configurationVersion(createHostedConfigResponse.versionNumber().toString())
                    .deploymentStrategyId("AppConfig.AllAtOnce") // Replace with your deployment strategy ID
                    .build();

            StartDeploymentResponse startDeploymentResponse = appConfigClient.startDeployment(startDeploymentRequest);
            System.out.println("Deployment started: " + startDeploymentResponse.deploymentNumber());

        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            appConfigDataClient.close();
            appConfigClient.close();
        }
    }

    private static boolean isValidJson(String json) {
        try {
            final ObjectMapper mapper = new ObjectMapper();
            mapper.readTree(json);
            return true;
        } catch (Exception e) {
            return false;
        }
    }
}

Possible Solution

No response

Additional Information/Context

I have been trying to leverage AWS SDK for java for putting a new feature flag into the existing configuration profile. So far I have no luck in getting the code working. I tried multiple ways, read all the available AWS documentation (although its shame that there isn't much), but still I am unable to resolve the code issue. I debugged AWS SDK too, but no luck. I hope I can get resolution here. I tried with Python and Java SDK but both have same issue.

Here is the use case. I need to add a new flag to existing configuration. The below is test code from my local but production grade code yet. I just want to try out before I refactor it.

Code running on Java 17 and AWS SDK V2

        <dependency>
            <groupId>software.amazon.awssdk</groupId>
            <artifactId>appconfigdata</artifactId>
            <version>2.26.25</version>
        </dependency>
        <dependency>
            <groupId>software.amazon.awssdk</groupId>
            <artifactId>appconfig</artifactId>
            <version>2.26.25</version>
        </dependency>
Here is the code ->
import com.fasterxml.jackson.databind.ObjectMapper;
import software.amazon.awssdk.auth.credentials.ProfileCredentialsProvider;
import software.amazon.awssdk.core.SdkBytes;
import software.amazon.awssdk.http.apache.ApacheHttpClient;
import software.amazon.awssdk.http.apache.ProxyConfiguration;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.appconfig.AppConfigClient;
import software.amazon.awssdk.services.appconfig.model.CreateHostedConfigurationVersionRequest;
import software.amazon.awssdk.services.appconfig.model.CreateHostedConfigurationVersionResponse;
import software.amazon.awssdk.services.appconfig.model.StartDeploymentRequest;
import software.amazon.awssdk.services.appconfig.model.StartDeploymentResponse;
import software.amazon.awssdk.services.appconfigdata.AppConfigDataClient;
import software.amazon.awssdk.services.appconfigdata.model.GetLatestConfigurationRequest;
import software.amazon.awssdk.services.appconfigdata.model.GetLatestConfigurationResponse;
import software.amazon.awssdk.services.appconfigdata.model.StartConfigurationSessionRequest;
import software.amazon.awssdk.services.appconfigdata.model.StartConfigurationSessionResponse;

import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.charset.StandardCharsets;
import java.util.Base64;
import java.util.HashMap;
import java.util.Map;

public class AppConfigWriteExample {

    private static final String APP_ID = "my_app_id";
    private static final String ENV_ID = "development";
    private static final String CONFIG_PROFILE_ID = "my_profile_id";
    private static final String CLIENT_ID = "feature-toggle-client";
    private static final String VERSION = "1.0"; // Add version here
    private static final Region REGION = Region.US_EAST_1;

    public static void main(String[] args) throws URISyntaxException, IOException {

        ProxyConfiguration.Builder proxyConfig = ProxyConfiguration.builder()
                .endpoint(new URI("my_proxy_for_local_development"));

        ApacheHttpClient.Builder httpClientBuilder = ApacheHttpClient.builder()
                .proxyConfiguration(proxyConfig.build());

        AppConfigDataClient appConfigDataClient = AppConfigDataClient.builder()
                .region(REGION)
                .httpClientBuilder(httpClientBuilder)
                .credentialsProvider(ProfileCredentialsProvider.create("default"))
                .build();

        AppConfigClient appConfigClient = AppConfigClient.builder()
                .region(REGION)
                .httpClientBuilder(httpClientBuilder)
                .credentialsProvider(ProfileCredentialsProvider.create("default"))
                .build();

        try {
            // Start configuration session
            StartConfigurationSessionRequest startRequest = StartConfigurationSessionRequest.builder()
                    .applicationIdentifier(APP_ID)
                    .environmentIdentifier(ENV_ID)
                    .configurationProfileIdentifier(CONFIG_PROFILE_ID)
                    .build();

            StartConfigurationSessionResponse startResponse = appConfigDataClient.startConfigurationSession(startRequest);
            String sessionToken = startResponse.initialConfigurationToken();

            // Get latest configuration
            GetLatestConfigurationRequest getRequest = GetLatestConfigurationRequest.builder()
                    .configurationToken(sessionToken)
                    .build();

            GetLatestConfigurationResponse getResponse = appConfigDataClient.getLatestConfiguration(getRequest);
            String content = StandardCharsets.UTF_8.decode(getResponse.configuration().asByteBuffer()).toString();

            // Parse configuration
            ObjectMapper objectMapper = new ObjectMapper();
            Map<String, Object> config = objectMapper.readValue(content, Map.class);

            // Ensure the configuration matches the provided JSON schema and structure
            Map<String, Object> flags = (Map<String, Object>) config.getOrDefault("flags", new HashMap<>());
            Map<String, Object> values = (Map<String, Object>) config.getOrDefault("values", new HashMap<>());

            // Add or update the feature flags and their values
            Map<String, Object> flagFromUi = new HashMap<>();
            flagFromUi.put("name", "flag_from_ui");
            flagFromUi.put("description", "flag_from_ui");
            flagFromUi.put("_createdAt", "2024-08-05T19:55:27.399Z");
            flagFromUi.put("_updatedAt", "2024-08-05T19:55:27.399Z");
            flags.put("flag_from_ui", flagFromUi);

            Map<String, Object> flagFromUiValues = new HashMap<>();
            flagFromUiValues.put("enabled", true);
            flagFromUiValues.put("_createdAt", "2024-08-05T19:55:27.399Z");
            flagFromUiValues.put("_updatedAt", "2024-08-05T19:55:27.399Z");
            values.put("flag_from_ui", flagFromUiValues);

            Map<String, Object> uiRefresh = new HashMap<>();
            uiRefresh.put("name", "UI Refresh");
            uiRefresh.put("_createdAt", "2024-08-05T17:59:42.886Z");
            uiRefresh.put("_updatedAt", "2024-07-31T18:09:19.939Z");
            flags.put("ui_refresh", uiRefresh);

            Map<String, Object> uiRefreshValues = new HashMap<>();
            uiRefreshValues.put("enabled", false);
            uiRefreshValues.put("_createdAt", "2024-08-05T17:59:42.886Z");
            uiRefreshValues.put("_updatedAt", "2024-07-31T18:09:19.939Z");
            values.put("ui_refresh", uiRefreshValues);

            // Create configuration content matching the JSON schema
            Map<String, Object> configurationContent = new HashMap<>();
            configurationContent.put("version", "1");
            configurationContent.put("flags", flags);
            configurationContent.put("values", values);

            // Convert updated configuration back to JSON
            String updatedContent = objectMapper.writeValueAsString(configurationContent);

            // Validate updated configuration
            if (!isValidJson(updatedContent)) {
                throw new IllegalArgumentException("Invalid JSON content");
            }

            // Encode the updated content to Base64 using a similar method as the command line
            String base64EncodedContent = Base64.getEncoder().encodeToString(updatedContent.getBytes(StandardCharsets.UTF_8));

            // Create a new hosted configuration version
            CreateHostedConfigurationVersionRequest createHostedConfigRequest = CreateHostedConfigurationVersionRequest.builder()
                    .applicationId(APP_ID)
                    .configurationProfileId(CONFIG_PROFILE_ID)
                    .content(SdkBytes.fromByteArray(base64EncodedContent.getBytes(StandardCharsets.UTF_8)))
                    .contentType("application/json")
                    .build();

            CreateHostedConfigurationVersionResponse createHostedConfigResponse = appConfigClient.createHostedConfigurationVersion(createHostedConfigRequest);

            // Start deployment of the new configuration version
            StartDeploymentRequest startDeploymentRequest = StartDeploymentRequest.builder()
                    .applicationId(APP_ID)
                    .environmentId(ENV_ID)
                    .configurationProfileId(CONFIG_PROFILE_ID)
                    .configurationVersion(createHostedConfigResponse.versionNumber().toString())
                    .deploymentStrategyId("AppConfig.AllAtOnce") // Replace with your deployment strategy ID
                    .build();

            StartDeploymentResponse startDeploymentResponse = appConfigClient.startDeployment(startDeploymentRequest);
            System.out.println("Deployment started: " + startDeploymentResponse.deploymentNumber());

        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            appConfigDataClient.close();
            appConfigClient.close();
        }
    }

    private static boolean isValidJson(String json) {
        try {
            final ObjectMapper mapper = new ObjectMapper();
            mapper.readTree(json);
            return true;
        } catch (Exception e) {
            return false;
        }
    }
}

Here is the actual json it converts to, which matches with AWS Schema: https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-type-reference-feature-flags.html

{
    "values":
    {
        "flag_from_ui":
        {
            "_createdAt": "2024-08-05T19:55:27.399Z",
            "_updatedAt": "2024-08-05T19:55:27.399Z",
            "enabled": true
        },
        "ui_refresh":
        {
            "_createdAt": "2024-08-05T17:59:42.886Z",
            "_updatedAt": "2024-07-31T18:09:19.939Z",
            "enabled": false
        }
    },
    "flags":
    {
        "flag_from_ui":
        {
            "_createdAt": "2024-08-05T19:55:27.399Z",
            "name": "flag_from_ui",
            "description": "flag_from_ui",
            "_updatedAt": "2024-08-05T19:55:27.399Z"
        },
        "ui_refresh":
        {
            "_createdAt": "2024-08-05T17:59:42.886Z",
            "name": "UI Refresh",
            "_updatedAt": "2024-07-31T18:09:19.939Z"
        }
    },
    "version": "1"
}

Here is the error I am getting while running this code ->

software.amazon.awssdk.services.appconfig.model.BadRequestException: Error invoking extension AppConfig Feature Flags Helper: Malformed 'Content' provided (Service: AppConfig, Status Code: 400, 
	at software.amazon.awssdk.core.internal.http.CombinedResponseHandler.handleErrorResponse(CombinedResponseHandler.java:125)
	at software.amazon.awssdk.core.internal.http.CombinedResponseHandler.handleResponse(CombinedResponseHandler.java:82)
	at software.amazon.awssdk.core.internal.http.CombinedResponseHandler.handle(CombinedResponseHandler.java:60)
	at software.amazon.awssdk.core.internal.http.CombinedResponseHandler.handle(CombinedResponseHandler.java:41)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.HandleResponseStage.execute(HandleResponseStage.java:50)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.HandleResponseStage.execute(HandleResponseStage.java:38)
	at software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallAttemptTimeoutTrackingStage.execute(ApiCallAttemptTimeoutTrackingStage.java:72)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallAttemptTimeoutTrackingStage.execute(ApiCallAttemptTimeoutTrackingStage.java:42)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.TimeoutExceptionHandlingStage.execute(TimeoutExceptionHandlingStage.java:78)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.TimeoutExceptionHandlingStage.execute(TimeoutExceptionHandlingStage.java:40)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallAttemptMetricCollectionStage.execute(ApiCallAttemptMetricCollectionStage.java:55)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallAttemptMetricCollectionStage.execute(ApiCallAttemptMetricCollectionStage.java:39)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.RetryableStage2.executeRequest(RetryableStage2.java:93)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.RetryableStage2.execute(RetryableStage2.java:56)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.RetryableStage2.execute(RetryableStage2.java:36)
	at software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206)
	at software.amazon.awssdk.core.internal.http.StreamManagingStage.execute(StreamManagingStage.java:53)
	at software.amazon.awssdk.core.internal.http.StreamManagingStage.execute(StreamManagingStage.java:35)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallTimeoutTrackingStage.executeWithTimer(ApiCallTimeoutTrackingStage.java:80)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallTimeoutTrackingStage.execute(ApiCallTimeoutTrackingStage.java:60)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallTimeoutTrackingStage.execute(ApiCallTimeoutTrackingStage.java:42)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallMetricCollectionStage.execute(ApiCallMetricCollectionStage.java:50)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallMetricCollectionStage.execute(ApiCallMetricCollectionStage.java:32)
	at software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206)
	at software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.ExecutionFailureExceptionReportingStage.execute(ExecutionFailureExceptionReportingStage.java:37)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.ExecutionFailureExceptionReportingStage.execute(ExecutionFailureExceptionReportingStage.java:26)
	at software.amazon.awssdk.core.internal.http.AmazonSyncHttpClient$RequestExecutionBuilderImpl.execute(AmazonSyncHttpClient.java:210)
	at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.invoke(BaseSyncClientHandler.java:103)
	at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.doExecute(BaseSyncClientHandler.java:173)
	at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.lambda$execute$1(BaseSyncClientHandler.java:80)
	at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.measureApiCallSuccess(BaseSyncClientHandler.java:182)
	at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.execute(BaseSyncClientHandler.java:74)
	at software.amazon.awssdk.core.client.handler.SdkSyncClientHandler.execute(SdkSyncClientHandler.java:45)
	at software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler.execute(AwsSyncClientHandler.java:53)
	at software.amazon.awssdk.services.appconfig.DefaultAppConfigClient.createHostedConfigurationVersion(DefaultAppConfigClient.java:856)
	at com.adp.talent.AppConfigWriteExample.main(AppConfigWriteExample.java:135)
16:24:39.000 [main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection manager is shutting down
16:24:39.001 [main] DEBUG org.apache.http.impl.conn.DefaultManagedHttpClientConnection - http-outgoing-0: Close connection
16:24:39.003 [main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection manager shut down
16:24:39.003 [main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection manager is shutting down
16:24:39.003 [main] DEBUG org.apache.http.impl.conn.DefaultManagedHttpClientConnection - http-outgoing-1: Close connection
16:24:39.003 [idle-connection-reaper] DEBUG software.amazon.awssdk.http.apache.internal.conn.IdleConnectionReaper - Reaper thread: 
java.lang.InterruptedException: sleep interrupted
	at java.base/java.lang.Thread.sleep(Native Method)
	at software.amazon.awssdk.http.apache.internal.conn.IdleConnectionReaper$ReaperTask.run(IdleConnectionReaper.java:151)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)
16:24:39.003 [idle-connection-reaper] DEBUG software.amazon.awssdk.http.apache.internal.conn.IdleConnectionReaper - Shutting down reaper thread.
16:24:39.003 [main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection manager shut down
software.amazon.awssdk.services.appconfig.model.BadRequestException: Error invoking extension AppConfig Feature Flags Helper: Malformed 'Content' provided (Service: AppConfig, Status Code: 400, Request ID: 77a3dd33-56cc-4048-997d-0ab517db94f8)
	at software.amazon.awssdk.core.internal.http.CombinedResponseHandler.handleErrorResponse(CombinedResponseHandler.java:125)
	at software.amazon.awssdk.core.internal.http.CombinedResponseHandler.handleResponse(CombinedResponseHandler.java:82)
	at software.amazon.awssdk.core.internal.http.CombinedResponseHandler.handle(CombinedResponseHandler.java:60)
	at software.amazon.awssdk.core.internal.http.CombinedResponseHandler.handle(CombinedResponseHandler.java:41)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.HandleResponseStage.execute(HandleResponseStage.java:50)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.HandleResponseStage.execute(HandleResponseStage.java:38)
	at software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallAttemptTimeoutTrackingStage.execute(ApiCallAttemptTimeoutTrackingStage.java:72)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallAttemptTimeoutTrackingStage.execute(ApiCallAttemptTimeoutTrackingStage.java:42)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.TimeoutExceptionHandlingStage.execute(TimeoutExceptionHandlingStage.java:78)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.TimeoutExceptionHandlingStage.execute(TimeoutExceptionHandlingStage.java:40)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallAttemptMetricCollectionStage.execute(ApiCallAttemptMetricCollectionStage.java:55)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallAttemptMetricCollectionStage.execute(ApiCallAttemptMetricCollectionStage.java:39)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.RetryableStage2.executeRequest(RetryableStage2.java:93)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.RetryableStage2.execute(RetryableStage2.java:56)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.RetryableStage2.execute(RetryableStage2.java:36)
	at software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206)
	at software.amazon.awssdk.core.internal.http.StreamManagingStage.execute(StreamManagingStage.java:53)
	at software.amazon.awssdk.core.internal.http.StreamManagingStage.execute(StreamManagingStage.java:35)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallTimeoutTrackingStage.executeWithTimer(ApiCallTimeoutTrackingStage.java:80)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallTimeoutTrackingStage.execute(ApiCallTimeoutTrackingStage.java:60)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallTimeoutTrackingStage.execute(ApiCallTimeoutTrackingStage.java:42)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallMetricCollectionStage.execute(ApiCallMetricCollectionStage.java:50)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallMetricCollectionStage.execute(ApiCallMetricCollectionStage.java:32)
	at software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206)
	at software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.ExecutionFailureExceptionReportingStage.execute(ExecutionFailureExceptionReportingStage.java:37)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.ExecutionFailureExceptionReportingStage.execute(ExecutionFailureExceptionReportingStage.java:26)
	at software.amazon.awssdk.core.internal.http.AmazonSyncHttpClient$RequestExecutionBuilderImpl.execute(AmazonSyncHttpClient.java:210)
	at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.invoke(BaseSyncClientHandler.java:103)
	at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.doExecute(BaseSyncClientHandler.java:173)
	at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.lambda$execute$1(BaseSyncClientHandler.java:80)
	at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.measureApiCallSuccess(BaseSyncClientHandler.java:182)
	at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.execute(BaseSyncClientHandler.java:74)
	at software.amazon.awssdk.core.client.handler.SdkSyncClientHandler.execute(SdkSyncClientHandler.java:45)
	at software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler.execute(AwsSyncClientHandler.java:53)
	at software.amazon.awssdk.services.appconfig.DefaultAppConfigClient.createHostedConfigurationVersion(DefaultAppConfigClient.java:856)
	at com.adp.talent.AppConfigWriteExample.main(AppConfigWriteExample.java:135)

Any help or pointers will unblock me. Need ASAP

AWS Java SDK version used

2.26.25

JDK version used

java version "17.0.4.1" 2022-08-18 LTS
Java(TM) SE Runtime Environment (build 17.0.4.1+1-LTS-2)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.4.1+1-LTS-2, mixed mode, sharing)

Operating System and version

macOS Sonama 14.5

Metadata

Metadata

Assignees

Labels

guidanceQuestion that needs advice or information.p2This is a standard priority issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions