-
Notifications
You must be signed in to change notification settings - Fork 2.1k
AWS Go SDK v1.28.0 Code Generated Error Types Missing Error Message #3088
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
bug
This issue is a bug.
Comments
This was referenced Jan 20, 2020
Thanks for reporting this bug, and the in depth description of the problem. It looks like the SDK's generation needs to ensure all errors have a We'll work on getting a fix out for this bug. |
jasdel
added a commit
to jasdel/aws-sdk-go
that referenced
this issue
Jan 20, 2020
Fixes the SDK's generated errors to all include the `Message` member regardless if it was modeled on the error shape. This fixes the bug identified in aws#3088 where some JSON errors were not modeled with the Message member. This caused the errors message to be dropped, and not retrievable. This change also updates the SDK's generated smoke test to expect the Message member of an error unmarshalled not to be empty.
jasdel
added a commit
that referenced
this issue
Jan 21, 2020
Fixes the SDK's generated errors to all include the `Message` member regardless if it was modeled on the error shape. This fixes the bug identified in #3088 where some JSON errors were not modeled with the Message member. This caused the errors message to be dropped, and not retrievable. This change also updates the SDK's generated smoke test to expect the Message member of an error unmarshaled not to be empty. Fixes #3088
aws-sdk-go-automation
pushed a commit
that referenced
this issue
Jan 23, 2020
=== ### Service Client Updates * `service/iam`: Updates service API and documentation * This release enables the Identity and Access Management policy simulator to simulate permissions boundary policies. * `service/rds`: Updates service API, documentation, and paginators * This SDK release introduces APIs that automate the export of Amazon RDS snapshot data to Amazon S3. The new APIs include: StartExportTask, CancelExportTask, DescribeExportTasks. These APIs automate the extraction of data from an RDS snapshot and export it to an Amazon S3 bucket. The data is stored in a compressed, consistent, and query-able format. After the data is exported, you can query it directly using tools such as Amazon Athena or Redshift Spectrum. You can also consume the data as part of a data lake solution. If you archive the data in S3 Infrequent Access or Glacier, you can reduce long term data storage costs by applying data lifecycle policies. ### SDK Bugs * Fix generated errors for some JSON APIs not including a message ([#3089](#3089)) * Fixes the SDK's generated errors to all include the `Message` member regardless if it was modeled on the error shape. This fixes the bug identified in #3088 where some JSON errors were not modeled with the Message member.
Merged
aws-sdk-go-automation
added a commit
that referenced
this issue
Jan 23, 2020
Release v1.28.8 (2020-01-23) === ### Service Client Updates * `service/iam`: Updates service API and documentation * This release enables the Identity and Access Management policy simulator to simulate permissions boundary policies. * `service/rds`: Updates service API, documentation, and paginators * This SDK release introduces APIs that automate the export of Amazon RDS snapshot data to Amazon S3. The new APIs include: StartExportTask, CancelExportTask, DescribeExportTasks. These APIs automate the extraction of data from an RDS snapshot and export it to an Amazon S3 bucket. The data is stored in a compressed, consistent, and query-able format. After the data is exported, you can query it directly using tools such as Amazon Athena or Redshift Spectrum. You can also consume the data as part of a data lake solution. If you archive the data in S3 Infrequent Access or Glacier, you can reduce long term data storage costs by applying data lifecycle policies. ### SDK Bugs * Fix generated errors for some JSON APIs not including a message ([#3089](#3089)) * Fixes the SDK's generated errors to all include the `Message` member regardless if it was modeled on the error shape. This fixes the bug identified in #3088 where some JSON errors were not modeled with the Message member.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please fill out the sections below to help us address your issue.
Version of AWS SDK for Go?
Version 1.28.5
Version of Go (
go version
)?Go 1.13
What issue did you see?
Changes in v1.28.0 of the AWS Go SDK (imported and released by Terraform AWS Provider version 2.45.0) introduced code generated types for certain service error shapes, which can be used to extract additional information provided by the API response. Prior to these code generated types, most (if not all) of these errors returned the correct error messaging via
Message()
via themessage
protocol response field. However after this change, since some of these error shapes in the service API models are incorrectly missing theMessage
structure member, this causes theMessage_
(Go struct type) to be missing, which causes the error message viaMessage()
to always be empty.An example of this missing error messaging can be seen with
codebuild
serviceInvalidInputException
shape:aws-sdk-go/models/apis/codebuild/2016-10-06/api-2.json
Lines 998 to 1003 in 6627e89
aws-sdk-go/service/codebuild/api.go
Lines 5333 to 5336 in 6627e89
Debug output from the application shows the error message being returned, but it does not seem possible to access given the above (note missing error message after error code and colon on last line):
Full SDK analysis of this new behavior was performed here: hashicorp/terraform-provider-aws#11642 (comment)
In terms of the AWS Go SDK, this change potentially affected the following services:
apigatewaymanagementapi
cloud9
cloudhsm
cloudtrail
cloudwatchevents
cloudwatchlogs
codebuild
codecommit
codedeploy
codepipeline
codestar
configservice
dax
directconnect
ecs
elasticsearchservice
elastictranscoder
emr
eventbridge
lexmodelbuildingservice
managedblockchain
pinpointemail
rdsdataservice
rekognition
servicecatalog
sesv2
sms
ssm
ssooidc
textract
transfer
waf
wafregional
workdocs
In terms of the Terraform AWS Provider, this change broke the following behaviors which were dependent on checking the previously available error messages:
aws_cloud9_environment_ec2
resource, unable to retry for IAM eventual consistency onNotFoundException
during creation (https://github.com/terraform-providers/terraform-provider-aws/blob/96840caea28e3abf72d0d994550d2ee7d4b7fc45/aws/resource_aws_cloud9_environment_ec2.go#L96-L98)aws_cloudtrail
resource, unable to retry for CloudWatch Logs eventual consistency onInvalidCloudWatchLogsRoleArnException
andInvalidCloudWatchLogsLogGroupArnException
during creation or update (https://github.com/terraform-providers/terraform-provider-aws/blob/96840caea28e3abf72d0d994550d2ee7d4b7fc45/aws/resource_aws_cloudtrail.go#L186-L191)aws_cloudwatch_log_destination
resource, unable to retry forInvalidParameterException
with test message delivery during creation or update (https://github.com/terraform-providers/terraform-provider-aws/blob/96840caea28e3abf72d0d994550d2ee7d4b7fc45/aws/resource_aws_cloudwatch_log_destination.go#L70-L72)aws_cloudwatch_log_subscription
resource, unable to retry forInvalidParameterException
with test message delivery and Lambda Function execution during creation (https://github.com/terraform-providers/terraform-provider-aws/blob/96840caea28e3abf72d0d994550d2ee7d4b7fc45/aws/resource_aws_cloudwatch_log_subscription_filter.go#L71-L76)aws_codebuild_project
resource, unable to retry for IAM eventual consistency onInvalidInputException
during creation and update (https://github.com/terraform-providers/terraform-provider-aws/blob/96840caea28e3abf72d0d994550d2ee7d4b7fc45/aws/resource_aws_codebuild_project.go#L665-L669)aws_codedeploy_deployment_group
resource, unable to retry for SNS Topic eventual consistency onInvalidTriggerConfigException
during creation and update (https://github.com/terraform-providers/terraform-provider-aws/blob/96840caea28e3abf72d0d994550d2ee7d4b7fc45/aws/resource_aws_codedeploy_deployment_group.go#L783-L788)aws_config_delivery_channel
resource, unable to retry for running Config Configuration Recorder onLastDeliveryChannelDeleteFailedException
during deletion (https://github.com/terraform-providers/terraform-provider-aws/blob/96840caea28e3abf72d0d994550d2ee7d4b7fc45/aws/resource_aws_config_delivery_channel.go#L172-L174)aws_ecs_service
resource, unable to retry for cross-service eventual consistency onInvalidParameterException
during creation and update (https://github.com/terraform-providers/terraform-provider-aws/blob/96840caea28e3abf72d0d994550d2ee7d4b7fc45/aws/resource_aws_ecs_service.go#L524-L533)aws_elasticsearch_domain
resource, unable to retry for various eventual consistency errors onInvalidTypeException
/ValidationException
during creation (https://github.com/terraform-providers/terraform-provider-aws/blob/96840caea28e3abf72d0d994550d2ee7d4b7fc45/aws/resource_aws_elasticsearch_domain.go#L459-L474)Historically, we have preferred to sometimes check specific error messaging from the service API responses since the error code itself may not be descriptive enough to determine if the error could/should be retried. While the service APIs should likely introduce more granular error codes and fix their API models, the unexpected removal of the error messaging represents a fairly problematic change in the AWS Go SDK since it was previously supported by many services.
Is it possible for these errors to try and return a message, if available, even if the
Message
member is undefined in the API model?References:
Steps to reproduce
From https://github.com/terraform-providers/terraform-provider-aws:
$ TF_ACC=1 go test ./aws -v -count 1 -timeout 120m -parallel 20 -run='TestAccAWSCodeBuildProject_basic'
The text was updated successfully, but these errors were encountered: