-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
aws/resource_aws_lambda_function: imageConfig can be null #17359
Conversation
not fail if ImageConfig == null Reproducible by: runtime error: invalid memory address or nil pointer dereference 2021-01-29T16:58:16.670+0100 [DEBUG] plugin.terraform-provider-aws_v3.26.0_x5: [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x484cae2] 2021-01-29T16:58:16.670+0100 [DEBUG] plugin.terraform-provider-aws_v3.26.0_x5: 2021-01-29T16:58:16.670+0100 [DEBUG] plugin.terraform-provider-aws_v3.26.0_x5: goroutine 26 [running]: 2021-01-29T16:58:16.670+0100 [DEBUG] plugin.terraform-provider-aws_v3.26.0_x5: github.com/terraform-providers/terraform-provider-aws/aws.flattenLambdaImageConfig(...) 2021-01-29T16:58:16.670+0100 [DEBUG] plugin.terraform-provider-aws_v3.26.0_x5: /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-aws/aws/resource_aws_lambda_function.go:1322 2021-01-29T16:58:16.670+0100 [DEBUG] plugin.terraform-provider-aws_v3.26.0_x5: github.com/terraform-providers/terraform-provider-aws/aws.resourceAwsLambdaFunctionRead(0xc001deee00, 0x5aee120, 0xc001162000, 0xa68abe0, 0x69151d0) 2021-01-29T16:58:16.670+0100 [DEBUG] plugin.terraform-provider-aws_v3.26.0_x5: /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-aws/aws/resource_aws_lambda_function.go:724 +0x2f62 2021-01-29T16:58:16.670+0100 [DEBUG] plugin.terraform-provider-aws_v3.26.0_x5: github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0xc000a460c0, 0x7235c00, 0xc0017670c0, 0xc001deee00, 0x5aee120, 0xc001162000, 0x0, 0x0, 0x0) 2021-01-29T16:58:16.670+0100 [DEBUG] plugin.terraform-provider-aws_v3.26.0_x5: /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.4.1/helper/schema/resource.go:290 +0x88 2021-01-29T16:58:16.670+0100 [DEBUG] plugin.terraform-provider-aws_v3.26.0_x5: github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).RefreshWithoutUpgrade(0xc000a460c0, 0x7235c00, 0xc0017670c0, 0xc000a307e0, 0x5aee120, 0xc001162000, 0xc00011ea58, 0x0, 0x0, 0x0) 2021-01-29T16:58:16.670+0100 [DEBUG] plugin.terraform-provider-aws_v3.26.0_x5: /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.4.1/helper/schema/resource.go:564 +0x1cb 2021-01-29T16:58:16.670+0100 [DEBUG] plugin.terraform-provider-aws_v3.26.0_x5: github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ReadResource(0xc000cf0300, 0x7235c00, 0xc0017670c0, 0xc001767100, 0xc0017670c0, 0x6340b20, 0x65debe0) 2021-01-29T16:58:16.670+0100 [DEBUG] plugin.terraform-provider-aws_v3.26.0_x5: /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.4.1/helper/schema/grpc_provider.go:575 +0x43b 2021-01-29T16:58:16.670+0100 [DEBUG] plugin.terraform-provider-aws_v3.26.0_x5: github.com/hashicorp/terraform-plugin-go/tfprotov5/server.(*server).ReadResource(0xc0018c8840, 0x7235c00, 0xc0017670c0, 0xc00063f9e0, 0xc0018c8840, 0xc0011c34a0, 0xc001d5eba0) 2021-01-29T16:58:16.670+0100 [DEBUG] plugin.terraform-provider-aws_v3.26.0_x5: /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-go@v0.2.1/tfprotov5/server/server.go:298 +0x105 2021-01-29T16:58:16.670+0100 [DEBUG] plugin.terraform-provider-aws_v3.26.0_x5: github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadResource_Handler(0x65debe0, 0xc0018c8840, 0x7235cc0, 0xc0011c34a0, 0xc00063f920, 0x0, 0x7235cc0, 0xc0011c34a0, 0xc0011d4580, 0x285) 2021-01-29T16:58:16.670+0100 [DEBUG] plugin.terraform-provider-aws_v3.26.0_x5: /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-go@v0.2.1/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:344 +0x214 2021-01-29T16:58:16.670+0100 [DEBUG] plugin.terraform-provider-aws_v3.26.0_x5: google.golang.org/grpc.(*Server).processUnaryRPC(0xc000566fc0, 0x7258ba0, 0xc000130600, 0xc001dfe200, 0xc0015f2b70, 0xa649490, 0x0, 0x0, 0x0) 2021-01-29T16:58:16.670+0100 [DEBUG] plugin.terraform-provider-aws_v3.26.0_x5: /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/google.golang.org/grpc@v1.32.0/server.go:1194 +0x522 2021-01-29T16:58:16.670+0100 [DEBUG] plugin.terraform-provider-aws_v3.26.0_x5: google.golang.org/grpc.(*Server).handleStream(0xc000566fc0, 0x7258ba0, 0xc000130600, 0xc001dfe200, 0x0) 2021-01-29T16:58:16.670+0100 [DEBUG] plugin.terraform-provider-aws_v3.26.0_x5: /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/google.golang.org/grpc@v1.32.0/server.go:1517 +0xd05 2021-01-29T16:58:16.670+0100 [DEBUG] plugin.terraform-provider-aws_v3.26.0_x5: google.golang.org/grpc.(*Server).serveStreams.func1.2(0xc000bdedb0, 0xc000566fc0, 0x7258ba0, 0xc000130600, 0xc001dfe200) 2021-01-29T16:58:16.670+0100 [DEBUG] plugin.terraform-provider-aws_v3.26.0_x5: /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/google.golang.org/grpc@v1.32.0/server.go:859 +0xa5 2021-01-29T16:58:16.670+0100 [DEBUG] plugin.terraform-provider-aws_v3.26.0_x5: created by google.golang.org/grpc.(*Server).serveStreams.func1 2021-01-29T16:58:16.670+0100 [DEBUG] plugin.terraform-provider-aws_v3.26.0_x5: /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/google.golang.org/grpc@v1.32.0/server.go:857 +0x1fd 2021-01-29T16:58:16.675+0100 [DEBUG] plugin: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/aws/3.26.0/linux_amd64/terraform-provider-aws_v3.26.0_x5 pid=163969 error="exit status 2" 2021-01-29T16:58:16.675+0100 [WARN] plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing" The ImageConfig can be null. { ... "Configuration": { ... "ImageConfigResponse": { "Error": null, "ImageConfig": null }, }, }
Relates: #17081. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome @wuurrd 👋
It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTING guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.
Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.
Thanks again, and welcome to the community! 😃
@ewbankkit excellent, although closing this one when that PR is without tests and without a proper explanation of why it occurs seems a bit strange? |
Agreed, @wuurrd #17082 needs to be updated. I was in a rush when I created it (we used a custom provider binary to fix deployment pipelines) and didn't get a chance to follow up until now. I updated the description in the PR to match the contribution guidelines based on your example above. What is the best way to move over the unit test you wrote? |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Allow flattenLambdaImageConfig to not fail if ImageConfig == null
Reproducible by importing a lambda function where the image config has not been set to anything:
The ImageConfig can be null.
Community Note
Relates OR Closes #0000
Output from acceptance testing: