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

Apparent WAF related plugin crash - panic: interface conversion: interface {} is int, not int64 #23186

Closed
azt3k opened this issue Feb 14, 2022 · 6 comments
Labels
bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic.
Milestone

Comments

@azt3k
Copy link

azt3k commented Feb 14, 2022

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • 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
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform AWS Provider Version

Terraform v1.1.5
on darwin_amd64

  • provider registry.terraform.io/hashicorp/archive v2.2.0
  • provider registry.terraform.io/hashicorp/aws v3.74.2
  • provider registry.terraform.io/hashicorp/null v3.1.0
  • provider registry.terraform.io/hashicorp/random v3.1.0

Affected Resource(s)

aws_waf - not sure which sub resource

Terraform Configuration Files

https://gist.github.com/azt3k/5bf0682d2eaa4807179c19da9f2c5844

Debug Output

https://gist.github.com/azt3k/5410a68ac6512352a5d316154a85eee7

Panic Output

3.73.0

Stack trace from the terraform-provider-aws_v3.73.0_x5 plugin:

panic: interface conversion: interface {} is int, not int64

goroutine 385 [running]:
github.com/hashicorp/terraform-provider-aws/internal/service/waf.ExpandActivatedRule(...)
	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-aws/internal/service/waf/helpers.go:274
github.com/hashicorp/terraform-provider-aws/internal/service/waf.DiffRuleGroupActivatedRules(0xfca1078, 0x0, 0x0, 0xc000df7c20, 0xa, 0xa, 0xc00290c3f8, 0xc0012dc400, 0xc0012dc000)
	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-aws/internal/service/waf/helpers.go:246 +0xe33
github.com/hashicorp/terraform-provider-aws/internal/service/waf.updateWafRuleGroupResource.func1(0xc001e58890, 0xfca1078, 0xc00290c3f8, 0x0, 0x0)
	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-aws/internal/service/waf/rule_group.go:244 +0xd0
github.com/hashicorp/terraform-provider-aws/internal/service/waf.(*WafRetryer).RetryWithToken.func1(0x2)
	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-aws/internal/service/waf/token_handlers.go:33 +0x1fc
github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource.RetryContext.func1(0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
	/opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.10.1/helper/resource/wait.go:27 +0x5b
github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource.(*StateChangeConf).WaitForStateContext.func1(0xc001e6a2a0, 0xc0026c9420, 0xc001e4c600, 0xc001e08bc0, 0xc001a62f50, 0xc001a62f38)
	/opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.10.1/helper/resource/state.go:110 +0x2e9
created by github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource.(*StateChangeConf).WaitForStateContext
	/opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.10.1/helper/resource/state.go:83 +0x1c6

3.74.2

Stack trace from the terraform-provider-aws_v3.74.2_x5 plugin:

panic: interface conversion: interface {} is int, not int64

goroutine 124 [running]:
github.com/hashicorp/terraform-provider-aws/internal/service/waf.ExpandActivatedRule(...)
	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-aws/internal/service/waf/helpers.go:274
github.com/hashicorp/terraform-provider-aws/internal/service/waf.DiffRuleGroupActivatedRules(0xfcf5118, 0x0, 0x0, 0xc002515220, 0xa, 0xa, 0xc002712000, 0xc00157a400, 0xc00157a000)
	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-aws/internal/service/waf/helpers.go:246 +0xe33
github.com/hashicorp/terraform-provider-aws/internal/service/waf.updateWafRuleGroupResource.func1(0xc0029a26a0, 0xfcf5118, 0xc002712000, 0x0, 0x0)
	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-aws/internal/service/waf/rule_group.go:244 +0xd0
github.com/hashicorp/terraform-provider-aws/internal/service/waf.(*WafRetryer).RetryWithToken.func1(0x2)
	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-aws/internal/service/waf/token_handlers.go:33 +0x1fc
github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource.RetryContext.func1(0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
	/opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.10.1/helper/resource/wait.go:27 +0x5b
github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource.(*StateChangeConf).WaitForStateContext.func1(0xc002098240, 0xc0014f2000, 0xc0027400c0, 0xc002086200, 0xc00209e078, 0xc00209e070)
	/opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.10.1/helper/resource/state.go:110 +0x2e9
created by github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource.(*StateChangeConf).WaitForStateContext
	/opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.10.1/helper/resource/state.go:83 +0x1c6

Expected Behavior

Create the resources and save them in the state

Actual Behavior

Plugin crashes, some resources are created and not saved in state resulting in duplicate resources being created

Steps to Reproduce

  1. change provider from 3.31 to 3.73.0 or 3.74.2
  2. run terraform init -upgrade
  3. run terraform apply

Important Factoids

This did work with an older provider version - 3.31 was the last known good version,

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic. labels Feb 14, 2022
@ewbankkit
Copy link
Contributor

This was fixed via #22978 and released in v4.0.0 of the Terraform AWS Provider.

@azt3k
Copy link
Author

azt3k commented Feb 14, 2022

Is there a plan to apply this fix to a 3.x version?

@justinretzolk justinretzolk removed the needs-triage Waiting for first response or review from a maintainer. label Feb 15, 2022
@justinretzolk
Copy link
Member

Hey @azt3k 👋 Generally speaking, we only backport things when it involves a security issue or a regression. For this particular issue, I don't believe there is a plan to backport the fix.

@ewbankkit
Copy link
Contributor

Closed via #23253.

@github-actions
Copy link

This functionality has been released in v3.74.3 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 May 12, 2022
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.
Projects
None yet
Development

No branches or pull requests

3 participants