Skip to content
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

terraform-provider-aws_v3.64.2_x5 - invalid memory address or nil pointer dereference #21698

Closed
1FastSTi opened this issue Nov 9, 2021 · 9 comments
Labels
bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic. service/s3 Issues and PRs that pertain to the s3 service.

Comments

@1FastSTi
Copy link

1FastSTi commented Nov 9, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform AWS Provider Version

Affected Resource(s)

  • terraform 1.0.9
  • terraform-provider-aws_v3.64.2x5
Initializing provider plugins...
- Finding latest version of hashicorp/aws...
- Finding latest version of hashicorp/vault...
- Finding latest version of hashicorp/template...
- Finding latest version of hashicorp/random...
- Installing hashicorp/aws v3.64.2...
- Installed hashicorp/aws v3.64.2 (signed by HashiCorp)
- Installing hashicorp/vault v2.24.1...
- Installed hashicorp/vault v2.24.1 (signed by HashiCorp)
- Installing hashicorp/template v2.2.0...
- Installed hashicorp/template v2.2.0 (signed by HashiCorp)
- Installing hashicorp/random v3.1.0...
- Installed hashicorp/random v3.1.0 (signed by HashiCorp)

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key: https://keybase.io/hashicorp

Debug Output

Not able to gather, running on server, not local.

Panic Output

Stack trace from the terraform-provider-aws_v3.64.2_x5 plugin:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x670df6f]
goroutine 173 [running]:
github.com/hashicorp/terraform-provider-aws/internal/service/s3.flattenBucketReplicationConfiguration(0xc0025b3720, 0x0, 0x0, 0xe7058b0)
	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-aws/internal/service/s3/bucket.go:2429 +0x120f
github.com/hashicorp/terraform-provider-aws/internal/service/s3.resourceBucketRead(0xc001e29700, 0x7d31ac0, 0xc001c72000, 0xe705f80, 0xc00008a400)
	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-aws/internal/service/s3/bucket.go:1274 +0x339d
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0xc0005ad7a0, 0x9e4d828, 0xc001ea8900, 0xc001e29700, 0x7d31ac0, 0xc001c72000, 0x0, 0x0, 0x0)
	/opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/gdavison/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:335 +0x1ee
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).RefreshWithoutUpgrade(0xc0005ad7a0, 0x9e4d828, 0xc001ea8900, 0xc0023bba40, 0x7d31ac0, 0xc001c72000, 0xc002251660, 0x0, 0x0, 0x0)
	/opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/gdavison/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:624 +0x1cb
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ReadResource(0xc00000d470, 0x9e4d828, 0xc001ea8900, 0xc001ea8940, 0xc001ea8900, 0x40b965, 0x893c560)
	/opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/gdavison/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:575 +0x43b
github.com/hashicorp/terraform-plugin-go/tfprotov5/server.(*server).ReadResource(0xc000be4800, 0x9e4d8d0, 0xc001ea8900, 0xc001eab4a0, 0xc000be4800, 0xc001eafad0, 0xc0014bfba0)
	/opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/[email protected]/tfprotov5/server/server.go:298 +0x105
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadResource_Handler(0x8cf9840, 0xc000be4800, 0x9e4d8d0, 0xc001eafad0, 0xc001eab440, 0x0, 0x9e4d8d0, 0xc001eafad0, 0xc001c95c00, 0x3a2)
	/opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:344 +0x214
google.golang.org/grpc.(*Server).processUnaryRPC(0xc00061efc0, 0x9e784b8, 0xc0014bc180, 0xc001e1ee00, 0xc0016944b0, 0xe6c3a90, 0x0, 0x0, 0x0)
	/opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/google.golang.org/[email protected]/server.go:1194 +0x52b
google.golang.org/grpc.(*Server).handleStream(0xc00061efc0, 0x9e784b8, 0xc0014bc180, 0xc001e1ee00, 0x0)
	/opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/google.golang.org/[email protected]/server.go:1517 +0xd0c
google.golang.org/grpc.(*Server).serveStreams.func1.2(0xc000877a90, 0xc00061efc0, 0x9e784b8, 0xc0014bc180, 0xc001e1ee00)
	/opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/google.golang.org/[email protected]/server.go:859 +0xab
created by google.golang.org/grpc.(*Server).serveStreams.func1
	/opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/google.golang.org/[email protected]/server.go:857 +0x1fd
Error: The terraform-provider-aws_v3.64.2_x5 plugin crashed!
This is always indicative of a bug within the plugin. It would be immensely
helpful if you could report the crash with the plugin's maintainers so that it
can be fixed. The output above should help diagnose the issue.

Expected Behavior

No error

Actual Behavior

Cleaned output below

│ Error: Plugin did not respond
│ 
│   with module.abc.aws_iam_instance_profile.instance_profile,
│   on .terraform/modules/abc/main.tf line 46, in resource "aws_iam_instance_profile" "instance_profile":
│   46: resource "aws_iam_instance_profile" "instance_profile" {
│ 
│ The plugin encountered an error, and failed to respond to the
│ plugin.(*GRPCProvider).ReadResource call. The plugin logs may contain more
│ details.

There are more of these, but I would need to clean them if they would prove useful.

Steps to Reproduce

  1. terraform plan

Important Factoids

References

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic. labels Nov 9, 2021
@justinretzolk
Copy link
Member

Hey @1FastSTi 👋 Thank you for taking the time to file this issue. So that we have all of the necessary information in order to investigate this, can you update the issue description with the information found in the bug report template?

@justinretzolk justinretzolk added waiting-response Maintainers are waiting on response from community or contributor. and removed needs-triage Waiting for first response or review from a maintainer. labels Nov 10, 2021
@1FastSTi
Copy link
Author

1FastSTi commented Nov 10, 2021

I'm not sure what else I can give out. Please let me know what more is needed. More details might be able to be provided during my normal business hours.

@github-actions github-actions bot removed the waiting-response Maintainers are waiting on response from community or contributor. label Nov 10, 2021
@ewbankkit ewbankkit added the service/s3 Issues and PRs that pertain to the s3 service. label Nov 10, 2021
@ewbankkit
Copy link
Contributor

if v.Destination.Metrics != nil {
metrics := map[string]interface{}{
"minutes": int(aws.Int64Value(v.Destination.Metrics.EventThreshold.Minutes)),

Relates: #21176.

@1FastSTi
Copy link
Author

I was able to set this and get it to plan without crashing:

terraform {
  required_version = ">= 1.0"
  required_providers {
    aws = {
      source = "hashicorp/aws"
      version = "3.63.0"
    }
    vault = {
      source = "hashicorp/vault"
    }
  }
}

@NathanFRuiz
Copy link

NathanFRuiz commented Nov 10, 2021

got the exact same error, when checking form previous commits, I found out the error started exactly when provider version changed from 3.63.0 to 3.64.2, however i can't set it back as i get this:

Could not retrieve the list of available versions for provider hashicorp/aws: no available releases match the given constraints >= 2.23.0, >= 2.42.0, >= 2.49.0, >= 2.70.0, >= 3.0.0, >= 3.1.0, >= 3.26.0, 3.63.0, >= 3.64.0

@Limess
Copy link
Contributor

Limess commented Nov 23, 2021

We have the same error, fails with 3.64.0, succeeds with 3.63.0

@Limess
Copy link
Contributor

Limess commented Dec 14, 2021

I believe this was fixed in #2190 and released in 3.68.0

We no longer see the error.

@anGie44
Copy link
Contributor

anGie44 commented Feb 6, 2022

Hi @1FastSTi , this happened to be fixed as part of #21901 (perhaps the PR @Limess intended to link to?) which was released in v3.68.0 of the provider. Reach out if you experience any related issues after an upgrade!

@anGie44 anGie44 closed this as completed Feb 6, 2022
@github-actions
Copy link

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic. service/s3 Issues and PRs that pertain to the s3 service.
Projects
None yet
Development

No branches or pull requests

6 participants