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

[Bug]: aws_resourceexplorer2_search panic #36720

Closed
Rickerd0613 opened this issue Apr 3, 2024 · 5 comments · Fixed by #36778
Closed

[Bug]: aws_resourceexplorer2_search panic #36720

Rickerd0613 opened this issue Apr 3, 2024 · 5 comments · Fixed by #36778
Labels
bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic. service/resourceexplorer2 Issues and PRs that pertain to the resourceexplorer2 service.
Milestone

Comments

@Rickerd0613
Copy link

Terraform Core Version

1.5.2

AWS Provider Version

5.43.0

Affected Resource(s)

data aws_resourceexplorer2_search

Expected Behavior

Search results from AWS Resource Explorer are returned.

Actual Behavior

The provider crashes

Relevant Error/Panic Output Snippet

╷
│ Error: Plugin did not respond
│ 
│   with data.aws_resourceexplorer2_search.this,
│   on main.tf line 17, in data "aws_resourceexplorer2_search" "this":
│   17: data "aws_resourceexplorer2_search" "this" {
│ 
│ 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_v5.43.0_x5 plugin:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x30 pc=0x104a71acc]

goroutine 36 [running]:
github.com/hashicorp/terraform-plugin-framework/types/basetypes.ListValue.ToTerraformValue({{0x0, 0x0, 0x0}, {0x0, 0x0}, 0x0}, {0x115da85c8, 0x14002a50b70})
        github.com/hashicorp/terraform-plugin-framework@v1.7.0/types/basetypes/list_value.go:208 +0x5c
github.com/hashicorp/terraform-plugin-framework/internal/reflect.FromAttributeValue({0x115da85c8, 0x14002a50b70}, {0x115dca670, 0x14001c47a90}, {0x115dca628?, 0x14002cc3ce0?}, {{0x14002cbf360?, 0x0?, 0x14002a61268?}})
        github.com/hashicorp/terraform-plugin-framework@v1.7.0/internal/reflect/interfaces.go:338 +0xfc
github.com/hashicorp/terraform-plugin-framework/internal/reflect.FromValue({0x115da85c8, 0x14002a50b70}, {0x115dca670?, 0x14001c47a90}, {0x11588e600, 0x14002cc3ce0?}, {{0x14002cbf360?, 0x115da85c8?, 0x14002a5a090?}})
        github.com/hashicorp/terraform-plugin-framework@v1.7.0/internal/reflect/outof.go:26 +0x7f8
github.com/hashicorp/terraform-plugin-framework/internal/reflect.FromStruct({0x115da85c8, 0x14002a50b70}, {0x149d2aeb8?, 0x14002cc53b0}, {0x115627ac0?, 0x14002cc3c80?, 0x14002a616c8?}, {{0x14001c47ab0?, 0xc0?, 0x14003e98480?}})
        github.com/hashicorp/terraform-plugin-framework@v1.7.0/internal/reflect/struct.go:217 +0x968
github.com/hashicorp/terraform-plugin-framework/internal/reflect.FromValue({0x115da85c8, 0x14002a50b70}, {0x115dca478?, 0x14002cc53b0}, {0x115627ac0, 0x14002cc3c80?}, {{0x14001c47ab0?, 0x104a75e68?, 0x28?}})
        github.com/hashicorp/terraform-plugin-framework@v1.7.0/internal/reflect/outof.go:57 +0x678
github.com/hashicorp/terraform-plugin-framework/internal/reflect.FromPointer({0x115da85c8, 0x14002a50b70}, {0x115dca478?, 0x14002cc53b0?}, {0x112f892a0?, 0x14000e29c80?, 0x14002a618e8?}, {{0x14001c47ab0?, 0x30?, 0x14003e98480?}})
        github.com/hashicorp/terraform-plugin-framework@v1.7.0/internal/reflect/pointer.go:118 +0x198
github.com/hashicorp/terraform-plugin-framework/internal/reflect.FromValue({0x115da85c8, 0x14002a50b70}, {0x115dca478?, 0x14002cc53b0}, {0x112f892a0, 0x14000e29c80?}, {{0x14001c47ab0?, 0x0?, 0x14002a61a28?}})
        github.com/hashicorp/terraform-plugin-framework@v1.7.0/internal/reflect/outof.go:85 +0x4d0
github.com/hashicorp/terraform-plugin-framework/internal/reflect.FromSlice({0x115da85c8, 0x14002a50b70}, {0x115dbdf98, 0x14001c47aa0?}, {0x1130069c0?, 0x14002151350?, 0x1129d4377?}, {{0x11dfb76a0?, 0x14002a61d28?, 0x1045428b4?}})
        github.com/hashicorp/terraform-plugin-framework@v1.7.0/internal/reflect/slice.go:223 +0x11f4
github.com/hashicorp/terraform-plugin-framework/internal/reflect.FromValue({0x115da85c8, 0x14002a50b70}, {0x115dbdf98?, 0x14001c47aa0}, {0x1130069c0, 0x14002151350?}, {{0x11dfb76a0?, 0x0?, 0x0?}})
        github.com/hashicorp/terraform-plugin-framework@v1.7.0/internal/reflect/outof.go:71 +0x508
github.com/hashicorp/terraform-plugin-framework/types/basetypes.NewListValueFrom({0x115da85c8, 0x14002a50b70}, {0x115dca478, 0x14002cc53b0}, {0x1130069c0, 0x14002151350})
        github.com/hashicorp/terraform-plugin-framework@v1.7.0/types/basetypes/list_value.go:100 +0x94
github.com/hashicorp/terraform-provider-aws/internal/framework/types.newListNestedObjectValueOf[...]({0x115da85c8, 0x14002a50b70}, {0x1130069c0, 0x14002151350})
        github.com/hashicorp/terraform-provider-aws/internal/framework/types/list_nested_objectof.go:262 +0xe0
github.com/hashicorp/terraform-provider-aws/internal/framework/types.NewListNestedObjectValueOfSlice[...](...)
        github.com/hashicorp/terraform-provider-aws/internal/framework/types/list_nested_objectof.go:238
github.com/hashicorp/terraform-provider-aws/internal/framework/types.listNestedObjectTypeOf[...].ValueFromObjectSlice(0x115e45c20?, {0x115da85c8?, 0x14002a50b70}, {0x1130069c0, 0x140021444e0})
        github.com/hashicorp/terraform-provider-aws/internal/framework/types/list_nested_objectof.go:130 +0xac
github.com/hashicorp/terraform-provider-aws/internal/framework/flex.autoFlattener.sliceOfStructNestedObjectCollection({}, {0x115da85c8, 0x14002a50b70}, {0x1131233e0?, 0x14001913fd0?, 0x14002a62468?}, {0x149d2acc0, 0x14001c46f80}, {0x11588e760?, 0x14002a1e240?, ...})
        github.com/hashicorp/terraform-provider-aws/internal/framework/flex/auto_flatten.go:784 +0x4e4
github.com/hashicorp/terraform-provider-aws/internal/framework/flex.autoFlattener.slice({}, {0x115da85c8, 0x14002a50b70}, {0x1131233e0?, 0x14001913fd0?, 0x115e31ea8?}, {0x115dca550?, 0x14001c46f80}, {0x11588e760?, 0x14002a1e240?, ...})
        github.com/hashicorp/terraform-provider-aws/internal/framework/flex/auto_flatten.go:498 +0x9a4
github.com/hashicorp/terraform-provider-aws/internal/framework/flex.autoFlattener.convert({}, {0x115da85c8, 0x14002a50b70}, {0x1131233e0?, 0x14001913fd0?, 0x14000694eb0?}, {0x11588e760?, 0x14002a1e240?, 0x1051bf390?})
        github.com/hashicorp/terraform-provider-aws/internal/framework/flex/auto_flatten.go:82 +0x2bc
github.com/hashicorp/terraform-provider-aws/internal/framework/flex.autoFlexConvertStruct({0x115da85c8, 0x14002a50b70}, {0x1155fd0e0?, 0x14001913fc0?}, {0x112f89320?, 0x14002a1e210?}, {0x115c1b0c0, 0x11dfb76a0})
        github.com/hashicorp/terraform-provider-aws/internal/framework/flex/autoflex.go:110 +0x2c4
github.com/hashicorp/terraform-provider-aws/internal/framework/flex.autoFlexConvert({0x115da85c8, 0x14002a50b70}, {0x1155fd0e0, 0x14001913fc0}, {0x112f89320, 0x14002a1e210}, {0x115c1b0c0?, 0x11dfb76a0?})
        github.com/hashicorp/terraform-provider-aws/internal/framework/flex/autoflex.go:48 +0x1c8
github.com/hashicorp/terraform-provider-aws/internal/framework/flex.Flatten({0x115da85c8, 0x14002a50b70}, {0x1155fd0e0?, 0x14001913fc0?}, {0x112f89320?, 0x14002a1e210}, {0x0, 0x0, 0x112f89320?})
        github.com/hashicorp/terraform-provider-aws/internal/framework/flex/auto_flatten.go:38 +0xbc
github.com/hashicorp/terraform-provider-aws/internal/service/resourceexplorer2.(*dataSourceSearch).Read(0x115da85c8?, {0x115da85c8, 0x14002a50b70}, {{{{0x115de1b50, 0x14002a50510}, {0x113e1eea0, 0x14002a05f20}}, {0x115df34e0, 0x14003910cc0}}, {{{0x0, ...}, ...}, ...}}, ...)
        github.com/hashicorp/terraform-provider-aws/internal/service/resourceexplorer2/search_data_source.go:148 +0x43c
github.com/hashicorp/terraform-provider-aws/internal/provider/fwprovider.(*wrappedDataSource).Read(0x14004e90400, {0x115da85c8?, 0x14002a05080?}, {{{{0x115de1b50, 0x14002a50510}, {0x113e1eea0, 0x14002a05f20}}, {0x115df34e0, 0x14003910cc0}}, {{{0x0, ...}, ...}, ...}}, ...)
        github.com/hashicorp/terraform-provider-aws/internal/provider/fwprovider/intercept.go:174 +0x100
github.com/hashicorp/terraform-plugin-framework/internal/fwserver.(*Server).ReadDataSource(0x140039124e0, {0x115da85c8, 0x14002a05080}, 0x14002a05110, 0x14002a63608)
        github.com/hashicorp/terraform-plugin-framework@v1.7.0/internal/fwserver/server_readdatasource.go:79 +0x394
github.com/hashicorp/terraform-plugin-framework/internal/proto5server.(*Server).ReadDataSource(0x140039124e0, {0x115da85c8?, 0x14002a04f60?}, 0x14002a140c0)
        github.com/hashicorp/terraform-plugin-framework@v1.7.0/internal/proto5server/server_readdatasource.go:55 +0x31c
github.com/hashicorp/terraform-plugin-mux/tf5muxserver.(*muxServer).ReadDataSource(0x115da8600?, {0x115da85c8?, 0x14002a04c60?}, 0x14002a140c0)
        github.com/hashicorp/terraform-plugin-mux@v0.15.0/tf5muxserver/mux_server_ReadDataSource.go:36 +0x18c
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ReadDataSource(0x14000978960, {0x115da85c8?, 0x14002a04270?}, 0x14004e80140)
        github.com/hashicorp/terraform-plugin-go@v0.22.1/tfprotov5/tf5server/server.go:686 +0x344
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadDataSource_Handler({0x1159119a0?, 0x14000978960}, {0x115da85c8, 0x14002a04270}, 0x1400050c000, 0x0)
        github.com/hashicorp/terraform-plugin-go@v0.22.1/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:572 +0x164
google.golang.org/grpc.(*Server).processUnaryRPC(0x14001734000, {0x115da85c8, 0x14002a041e0}, {0x115de45b8, 0x14003913ba0}, 0x14002a0e000, 0x140038d1f80, 0x11df5e460, 0x0)
        google.golang.org/grpc@v1.62.1/server.go:1386 +0xba0
google.golang.org/grpc.(*Server).handleStream(0x14001734000, {0x115de45b8, 0x14003913ba0}, 0x14002a0e000)
        google.golang.org/grpc@v1.62.1/server.go:1797 +0xc70
google.golang.org/grpc.(*Server).serveStreams.func2.1()
        google.golang.org/grpc@v1.62.1/server.go:1027 +0x8c
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 50
        google.golang.org/grpc@v1.62.1/server.go:1038 +0x150

Error: The terraform-provider-aws_v5.43.0_x5 plugin crashed!

Terraform Configuration Files

terraform {

  required_version = ">= 1.5"

  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 5.0"
    }
  }
}

provider "aws" {
  region  = "us-east-1"
}

data "aws_resourceexplorer2_search" "this" {
  query_string = "test"
  view_arn = "redacted_arn"
}

output "test" {
  value = data.aws_resourceexplorer2_search.this
}

Steps to Reproduce

Attempt to use the data "aws_resourceexplorer2_search" resource by specifying a query and view_arn.

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

@Rickerd0613 Rickerd0613 added the bug Addresses a defect in current functionality. label Apr 3, 2024
@github-actions github-actions bot added crash Results from or addresses a Terraform crash or kernel panic. service/resourceexplorer2 Issues and PRs that pertain to the resourceexplorer2 service. labels Apr 3, 2024
Copy link

github-actions bot commented Apr 3, 2024

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • 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.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Apr 3, 2024
@acwwat
Copy link
Contributor

acwwat commented Apr 4, 2024

This seems to be related to how there is a mismatch between the AWS API type and Terraform schema for the Property attribute. If I renamed ResourceProperty/resource_property to Property/property then flex.Flatten() would work. This likely needs to be fixed alongside other issues mentioned in #36721.

Copy link

github-actions bot commented May 9, 2024

Warning

This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them.

Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.

@github-actions github-actions bot added this to the v5.49.0 milestone May 9, 2024
Copy link

This functionality has been released in v5.49.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

Copy link

github-actions bot commented Jun 9, 2024

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 9, 2024
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/resourceexplorer2 Issues and PRs that pertain to the resourceexplorer2 service.
Projects
None yet
3 participants