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]: Can not update the state to the most recent provider version #35256

Closed
speller opened this issue Jan 12, 2024 · 4 comments · Fixed by #35265
Closed

[Bug]: Can not update the state to the most recent provider version #35256

speller opened this issue Jan 12, 2024 · 4 comments · Fixed by #35265
Assignees
Labels
bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/mq Issues and PRs that pertain to the mq service.
Milestone

Comments

@speller
Copy link
Contributor

speller commented Jan 12, 2024

Terraform Core Version

1.5.0

AWS Provider Version

5.32.0

Affected Resource(s)

I have a running infrastructure created with the AWS provider version 4.67.0. When I try to use the version 5.32.0, TF fails.

Expected Behavior

The state is successfully upgraded.

Actual Behavior

Multiple errors:

╷
│ Warning: Failed to decode resource from state
│ 
│ Error decoding "module.**.aws_db_instance.app-db[0]" from prior
│ state: unsupported attribute "name"
╵
╷
│ Warning: Failed to decode resource from state
│ 
│ Error decoding
│ "module.**.module.instance.aws_autoscaling_group.service" from
│ prior state: unsupported attribute "tags"
╵
╷
│ Warning: Failed to decode resource from state
│ 
│ Error decoding
│ "module.**.module.graphql.aws_autoscaling_group.service" from
│ prior state: unsupported attribute "tags"
╵
╷
│ Warning: Failed to decode resource from state
│ 
│ Error decoding "module.redis.aws_elasticache_cluster.redis[0]" from prior
│ state: unsupported attribute "security_group_names"
╵
╷
│ Warning: Failed to decode resource from state
│ 
│ Error decoding "module.**.aws_db_instance.app-db[0]" from prior
│ state: unsupported attribute "name"
╵
╷
│ Warning: Failed to decode resource from state
│ 
│ Error decoding
│ "module.**.module.mailhog.aws_iam_role.ec2-role" from prior
│ state: unsupported attribute "role_last_used"
╵
╷
│ Error: Request cancelled
│ 
│   with module.***.module.frontend.aws_iam_policy.ec2-role-policy,
│   on .terraform/modules/***.frontend/main.tf line 148, in resource "aws_iam_policy" "ec2-role-policy":
│  148: resource "aws_iam_policy" "ec2-role-policy" {
│ 
│ The plugin.(*GRPCProvider).ReadResource request was cancelled.
╵
╷
│ Error: Request cancelled
│ 
│   with module.***.module.frontend.aws_security_group.security-group,
│   on .terraform/modules/***.frontend/main.tf line 166, in resource "aws_security_group" "security-group":
│  166: resource "aws_security_group" "security-group" {
│ 
│ The plugin.(*GRPCProvider).UpgradeResourceState request was cancelled.
╵
Stack trace from the terraform-provider-aws_v5.32.0_x5 plugin:
panic: interface conversion: interface {} is *schema.Set, not []string
goroutine 2106 [running]:
github.com/hashicorp/terraform-provider-aws/internal/service/mq.resourceUserHash({0xd4f9120?, 0xc002720f90})
	github.com/hashicorp/terraform-provider-aws/internal/service/mq/broker.go:749 +0x325
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Set).hash(0xc0028ebe48?, {0xd4f9120?, 0xc002720f90?})
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/set.go:221 +0x2c
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Set).add(0xc002a5e2c0, {0xd4f9120?, 0xc002720f90}, 0x0)
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/set.go:201 +0x96
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*ConfigFieldReader).readSet(0xc002720d20, {0xc00259a5d0, 0x1, 0x1}, 0x0?)
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/field_reader_config.go:287 +0x3a8
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*ConfigFieldReader).readField(0xc002720d20, {0xc00259a5d0?, 0x1, 0x1}, 0x0)
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/field_reader_config.go:110 +0x4bc
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*ConfigFieldReader).ReadField(0xd4f8160?, {0xc00259a5d0?, 0xf00f76f?, 0x6?})
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/field_reader_config.go:32 +0xbc
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*MultiLevelFieldReader).ReadFieldExact(0xc00259a5c0?, {0xc00259a5d0, 0x1, 0x1}, {0xf00f76f, 0x6})
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/field_reader_multi.go:34 +0xa8
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*ResourceData).get(0xc000c48700, {0xc00259a5d0, 0x1, 0x1}, 0x0?)
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource_data.go:551 +0x145
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*ResourceData).getChange(0x10621d20?, {0xf00be68?, 0x4?}, 0x15?, 0x0?)
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource_data.go:527 +0x1b8
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*ResourceData).diffChange(0x10?, {0xf00be68?, 0x413cb5?})
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource_data.go:504 +0x76
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.schemaMap.diffSet(0xf017a60?, {0x105df7a0, 0xc001d7ad20}, {0xf00be68, 0x4}, 0xc0018a6a00, 0xc0028ecbc8, {0x105ed290?, 0xc000c48700?}, 0x0)
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/schema.go:1412 +0x90
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.schemaMap.diff(0x6?, {0x105df7a0, 0xc001d7ad20}, {0xf00be68, 0x4}, 0xc0018a6a00, 0xc000c48680, {0x105ed290?, 0xc000c48700}, 0x0)
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/schema.go:1134 +0x265
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.schemaMap.Diff(0xc00188e930, {0x105df7a0, 0xc001d7ad20}, 0xc001eac4e0, 0xc002f46000, 0xc0016178c0, {0xefb24a0, 0xc00017a300}, 0x0)
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/schema.go:678 +0x353
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).SimpleDiff(0x105e0e60?, {0x105df7a0?, 0xc001d7ad20?}, 0xc001eac4e0, 0xd4f9120?, {0xefb24a0?, 0xc00017a300?})
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:962 +0xe5
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).PlanResourceChange(0xc003167de8, {0x105df7a0?, 0xc001d7abd0?}, 0xc0035ceaf0)
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:794 +0xa09
github.com/hashicorp/terraform-plugin-mux/tf5muxserver.(*muxServer).PlanResourceChange(0xc0009aa3f0, {0x105df7a0?, 0xc001d7a8a0?}, 0xc0035ceaf0)
	github.com/hashicorp/[email protected]/tf5muxserver/mux_server_PlanResourceChange.go:73 +0x2d4
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).PlanResourceChange(0xc00072e780, {0x105df7a0?, 0xc00380fd40?}, 0xc00024fab0)
	github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:824 +0x574
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_PlanResourceChange_Handler({0xed810e0?, 0xc00072e780}, {0x105df7a0, 0xc00380fd40}, 0xc0009dd900, 0x0)
	github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:485 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc00024c000, {0x105df7a0, 0xc00380fcb0}, {0x105f42c0, 0xc001a944e0}, 0xc00253f8c0, 0xc002402c60, 0x171d8540, 0x0)
	google.golang.org/[email protected]/server.go:[1372](https://gitlab.com/rhdjapan/code/mage2-deployment/-/jobs/5915899771#L1372) +0xe49
google.golang.org/grpc.(*Server).handleStream(0xc00024c000, {0x105f42c0, 0xc001a944e0}, 0xc00253f8c0)
	google.golang.org/[email protected]/server.go:1783 +0x1031
google.golang.org/grpc.(*Server).serveStreams.func2.1()
	google.golang.org/[email protected]/server.go:1016 +0x68
created by google.golang.org/grpc.(*Server).serveStreams.func2
	google.golang.org/[email protected]/server.go:1027 +0x12e
Error: The terraform-provider-aws_v5.32.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.

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

I'm not using the name attribute in aws_db_instance resources. But the error claims that it is in use.
The role_last_used attribute is never used.
The security_group_names is never used in configurations.

Steps to Reproduce

  • Apply with v4.67.0
  • Apply with v5.32.0

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

@speller speller added the bug Addresses a defect in current functionality. label Jan 12, 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.

@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Jan 12, 2024
@github-actions github-actions bot added crash Results from or addresses a Terraform crash or kernel panic. service/iam Issues and PRs that pertain to the iam service. service/vpc Issues and PRs that pertain to the vpc service. labels Jan 12, 2024
@ewbankkit ewbankkit added regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/mq Issues and PRs that pertain to the mq service. and removed service/iam Issues and PRs that pertain to the iam service. needs-triage Waiting for first response or review from a maintainer. service/vpc Issues and PRs that pertain to the vpc service. labels Jan 12, 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 Jan 12, 2024
@ewbankkit
Copy link
Contributor

Relates #35187.

Copy link

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

@justinretzolk justinretzolk added the bug Addresses a defect in current functionality. label Feb 10, 2024
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 Mar 12, 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. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/mq Issues and PRs that pertain to the mq service.
Projects
None yet
3 participants