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

r/aws_mq_broker: Fix v5.32.0 regression panic interface conversion: interface {} is *schema.Set, not []string #35265

Merged
merged 4 commits into from
Jan 12, 2024

Conversation

ewbankkit
Copy link
Contributor

@ewbankkit ewbankkit commented Jan 12, 2024

Description

Fixes interface conversion: interface {} is *schema.Set, not []string in mq.resourceUserHash.

Relations

Closes #35256.
Closes #35262.
Closes #35266.
Relates #35187.

Output from Acceptance Testing

Prior to the fix:

% make testacc TESTARGS='-run=TestAccMQBroker_Update_users' PKG=mq
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/mq/... -v -count 1 -parallel 20  -run=TestAccMQBroker_Update_users -timeout 360m
=== RUN   TestAccMQBroker_Update_users
=== PAUSE TestAccMQBroker_Update_users
=== CONT  TestAccMQBroker_Update_users
panic: interface conversion: interface {} is *schema.Set, not []string

goroutine 892 [running]:
github.com/hashicorp/terraform-provider-aws/internal/service/mq.resourceUserHash({0xe26bac0?, 0xc001e2fef0})
	/Users/ewbankkit/altsrc.1/github.com/terraform-providers/terraform-provider-aws/internal/service/mq/broker.go:749 +0x325
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Set).hash(0xc002e63e48?, {0xe26bac0?, 0xc001e2fef0?})
	/Users/ewbankkit/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.31.0/helper/schema/set.go:221 +0x2c
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Set).add(0xc0036d6f00, {0xe26bac0?, 0xc001e2fef0}, 0x0)
	/Users/ewbankkit/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.31.0/helper/schema/set.go:201 +0x96
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*ConfigFieldReader).readSet(0xc001e2fb00, {0xc0036d9240, 0x1, 0x1}, 0x0?)
	/Users/ewbankkit/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.31.0/helper/schema/field_reader_config.go:287 +0x3a8
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*ConfigFieldReader).readField(0xc001e2fb00, {0xc0036d9240?, 0x1, 0x1}, 0x0)
	/Users/ewbankkit/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.31.0/helper/schema/field_reader_config.go:110 +0x4bc
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*ConfigFieldReader).ReadField(0xe26a920?, {0xc0036d9240?, 0xfdaa1ae?, 0x6?})
	/Users/ewbankkit/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.31.0/helper/schema/field_reader_config.go:32 +0xbc
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*MultiLevelFieldReader).ReadFieldExact(0xc0036d9230?, {0xc0036d9240, 0x1, 0x1}, {0xfdaa1ae, 0x6})
	/Users/ewbankkit/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.31.0/helper/schema/field_reader_multi.go:34 +0xa8
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*ResourceData).get(0xc000cd1d80, {0xc0036d9240, 0x1, 0x1}, 0x0?)
	/Users/ewbankkit/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.31.0/helper/schema/resource_data.go:551 +0x145
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*ResourceData).getChange(0xfe26e08?, {0xfda679a?, 0x4?}, 0x78?, 0x46?)
	/Users/ewbankkit/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.31.0/helper/schema/resource_data.go:527 +0x1b8
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*ResourceData).diffChange(0xc0036d91b0?, {0xfda679a?, 0xc000cd1d80?})
	/Users/ewbankkit/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.31.0/helper/schema/resource_data.go:504 +0x76
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.schemaMap.diffSet(0xc001e2f9e0?, {0x113ba5e0, 0xc001e21d10}, {0xfda679a, 0x4}, 0xc005be5cc0, 0xc002e64bc8, {0x113c8350?, 0xc000cd1d80?}, 0x0)
	/Users/ewbankkit/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.31.0/helper/schema/schema.go:1412 +0x90
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.schemaMap.diff(0x6?, {0x113ba5e0, 0xc001e21d10}, {0xfda679a, 0x4}, 0xc005be5cc0, 0xc000cd1d00, {0x113c8350?, 0xc000cd1d80}, 0x0)
	/Users/ewbankkit/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.31.0/helper/schema/schema.go:1134 +0x265
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.schemaMap.Diff(0xc005bb16e0, {0x113ba5e0, 0xc001e21d10}, 0xc001e2c820, 0xc004856460, 0xc005b1af78, {0xfd4cd40, 0xc000324a00}, 0x0)
	/Users/ewbankkit/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.31.0/helper/schema/schema.go:678 +0x353
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).SimpleDiff(0x113bbd10?, {0x113ba5e0?, 0xc001e21d10?}, 0xc001e2c820, 0xe26bac0?, {0xfd4cd40?, 0xc000324a00?})
	/Users/ewbankkit/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.31.0/helper/schema/resource.go:962 +0xe5
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).PlanResourceChange(0xc0027437b8, {0x113ba5e0?, 0xc001e21c20?}, 0xc004856050)
	/Users/ewbankkit/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.31.0/helper/schema/grpc_provider.go:794 +0xa09
github.com/hashicorp/terraform-plugin-mux/tf5muxserver.(*muxServer).PlanResourceChange(0xc000fafc00, {0x113ba5e0?, 0xc001e21950?}, 0xc004856050)
	/Users/ewbankkit/go/pkg/mod/github.com/hashicorp/terraform-plugin-mux@v0.13.0/tf5muxserver/mux_server_PlanResourceChange.go:73 +0x2d4
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).PlanResourceChange(0xc003bbc320, {0x113ba5e0?, 0xc001e21140?}, 0xc0007220e0)
	/Users/ewbankkit/go/pkg/mod/github.com/hashicorp/terraform-plugin-go@v0.20.0/tfprotov5/tf5server/server.go:824 +0x574
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_PlanResourceChange_Handler({0xfb16d80?, 0xc003bbc320}, {0x113ba5e0, 0xc001e21140}, 0xc000cd1780, 0x0)
	/Users/ewbankkit/go/pkg/mod/github.com/hashicorp/terraform-plugin-go@v0.20.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:485 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc000200780, {0x113ba5e0, 0xc001e210b0}, {0x113cf4e0, 0xc0037aa9c0}, 0xc001e1f7a0, 0xc0029af3b0, 0x180c4140, 0x0)
	/Users/ewbankkit/go/pkg/mod/google.golang.org/grpc@v1.60.0/server.go:1372 +0xe49
google.golang.org/grpc.(*Server).handleStream(0xc000200780, {0x113cf4e0, 0xc0037aa9c0}, 0xc001e1f7a0)
	/Users/ewbankkit/go/pkg/mod/google.golang.org/grpc@v1.60.0/server.go:1783 +0x1031
google.golang.org/grpc.(*Server).serveStreams.func2.1()
	/Users/ewbankkit/go/pkg/mod/google.golang.org/grpc@v1.60.0/server.go:1016 +0x68
created by google.golang.org/grpc.(*Server).serveStreams.func2
	/Users/ewbankkit/go/pkg/mod/google.golang.org/grpc@v1.60.0/server.go:1027 +0x12e
FAIL	github.com/hashicorp/terraform-provider-aws/internal/service/mq	9.345s
FAIL
make: *** [testacc] Error 1
% ACCTEST_TIMEOUT=720m make testacc TESTARGS='-run=TestAccMQBroker_' PKG=mq ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/mq/... -v -count 1 -parallel 3  -run=TestAccMQBroker_ -timeout 720m
=== RUN   TestAccMQBroker_basic
=== PAUSE TestAccMQBroker_basic
=== RUN   TestAccMQBroker_disappears
=== PAUSE TestAccMQBroker_disappears
=== RUN   TestAccMQBroker_tags
=== PAUSE TestAccMQBroker_tags
=== RUN   TestAccMQBroker_throughputOptimized
=== PAUSE TestAccMQBroker_throughputOptimized
=== RUN   TestAccMQBroker_AllFields_defaultVPC
=== PAUSE TestAccMQBroker_AllFields_defaultVPC
=== RUN   TestAccMQBroker_AllFields_customVPC
=== PAUSE TestAccMQBroker_AllFields_customVPC
=== RUN   TestAccMQBroker_EncryptionOptions_kmsKeyID
=== PAUSE TestAccMQBroker_EncryptionOptions_kmsKeyID
=== RUN   TestAccMQBroker_EncryptionOptions_managedKeyDisabled
=== PAUSE TestAccMQBroker_EncryptionOptions_managedKeyDisabled
=== RUN   TestAccMQBroker_EncryptionOptions_managedKeyEnabled
=== PAUSE TestAccMQBroker_EncryptionOptions_managedKeyEnabled
=== RUN   TestAccMQBroker_Update_users
=== PAUSE TestAccMQBroker_Update_users
=== RUN   TestAccMQBroker_Update_securityGroup
=== PAUSE TestAccMQBroker_Update_securityGroup
=== RUN   TestAccMQBroker_Update_engineVersion
=== PAUSE TestAccMQBroker_Update_engineVersion
=== RUN   TestAccMQBroker_Update_hostInstanceType
=== PAUSE TestAccMQBroker_Update_hostInstanceType
=== RUN   TestAccMQBroker_RabbitMQ_basic
=== PAUSE TestAccMQBroker_RabbitMQ_basic
=== RUN   TestAccMQBroker_RabbitMQ_config
=== PAUSE TestAccMQBroker_RabbitMQ_config
=== RUN   TestAccMQBroker_RabbitMQ_logs
=== PAUSE TestAccMQBroker_RabbitMQ_logs
=== RUN   TestAccMQBroker_RabbitMQ_validationAuditLog
=== PAUSE TestAccMQBroker_RabbitMQ_validationAuditLog
=== RUN   TestAccMQBroker_RabbitMQ_cluster
=== PAUSE TestAccMQBroker_RabbitMQ_cluster
=== RUN   TestAccMQBroker_ldap
=== PAUSE TestAccMQBroker_ldap
=== CONT  TestAccMQBroker_basic
=== CONT  TestAccMQBroker_Update_securityGroup
=== CONT  TestAccMQBroker_AllFields_customVPC
--- PASS: TestAccMQBroker_basic (877.41s)
=== CONT  TestAccMQBroker_RabbitMQ_logs
--- PASS: TestAccMQBroker_Update_securityGroup (1125.22s)
=== CONT  TestAccMQBroker_ldap
=== CONT  TestAccMQBroker_RabbitMQ_cluster
--- PASS: TestAccMQBroker_AllFields_customVPC (1559.43s)
--- PASS: TestAccMQBroker_RabbitMQ_logs (760.59s)
=== CONT  TestAccMQBroker_RabbitMQ_validationAuditLog
--- PASS: TestAccMQBroker_ldap (902.87s)
=== CONT  TestAccMQBroker_EncryptionOptions_managedKeyEnabled
--- PASS: TestAccMQBroker_RabbitMQ_validationAuditLog (638.17s)
=== CONT  TestAccMQBroker_Update_users
--- PASS: TestAccMQBroker_RabbitMQ_cluster (888.88s)
=== CONT  TestAccMQBroker_EncryptionOptions_managedKeyDisabled
--- PASS: TestAccMQBroker_EncryptionOptions_managedKeyEnabled (905.60s)
=== CONT  TestAccMQBroker_EncryptionOptions_kmsKeyID
--- PASS: TestAccMQBroker_EncryptionOptions_managedKeyDisabled (907.12s)
=== CONT  TestAccMQBroker_RabbitMQ_basic
--- PASS: TestAccMQBroker_Update_users (1278.23s)
=== CONT  TestAccMQBroker_RabbitMQ_config
--- PASS: TestAccMQBroker_EncryptionOptions_kmsKeyID (919.74s)
=== CONT  TestAccMQBroker_Update_hostInstanceType
--- PASS: TestAccMQBroker_RabbitMQ_basic (764.78s)
=== CONT  TestAccMQBroker_Update_engineVersion
--- PASS: TestAccMQBroker_RabbitMQ_config (676.03s)
=== CONT  TestAccMQBroker_throughputOptimized
--- PASS: TestAccMQBroker_throughputOptimized (842.68s)
=== CONT  TestAccMQBroker_AllFields_defaultVPC
--- PASS: TestAccMQBroker_Update_engineVersion (1108.04s)
=== CONT  TestAccMQBroker_tags
--- PASS: TestAccMQBroker_Update_hostInstanceType (1379.37s)
=== CONT  TestAccMQBroker_disappears
--- PASS: TestAccMQBroker_disappears (945.00s)
--- PASS: TestAccMQBroker_tags (1002.17s)
--- PASS: TestAccMQBroker_AllFields_defaultVPC (1567.07s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/mq	6646.022s

…chema.Set, not []string' panic in 'resourceUserHash'.
% make testacc TESTARGS='-run=TestAccMQBroker_Update_users' PKG=mq
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/mq/... -v -count 1 -parallel 20  -run=TestAccMQBroker_Update_users -timeout 360m
=== RUN   TestAccMQBroker_Update_users
=== PAUSE TestAccMQBroker_Update_users
=== CONT  TestAccMQBroker_Update_users
--- PASS: TestAccMQBroker_Update_users (1408.39s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/mq	1415.290s
Copy link

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull 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.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added size/XS Managed by automation to categorize the size of a PR. service/mq Issues and PRs that pertain to the mq 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 ewbankkit added bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. labels Jan 12, 2024
Copy link
Member

@jar-b jar-b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎉

% make testacc TESTARGS='-run=TestAccMQBroker_Update_users' PKG=mq
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/mq/... -v -count 1 -parallel 20  -run=TestAccMQBroker_Update_users -timeout 360m
=== RUN   TestAccMQBroker_Update_users
=== PAUSE TestAccMQBroker_Update_users
=== CONT  TestAccMQBroker_Update_users
--- PASS: TestAccMQBroker_Update_users (1403.25s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/mq 1406.783s

@ewbankkit ewbankkit merged commit 64c1d17 into main Jan 12, 2024
109 checks passed
@ewbankkit ewbankkit deleted the b-aws_mq_broker.resourceUserHash-panic branch January 12, 2024 16:51
@github-actions github-actions bot added this to the v5.33.0 milestone Jan 12, 2024
github-actions bot pushed a commit that referenced this pull request Jan 12, 2024
@ewbankkit ewbankkit mentioned this pull request Jan 12, 2024
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!

@github-actions github-actions bot removed the bug Addresses a defect in current functionality. label Jan 12, 2024
@justinretzolk justinretzolk added the bug Addresses a defect in current functionality. label Feb 10, 2024
Copy link

I'm going to lock this pull request 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 related to this change, 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. size/XS Managed by automation to categorize the size of a PR.
Projects
None yet
3 participants