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

Terraform provider aws plugin crashed (*GRPCProvider).ApplyResourceChange call #20594

Closed
jtgorny opened this issue Aug 17, 2021 · 5 comments · Fixed by #12509
Closed

Terraform provider aws plugin crashed (*GRPCProvider).ApplyResourceChange call #20594

jtgorny opened this issue Aug 17, 2021 · 5 comments · Fixed by #12509
Labels
bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic. service/cloudfront Issues and PRs that pertain to the cloudfront service.
Milestone

Comments

@jtgorny
Copy link

jtgorny commented Aug 17, 2021

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.0.0
on linux_amd64

  • provider registry.terraform.io/hashicorp/aws v3.54.0

Affected Resource(s)

  • aws_cloudfront_cache_policy

Terraform Configuration Files

resource "aws_cloudfront_cache_policy" "scheduling_cache_policy" {
  name        = "scheduling-cache-policy"
  default_ttl = 86400
  max_ttl     = 31536000
  min_ttl     = 1
  parameters_in_cache_key_and_forwarded_to_origin {
    headers_config {
      header_behavior = "whitelist"
      headers {
        items = [
          "Origin",
          "Access-Control-Request-Method",
          "Access-Control-Request-Headers"]
      }
    }
    cookies_config {
      cookie_behavior = "whitelist"
      cookies {
        items = []
      }
    }
    query_strings_config {
      query_string_behavior = "whitelist"
      query_strings {
        items = []
      }
    }
  }
}

resource "aws_acm_certificate" "Application-Cert" {
  domain_name       = var.AWS-Cert-DomainName
  validation_method = "DNS"

  tags = {
    Name        = "${var.application_name}-${var.environment}-certificate"
    Application = var.application_name
    Environment = var.environment
    Owner       = var.owner
  }

  lifecycle {
    ignore_changes = all
  }
}

Debug Output

https://gist.github.com/jtgorny/09c3cf1a9cbb972cca86c19e94dba354

Panic Output

panic: interface conversion: interface {} is nil, not map[string]interface {}

Expected Behavior

TF should have created an aws_cloudfront_cache_policy & an aws_acm_certificate

Actual Behavior

Steps to Reproduce

  1. terraform apply

Important Factoids

Nothing atypical

References

None

@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. service/acm Issues and PRs that pertain to the acm service. service/cloudfront Issues and PRs that pertain to the cloudfront service. labels Aug 17, 2021
@ewbankkit ewbankkit removed crash Results from or addresses a Terraform crash or kernel panic. service/acm Issues and PRs that pertain to the acm service. labels Aug 20, 2021
@ewbankkit
Copy link
Contributor

tack trace from the terraform-provider-aws_v3.54.0_x5 plugin:

panic: interface conversion: interface {} is nil, not map[string]interface {}

goroutine 91 [running]:
github.com/terraform-providers/terraform-provider-aws/aws.expandCloudFrontCachePolicyCookiesConfig(0xc001c5b350, 0xc001c5b2f0)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-aws/aws/cloudfront_cache_policy_structure.go:34 +0x1e5
github.com/terraform-providers/terraform-provider-aws/aws.expandCloudFrontCachePolicyParametersConfig(0xc001c5b2f0, 0x748acce)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-aws/aws/cloudfront_cache_policy_structure.go:112 +0xb2
github.com/terraform-providers/terraform-provider-aws/aws.expandCloudFrontCachePolicyConfig(0xc001c70d80, 0xc001993718)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-aws/aws/cloudfront_cache_policy_structure.go:138 +0xb9
github.com/terraform-providers/terraform-provider-aws/aws.resourceAwsCloudFrontCachePolicyCreate(0xc001c70d80, 0x6558a80, 0xc00004e600, 0x0, 0xffffffffffffffff)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-aws/aws/resource_aws_cloudfront_cache_policy.go:161 +0x55
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0xc000820620, 0x7f3e5e8, 0xc00137b240, 0xc001c70d80, 0x6558a80, 0xc00004e600, 0x0, 0x0, 0x0)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/gdavison/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:318 +0x1ee
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc000820620, 0x7f3e5e8, 0xc00137b240, 0xc001c2c1c0, 0xc001c1af00, 0x6558a80, 0xc00004e600, 0x0, 0x0, 0x0, ...)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/gdavison/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:456 +0x67b
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc000134c78, 0x7f3e5e8, 0xc00137b240, 0xc001c26780, 0xc00137b240, 0x7183ae0, 0xc001c20e00)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/gdavison/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:955 +0x8ef
github.com/hashicorp/terraform-plugin-go/tfprotov5/server.(*server).ApplyResourceChange(0xc001c84060, 0x7f3e690, 0xc00137b240, 0xc001c2c070, 0xc001c84060, 0xc001c20e40, 0xc001407ba0)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/[email protected]/tfprotov5/server/server.go:332 +0xb5
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler(0x7183ae0, 0xc001c84060, 0x7f3e690, 0xc001c20e40, 0xc0019d7620, 0x0, 0x7f3e690, 0xc001c20e40, 0xc00121dc00, 0x3f1)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:380 +0x214
google.golang.org/grpc.(*Server).processUnaryRPC(0xc000667880, 0x7f60758, 0xc0013ae000, 0xc002028f00, 0xc001602ae0, 0xb831380, 0x0, 0x0, 0x0)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/google.golang.org/[email protected]/server.go:1194 +0x52b
google.golang.org/grpc.(*Server).handleStream(0xc000667880, 0x7f60758, 0xc0013ae000, 0xc002028f00, 0x0)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/google.golang.org/[email protected]/server.go:1517 +0xd0c
google.golang.org/grpc.(*Server).serveStreams.func1.2(0xc000d761f0, 0xc000667880, 0x7f60758, 0xc0013ae000, 0xc002028f00)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/google.golang.org/[email protected]/server.go:859 +0xab
created by google.golang.org/grpc.(*Server).serveStreams.func1
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/google.golang.org/[email protected]/server.go:857 +0x1fd

Error: The terraform-provider-aws_v3.54.0_x5 plugin crashed!

@ewbankkit ewbankkit added crash Results from or addresses a Terraform crash or kernel panic. and removed needs-triage Waiting for first response or review from a maintainer. labels Aug 20, 2021
@ewbankkit
Copy link
Contributor

Similar: #20589.

@IrfanAnsari
Copy link

It's not just related to a single resource. I can see this happening for aws_cloudwatch_metric_alarm, aws_acm_certificate,aws_security_group_rule etc

@github-actions
Copy link

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

@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 29, 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. service/cloudfront Issues and PRs that pertain to the cloudfront service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants