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

aws_lakeformation_permissions plugin crashes with transport error in 0.15.4 #19518

Closed
varadhvi opened this issue May 25, 2021 · 5 comments
Closed
Labels
bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic. service/lakeformation Issues and PRs that pertain to the lakeformation service.

Comments

@varadhvi
Copy link

Attempting to run aws_lakeformation_permissions plugin in order to provide access to a role for a database through Lakeformation

data "aws_lakeformation_permissions" "test" {
  principal =  "arn:aws:iam::${var.account_id}:role/${var.aws_iam_readonly_role}"
  database {
    name       =  "sampledb"
    catalog_id =  var.account_id
  }
}

Output

terraform apply
╷
│ Error: Plugin did not respond
│ 
│   with data.aws_lakeformation_permissions.test,
│   on consumer_access.tf line 32, in data "aws_lakeformation_permissions" "test":
│   32: data "aws_lakeformation_permissions" "test" {
│ 
│ 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.42.0_x5 plugin:

panic: runtime error: index out of range [0] with length 0

goroutine 107 [running]:
github.com/terraform-providers/terraform-provider-aws/aws.dataSourceAwsLakeFormationPermissionsRead(0xc00096e580, 0x6c6f040, 0xc00272a600, 0xbb4acf0, 0xc000701b00)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-aws/aws/data_source_aws_lakeformation_permissions.go:289 +0x210c
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0xc00047a1c0, 0x84ff548, 0xc000977ac0, 0xc00096e580, 0x6c6f040, 0xc00272a600, 0x0, 0x0, 0x0)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:335 +0x1ee
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).ReadDataApply(0xc00047a1c0, 0x84ff548, 0xc000977ac0, 0xc001f93c80, 0x6c6f040, 0xc00272a600, 0xc00272a600, 0xc001f93c80, 0x0, 0x0)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:558 +0xfd
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ReadDataSource(0xc00011ef18, 0x84ff548, 0xc000977ac0, 0xc001f939e0, 0xc000977ac0, 0x100b665, 0x7532c60)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:1105 +0x4d6
github.com/hashicorp/terraform-plugin-go/tfprotov5/server.(*server).ReadDataSource(0xc00209cda0, 0x84ff5f0, 0xc000977ac0, 0xc0007bea50, 0xc00209cda0, 0xc0022bea80, 0xc0027c1ba0)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/[email protected]/tfprotov5/server/server.go:247 +0xe5
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadDataSource_Handler(0x77ee4a0, 0xc00209cda0, 0x84ff5f0, 0xc0022bea80, 0xc00194a960, 0x0, 0x84ff5f0, 0xc0022bea80, 0xc00097c000, 0x127)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:416 +0x214
google.golang.org/grpc.(*Server).processUnaryRPC(0xc00023d500, 0x85203f8, 0xc001507b00, 0xc000924d00, 0xc000891890, 0xbb0a4f0, 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(0xc00023d500, 0x85203f8, 0xc001507b00, 0xc000924d00, 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(0xc00156a930, 0xc00023d500, 0x85203f8, 0xc001507b00, 0xc000924d00)
        /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.42.0_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.
@ghost ghost added the service/lakeformation Issues and PRs that pertain to the lakeformation service. label May 25, 2021
@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 May 25, 2021
@ewbankkit
Copy link
Contributor

ewbankkit commented May 25, 2021

Relevant code:

d.Set("principal", cleanPermissions[0].Principal.DataLakePrincipalIdentifier)

Related:

@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label May 25, 2021
@varadhvi
Copy link
Author

any update on this please @ewbankkit ?

@jackbatzner
Copy link
Contributor

Can you try out v 3.39 of the provider and see if this is resolved @varadhvi ?

@justinretzolk
Copy link
Member

Hey @varadhvi 👋 It looks like this was resolved in AWS Provider version 3.39.0. Given that's the case, I'll mark this issue as resolved. If you feel I've done this in error, please do let me know.

@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 Jun 24, 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/lakeformation Issues and PRs that pertain to the lakeformation service.
Projects
None yet
Development

No branches or pull requests

4 participants