java - AWS : Feature flag configurations must be accessed via AWS AppConfig Data's GetLatestConfiguration API

标签 java amazon-web-services amazon-ec2 app-config

我正在尝试运行 Server signal在AWS中,但是当我尝试运行时,我遇到了自己的问题。当我尝试运行 jar 文件时,出现 software.amazon.awssdk.services.appconfig.model.BadRequestException。看起来配置中存在某种错误,它需要 getLatestConfiguration API。但是我好像配置了,但是还是不行。

java -jar service/target/TextSecureServer-7.13.0.jar server service/config/sample.yml
INFO  [2021-12-29 17:11:09,722] org.eclipse.jetty.util.log: Logging initialized @2470ms to org.eclipse.jetty.util.log.Slf4jLog
INFO  [2021-12-29 17:11:09,823] io.dropwizard.server.DefaultServerFactory: Registering jersey handler with root path prefix: /
INFO  [2021-12-29 17:11:09,826] io.dropwizard.server.DefaultServerFactory: Registering admin handler with root path prefix: /
INFO  [2021-12-29 17:11:09,859] io.micrometer.datadog.DatadogMeterRegistry: An application key must be configured in order for unit information to be sent to Datadog.
INFO  [2021-12-29 17:11:09,861] io.micrometer.core.instrument.push.PushMeterRegistry: publishing metrics for DatadogMeterRegistry every 10s
WARN  [2021-12-29 17:11:13,290] org.whispersystems.textsecuregcm.storage.DynamicConfigurationManager: Error retrieving initial dynamic configuration
! software.amazon.awssdk.services.appconfig.model.BadRequestException: Feature flag configurations must be accessed via AWS AppConfig Data's GetLatestConfiguration API. (Service: AppConfig, Status Code: 400, Request ID: 6afaeb4e-437c-4c44-a48b-74abbcca30e5, Extended Request ID: null)
! at software.amazon.awssdk.core.internal.http.CombinedResponseHandler.handleErrorResponse(CombinedResponseHandler.java:123)
! at software.amazon.awssdk.core.internal.http.CombinedResponseHandler.handleResponse(CombinedResponseHandler.java:79)
! at software.amazon.awssdk.core.internal.http.CombinedResponseHandler.handle(CombinedResponseHandler.java:59)
! at software.amazon.awssdk.core.internal.http.CombinedResponseHandler.handle(CombinedResponseHandler.java:40)
! at software.amazon.awssdk.core.internal.http.pipeline.stages.HandleResponseStage.execute(HandleResponseStage.java:40)
! at software.amazon.awssdk.core.internal.http.pipeline.stages.HandleResponseStage.execute(HandleResponseStage.java:30)
! 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:73)
! 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:50)
! at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallAttemptMetricCollectionStage.execute(ApiCallAttemptMetricCollectionStage.java:36)
! at software.amazon.awssdk.core.internal.http.pipeline.stages.RetryableStage.execute(RetryableStage.java:64)
! at software.amazon.awssdk.core.internal.http.pipeline.stages.RetryableStage.execute(RetryableStage.java:34)
! 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:56)
! at software.amazon.awssdk.core.internal.http.StreamManagingStage.execute(StreamManagingStage.java:36)
! 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:48)
! at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallMetricCollectionStage.execute(ApiCallMetricCollectionStage.java:31)
! 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:193)
! at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.invoke(BaseSyncClientHandler.java:135)
! at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.doExecute(BaseSyncClientHandler.java:161)
! at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.lambda$execute$1(BaseSyncClientHandler.java:114)
! at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.measureApiCallSuccess(BaseSyncClientHandler.java:169)
! at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.execute(BaseSyncClientHandler.java:95)
! at software.amazon.awssdk.core.client.handler.SdkSyncClientHandler.execute(SdkSyncClientHandler.java:45)
! at software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler.execute(AwsSyncClientHandler.java:55)
! at software.amazon.awssdk.services.appconfig.DefaultAppConfigClient.getConfiguration(DefaultAppConfigClient.java:884)
! at org.whispersystems.textsecuregcm.storage.DynamicConfigurationManager.retrieveDynamicConfiguration(DynamicConfigurationManager.java:109)
! at org.whispersystems.textsecuregcm.storage.DynamicConfigurationManager.retrieveInitialDynamicConfiguration(DynamicConfigurationManager.java:155)
! at org.whispersystems.textsecuregcm.storage.DynamicConfigurationManager.start(DynamicConfigurationManager.java:83)
! at org.whispersystems.textsecuregcm.WhisperServerService.run(WhisperServerService.java:413)
! at org.whispersystems.textsecuregcm.WhisperServerService.run(WhisperServerService.java:233)
! at io.dropwizard.cli.EnvironmentCommand.run(EnvironmentCommand.java:59)
! at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:98)
! at io.dropwizard.cli.Cli.run(Cli.java:78)
! at io.dropwizard.Application.run(Application.java:94)
! at org.whispersystems.textsecuregcm.WhisperServerService.main(WhisperServerService.java:777)

角色的隐私设置如下:

    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "appconfig:CreateApplication",
                "appconfig:CreateConfigurationProfile",
                "appconfig:CreateDeploymentStrategy",
                "appconfig:CreateEnvironment",
                "appconfig:CreateHostedConfigurationVersion",
                "appconfig:DeleteApplication",
                "appconfig:DeleteConfigurationProfile",
                "appconfig:DeleteDeploymentStrategy",
                "appconfig:DeleteEnvironment",
                "appconfig:DeleteHostedConfigurationVersion",
                "appconfig:GetApplication",
                "appconfig:GetConfiguration",
                "appconfig:GetConfigurationProfile",
                "appconfig:GetDeployment",
                "appconfig:GetDeploymentStrategy",
                "appconfig:GetEnvironment",
                "appconfig:GetHostedConfigurationVersion",
                "appconfig:GetLatestConfiguration",
                "appconfig:ListApplications",
                "appconfig:ListConfigurationProfiles",
                "appconfig:ListDeploymentStrategies",
                "appconfig:ListDeployments",
                "appconfig:ListEnvironments",
                "appconfig:ListHostedConfigurationVersions",
                "appconfig:ListTagsForResource",
                "appconfig:StartConfigurationSession",
                "appconfig:StartDeployment",
                "appconfig:StopDeployment",
                "appconfig:TagResource",
                "appconfig:UntagResource",
                "appconfig:UpdateApplication",
                "appconfig:UpdateConfigurationProfile",
                "appconfig:UpdateDeploymentStrategy",
                "appconfig:UpdateEnvironment",
                "appconfig:ValidateConfiguration"
            ],
            "Resource": "*"
        },
        {
            "Sid": "VisualEditor1",
            "Effect": "Allow",
            "Action": "ssm:GetDocument",
            "Resource": "arn:aws:ssm:*:451591994037:document/*"
        }
    ]
}

AppConfig 似乎是按照网站上的指南进行配置的。我用过this一般设置指南

最佳答案

您需要实际调用 GetLatestConfiguration API,看起来您只是添加了权限,但仍然调用 GetConfiguration。请参阅https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-retrieving-the-configuration.html有关启动配置 session 和调用 GetLatestConfiguration 的更多详细信息。

请注意,这些 API 是单独 SDK 客户端的一部分

https://github.com/aws/aws-sdk-java-v2/blob/master/services/appconfigdata/pom.xml

关于java - AWS : Feature flag configurations must be accessed via AWS AppConfig Data's GetLatestConfiguration API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70528824/

相关文章:

amazon-web-services - 如何为 s3 存储桶指定子域?

hadoop - AWS Elastic MapReduce 和 AWS Redshift 有什么区别

java - 无法停止读取java中的输入

java - 如何用 Java 打印接下来的 20 个闰年

amazon-web-services - 无法在 Amazon EC2 实例上关联弹性 IP

amazon-web-services - 在 dynamoDB 中为 GSI 使用 SortKey 的任何缺点

laravel - AWS Iam 命令,在终端中正常工作,但在 Laravel/PHP AWS SDK 中不起作用

laravel - EC2 : Laravel migrations run as many times as the instances

java - 理解 Maven 依赖

java - 方法返回不正确的值?