-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
ValidationException
missing message on Lambda function creation
#4733
Comments
Analysis: aws-sdk-go/private/protocol/restjson/unmarshal_error.go Lines 39 to 89 in 162792e
Possible fix: + // account for error message in body when error is unmodeled
+ if msg == "" {
+ if b, err := io.ReadAll(body); err == nil {
+ msg = string(b)
+ }
+ }
+
// fallback to unmodeled generic exceptions
return awserr.NewRequestFailure(
awserr.New(code, msg, nil),
respMeta.StatusCode,
respMeta.RequestID,
), nil
} We also need to update test cases to account for it. @jar-b since we are shifting focus to the v2 SDK, we are going to assign lower priority for this. Thanks, |
Thanks for the investigation @RanVaknin. I've opened #4740 which I believe addresses the issue while preserving backwards compatibility (at least with existing test cases). We've upgraded to the AWS SDK V2 for the lambda function use case documented in the original issue, but because this impacts any unmodeled error message it may still be worth patching. We have a sizable AWS SDK V1 footprint in the AWS Terraform Provider, and it may benefit other less visible services as well. |
|
Describe the bug
While attempting to create a Lambda function with an invalid configuration (ex.
timeout
above the maximum limit), theValidationException
message body appears to be dropped. The same input with the AWS Go SDK V2 or AWS CLI returns a complete error.The absence of messaging makes debugging invalid configurations difficult, as documented in hashicorp/terraform-provider-aws#13709
Go SDK V1
Show Source
main.go
:Go SDK V2
Show Source
main.go
:AWS CLI
main.sh
:Expected Behavior
A complete error message, including details about which attribute caused the violation, to be returned.
Current Behavior
The error message body is empty.
Reproduction Steps
main.go
from the "Go SDK V1" section above.Possible Solution
No response
Additional Information/Context
This is a highly upvoted issue in the Terraform AWS Provider repository: hashicorp/terraform-provider-aws#13709
SDK version used
v1.44.204
Environment details (Version of Go (
go version
)? OS name and version, etc.)go version go1.19.6 darwin/arm64
The text was updated successfully, but these errors were encountered: