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

data "aws_directory_service_directory" not working with aws_v3.37.0 Error: The terraform-provider-aws_v3.37.0_x5.exe plugin crashed! #19038

Closed
muthu329024 opened this issue Apr 21, 2021 · 4 comments
Labels
bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic.

Comments

@muthu329024
Copy link

Community Note

  • With latest AWS provider version: 3.37.0 getting error

Terraform CLI and Terraform AWS Provider Version

Affected Resource(s)

  • aws provider

Terraform Configuration Files

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

terraform {
  required_version                = ">= 0.15.0"
  required_providers {
    aws                           = { version = ">= 3.37.0" }
    random                        = { version = "~> 3.1.0"  }
  }
  backend "s3" { }
}

provider "aws" { region     = "ap-southeast-2" }
provider "random" { }

Debug Output

Panic Output

│ Error: Plugin did not respond

│ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ReadDataSource call. The plugin logs may contain more details.

Stack trace from the terraform-provider-aws_v3.37.0_x5.exe plugin:

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x18 pc=0x47111fc]

goroutine 196 [running]:
github.com/terraform-providers/terraform-provider-aws/aws.dataSourceAwsDirectoryServiceDirectoryRead(0xc001f3bf80, 0x6216980, 0xc00156a000, 0xc0017d5040, 0xc000045000)
/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-aws/aws/data_source_aws_directory_service_directory.go:188 +0xd7c
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0xc0001a6a80, 0x7a246c8, 0xc0017f0e80, 0xc001f3bf80, 0x6216980, 0xc00156a000, 0x0, 0x0, 0x0)
/opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.5.0/helper/schema/resource.go:335 +0x1fb
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).ReadDataApply(0xc0001a6a80, 0x7a246c8, 0xc0017f0e80, 0xc0017ab200, 0x6216980, 0xc00156a000, 0xc00156a000, 0xc0017ab200, 0x0, 0x0)
/opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.5.0/helper/schema/resource.go:558 +0x10d
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ReadDataSource(0xc000004eb8, 0x7a246c8, 0xc0017f0e80, 0xc0017aafc0, 0xc0017f0e80, 0x6bbeca, 0x6ab0840)
/opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.5.0/helper/schema/grpc_provider.go:1105 +0x4d9
github.com/hashicorp/terraform-plugin-go/tfprotov5/server.(*server).ReadDataSource(0xc0014b7820, 0x7a24770, 0xc0017f0e80, 0xc0017d2c30, 0xc0014b7820, 0xc0017f6b70, 0xc0013edba0)
/opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-go@v0.2.1/tfprotov5/server/server.go:247 +0xe5
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadDataSource_Handler(0x6d5dbc0, 0xc0014b7820, 0x7a24770, 0xc0017f6b70, 0xc0017d0fc0, 0x0, 0x7a24770, 0xc0017f6b70, 0xc0012680f0, 0xeb)
/opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-go@v0.2.1/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:416 +0x222
google.golang.org/grpc.(*Server).processUnaryRPC(0xc000379340, 0x7a45198, 0xc001a86180, 0xc001f1cd00, 0xc000fc8990, 0xaf1e5d0, 0x0, 0x0, 0x0)
/opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/google.golang.org/grpc@v1.32.0/server.go:1194 +0x52b
google.golang.org/grpc.(*Server).handleStream(0xc000379340, 0x7a45198, 0xc001a86180, 0xc001f1cd00, 0x0)
/opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/google.golang.org/grpc@v1.32.0/server.go:1517 +0xd0c
google.golang.org/grpc.(*Server).serveStreams.func1.2(0xc000aa8110, 0xc000379340, 0x7a45198, 0xc001a86180, 0xc001f1cd00)
/opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/google.golang.org/grpc@v1.32.0/server.go:859 +0xb2
created by google.golang.org/grpc.(*Server).serveStreams.func1
/opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/google.golang.org/grpc@v1.32.0/server.go:857 +0x1fd

Error: The terraform-provider-aws_v3.37.0_x5.exe 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

terraform plan should work .

Actual Behavior

getting below error
│ Error: Plugin did not respond

│ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ReadDataSource call. The plugin logs may contain more details.

Steps to Reproduce

  1. terraform init -backend-config tfvars/terraform_state.tfvars
  2. terraform plan -- Error

Important Factoids

References

  • #0000
@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 Apr 21, 2021
@muthu329024
Copy link
Author

I have commented out below resource ... It's working now

data "aws_directory_service_directory" "MicrosoftAD" {
 directory_id                    = var.directory_id
}

@muthu329024 muthu329024 changed the title Error: The terraform-provider-aws_v3.37.0_x5.exe plugin crashed! data "aws_directory_service_directory" not working with aws_v3.37.0 Error: The terraform-provider-aws_v3.37.0_x5.exe plugin crashed! Apr 21, 2021
@ewbankkit
Copy link
Contributor

var securityGroupId *string
if aws.StringValue(dir.Type) == directoryservice.DirectoryTypeAdconnector {
securityGroupId = dir.ConnectSettings.SecurityGroupId
} else {
securityGroupId = dir.VpcSettings.SecurityGroupId
}
d.Set("security_group_id", securityGroupId)

@ewbankkit
Copy link
Contributor

@muthu329024 Thanks for raising this issue.
It has already been noticed in #17168. I'm going to close this one as a duplicate so that we can concentrate discussion in the linked issue.
Please add any additional comments there.

@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Apr 21, 2021
@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 22, 2021
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.
Projects
None yet
Development

No branches or pull requests

2 participants