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]: Tf 5.0.0 crashes at apply step. #31586

Closed
kylet21 opened this issue May 25, 2023 · 8 comments · Fixed by #31587
Closed

[Bug]: Tf 5.0.0 crashes at apply step. #31586

kylet21 opened this issue May 25, 2023 · 8 comments · Fixed by #31587
Labels
bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic. tags Pertains to resource tagging.
Milestone

Comments

@kylet21
Copy link

kylet21 commented May 25, 2023

Terraform Core Version

1.3.1

AWS Provider Version

5.0.0

Affected Resource(s)

Can not run an apply to add an application's dependent resources. This application has many different resources that need to be created and are interdependent.

Expected Behavior

Successful apply of changes

Actual Behavior

Crashes after a successful plan at the apply stage.

Relevant Error/Panic Output Snippet

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

panic: value is null

goroutine 5267 [running]:
github.com/hashicorp/go-cty/cty.Value.AsString({{{0xf099650?, 0xc0003e2301?}}, {0x0?, 0x0?}})
github.com/hashicorp/go-cty@v1.4.1-0.20200414143053-d3edf31b6320/cty/value_ops.go:1176 +0x125
github.com/hashicorp/terraform-provider-aws/internal/tags.KeyValueTags.ResolveDuplicates(0xc004fa7204?, {0xf098620, 0xc007c9f380}, 0x0, 0xc00045ac00?, {0x7fafe1fc87c0, 0xc005f89c00})
github.com/hashicorp/terraform-provider-aws/internal/tags/key_value_tags.go:783 +0x649
github.com/hashicorp/terraform-provider-aws/internal/provider.tagsInterceptor.run({0xc00031c900?, 0xde5c750?, 0xde5c748?}, {0xf098620, 0xc007c9f380}, {0xf0a7648, 0xc005f89c00}, {0xdb852a0?, 0xc00045ac00?}, 0x2, ...)
github.com/hashicorp/terraform-provider-aws/internal/provider/intercept.go:350 +0x99e
github.com/hashicorp/terraform-provider-aws/internal/provider.interceptedHandler[...].func1(0x0?, {0xdb852a0?, 0xc00045ac00?})
github.com/hashicorp/terraform-provider-aws/internal/provider/intercept.go:117 +0x343
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0xf098620?, {0xf098620?, 0xc007c86e40?}, 0xd?, {0xdb852a0?, 0xc00045ac00?})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.26.1/helper/schema/resource.go:702 +0x84
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc000ace460, {0xf098620, 0xc007c86e40}, 0xc0071e9e10, 0xc005f89a00, {0xdb852a0, 0xc00045ac00})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.26.1/helper/schema/resource.go:837 +0xa85
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc002a06c60, {0xf098620?, 0xc007c86d20?}, 0xc00743e960)
github.com/hashicorp/terraform-plugin-sdk/v2@v2.26.1/helper/schema/grpc_provider.go:1021 +0xe8d
github.com/hashicorp/terraform-plugin-mux/tf5muxserver.muxServer.ApplyResourceChange({0xc004341b90, 0xc004341bf0, {0xc00664a3e0, 0x2, 0x2}, {0x0, 0x0, 0x0}, {0x0, 0x0, ...}, ...}, ...)
github.com/hashicorp/terraform-plugin-mux@v0.10.0/tf5muxserver/mux_server_ApplyResourceChange.go:27 +0x102
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc002e30320, {0xf098620?, 0xc007c861e0?}, 0xc0018b8a10)
github.com/hashicorp/terraform-plugin-go@v0.15.0/tfprotov5/tf5server/server.go:818 +0x574
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0xd8701e0?, 0xc002e30320}, {0xf098620, 0xc007c861e0}, 0xc0018b8930, 0x0)
github.com/hashicorp/terraform-plugin-go@v0.15.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:419 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc006710000, {0xf0a8e60, 0xc006718b60}, 0xc00746d0e0, 0xc0067142a0, 0x15cf3500, 0x0)
google.golang.org/grpc@v1.54.0/server.go:1345 +0xdf0
google.golang.org/grpc.(*Server).handleStream(0xc006710000, {0xf0a8e60, 0xc006718b60}, 0xc00746d0e0, 0x0)
google.golang.org/grpc@v1.54.0/server.go:1722 +0xa2f
google.golang.org/grpc.(*Server).serveStreams.func1.2()
google.golang.org/grpc@v1.54.0/server.go:966 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
google.golang.org/grpc@v1.54.0/server.go:964 +0x28a

Error: The terraform-provider-aws_v5.0.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.

Terraform Configuration Files

Adding an extra item to a map that is iterated over using for_each. Copies of the resources already exist and the apply runs fine if not adding the new map item.

Steps to Reproduce

Run apply after adding new item to a map that is iterated over using for_each

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

@kylet21 kylet21 added bug Addresses a defect in current functionality. needs-triage Waiting for first response or review from a maintainer. labels May 25, 2023
@github-actions
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 the crash Results from or addresses a Terraform crash or kernel panic. label May 25, 2023
@kylet21 kylet21 changed the title [Bug]: [Bug]: Tf 5.0.0 crashes at apply step. May 25, 2023
@sujeets-toast
Copy link

sujeets-toast commented May 26, 2023

@kylet21 kylet21 Because I was using the provider ">= 4.0," I experienced the same problem, and it required the newest Terraform AWS provider, "5.0.0," which was made available yesterday. The earlier version is now "4.60.0" after an update. It's operating now.

@Riinkesh
Copy link

We're facing the same problem with aws provider version set to "~> 4.0". The latest aws provider version 5.0.0 which was updated yesterday is probably causing this.

@jcmcken
Copy link

jcmcken commented May 26, 2023

We're having the same issue. Seems to be some problem in the latest release when upgrading from 4 to 5. It also doesn't seem to let you downgrade back to 4 because the state is altered in some backwards incompatible way

@kylet21
Copy link
Author

kylet21 commented May 26, 2023

@jcmcken same dilemma here, i forgot to add that. It won't allow me to rollback to < 5.0.0 because it says some resources were created with the new provider version.

@johnsonaj
Copy link
Contributor

@kylet21 Thanks for the bug report. We are currently working on a fix for this issue

@github-actions github-actions bot removed the needs-triage Waiting for first response or review from a maintainer. label May 26, 2023
@github-actions github-actions bot added this to the v5.0.1 milestone May 26, 2023
@johnsonaj johnsonaj added the tags Pertains to resource tagging. label May 26, 2023
@github-actions
Copy link

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

@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 26, 2023
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. tags Pertains to resource tagging.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants