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_elasticache_replication_group panics with runtime error: index out of range [0] with length 0 #37771

Closed
jouve opened this issue May 30, 2024 · 4 comments · Fixed by #38797
Assignees
Labels
bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic. service/elasticache Issues and PRs that pertain to the elasticache service.
Milestone

Comments

@jouve
Copy link

jouve commented May 30, 2024

Terraform Core Version

v1.8.4

AWS Provider Version

v5.49.0

Affected Resource(s)

│   with module.gitlab_ref_arch_aws.aws_elasticache_replication_group.gitlab_redis[0],
│   on ../../../modules/gitlab_ref_arch_aws/elasticache.tf line 55, in resource "aws_elasticache_replication_group" "gitlab_redis":
│   55: resource "aws_elasticache_replication_group" "gitlab_redis" {

Expected Behavior

no crash

Actual Behavior

it crash

Relevant Error/Panic Output Snippet

Stack trace from the terraform-provider-aws_v5.49.0_x5 plugin:

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

goroutine 380 [running]:
github.com/hashicorp/terraform-provider-aws/internal/service/elasticache.resourceReplicationGroupRead({0x1ca85a28, 0xc003504d80}, 0xc002e3b300, {0x1c829140?, 0xc002431d40?})
	github.com/hashicorp/terraform-provider-aws/internal/service/elasticache/replication_group.go:653 +0x1e25
github.com/hashicorp/terraform-provider-aws/internal/provider.New.(*wrappedResource).Read.interceptedHandler[...].func9(0xc002e3b300?, {0x1c829140?, 0xc002431d40})
	github.com/hashicorp/terraform-provider-aws/internal/provider/intercept.go:113 +0x283
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0x1ca85a28?, {0x1ca85a28?, 0xc0033dced0?}, 0xd?, {0x1c829140?, 0xc002431d40?})
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:790 +0x7a
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).RefreshWithoutUpgrade(0xc001641c00, {0x1ca85a28, 0xc0033dced0}, 0xc001234c30, {0x1c829140, 0xc002431d40})
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:1089 +0x529
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ReadResource(0xc003ff87f8, {0x1ca85a28?, 0xc0033dce10?}, 0xc002fbdbc0)
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:667 +0x4aa
github.com/hashicorp/terraform-plugin-mux/tf5muxserver.(*muxServer).ReadResource(0xc0016871f0, {0x1ca85a28?, 0xc0033dcb40?}, 0xc002fbdbc0)
	github.com/hashicorp/[email protected]/tf5muxserver/mux_server_ReadResource.go:35 +0x193
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ReadResource(0xc0006d1b80, {0x1ca85a28?, 0xc0033dc3c0?}, 0xc002ef47e0)
	github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:775 +0x4c3
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadResource_Handler({0x1c5e8f00, 0xc0006d1b80}, {0x1ca85a28, 0xc0033dc3c0}, 0xc002e3b080, 0x0)
	github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:482 +0x1a6
google.golang.org/grpc.(*Server).processUnaryRPC(0xc000ebe200, {0x1ca85a28, 0xc0033dc330}, {0x1cad0240, 0xc000548000}, 0xc001f158c0, 0xc0024d31d0, 0x256f9708, 0x0)
	google.golang.org/[email protected]/server.go:1369 +0xdf8
google.golang.org/grpc.(*Server).handleStream(0xc000ebe200, {0x1cad0240, 0xc000548000}, 0xc001f158c0)
	google.golang.org/[email protected]/server.go:1780 +0xe8b
google.golang.org/grpc.(*Server).serveStreams.func2.1()
	google.golang.org/[email protected]/server.go:1019 +0x8b
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 55
	google.golang.org/[email protected]/server.go:1030 +0x125

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

Terraform Configuration Files

configuration from https://gitlab.com/gitlab-org/gitlab-environment-toolkit

Steps to Reproduce

terraform apply was killed while creating the elasticache, subsequent terraform apply then crash

Debug Output

No response

Panic Output

No response

Important Factoids

if I try do delete the cluster in aws UI, I have the following error

All resources in replication group must be in a valid state for deletion in order to delete the replication group

References

No response

Would you like to implement a fix?

None

@jouve jouve added the bug Addresses a defect in current functionality. label May 30, 2024
Copy link

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.

@github-actions github-actions bot added crash Results from or addresses a Terraform crash or kernel panic. service/elasticache Issues and PRs that pertain to the elasticache service. labels May 30, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label May 30, 2024
@justinretzolk justinretzolk removed the needs-triage Waiting for first response or review from a maintainer. label May 30, 2024
@jar-b jar-b self-assigned this Aug 9, 2024
@terraform-aws-provider terraform-aws-provider bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Aug 9, 2024
Copy link

github-actions bot commented Aug 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.63.0 milestone Aug 9, 2024
@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Aug 15, 2024
Copy link

This functionality has been released in v5.63.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

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