terraform-provider-cloudflare icon indicating copy to clipboard operation
terraform-provider-cloudflare copied to clipboard

crash on zone_settings_override

Open jacobbednarz opened this issue 2 years ago • 4 comments

Confirmation

  • [X] My issue isn't already found on the issue tracker.
  • [X] I have replicated my issue using the latest version of the provider and it is still present.

Terraform and Cloudflare provider version

v3.11.0

Affected resource(s)

cloudflare_zone_settings_override

Terraform configuration files

resource "cloudflare_zone_settings_override" "default" {
  zone_id = var.cloudflare_zone_id
  settings {
    binary_ast = "off"
    h2_prioritization = "off"
  }
}

Debug output

sanitised TF_LOG output: https://gist.githubusercontent.com/jacobbednarz/bdd474462f355ba49337c3015a4f22f6/raw/dd46194c4a64223f08f295fc396ef52bb3919b24/gistfile1.txt

Panic output

[23/03/2022, 16:59:48.987] Stack trace from the terraform-provider-cloudflare_v3.11.0 plugin:

[23/03/2022, 16:59:48.987] panic: runtime error: slice bounds out of range [2:1]

[23/03/2022, 16:59:48.987] goroutine 84 [running]:
[23/03/2022, 16:59:48.987] github.com/cloudflare/terraform-provider-cloudflare/cloudflare.updateSingleZoneSettings({0xc000450c00, 0x2, 0x2}, 0x2, {0xc00045a660, 0x20})
[23/03/2022, 16:59:48.987] github.com/cloudflare/terraform-provider-cloudflare/cloudflare/resource_cloudflare_zone_settings_override.go:232 +0x405
[23/03/2022, 16:59:48.987] github.com/cloudflare/terraform-provider-cloudflare/cloudflare.resourceCloudflareZoneSettingsOverrideUpdate(0xc000179e00, {0x195ddc0, 0xc00016c6c0})
[23/03/2022, 16:59:48.987] github.com/cloudflare/terraform-provider-cloudflare/cloudflare/resource_cloudflare_zone_settings_override.go:272 +0x29e
[23/03/2022, 16:59:48.987] github.com/cloudflare/terraform-provider-cloudflare/cloudflare.resourceCloudflareZoneSettingsOverrideCreate(0xc000179e00, {0x195ddc0, 0xc00016c6c0})
[23/03/2022, 16:59:48.987] github.com/cloudflare/terraform-provider-cloudflare/cloudflare/resource_cloudflare_zone_settings_override.go:76 +0x946
[23/03/2022, 16:59:48.987] github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0x1a9b3a0, {0x1a9b3a0, 0xc0002d9ad0}, 0xd, {0x195ddc0, 0xc00016c6c0})
[23/03/2022, 16:59:48.987] github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:330 +0x178
[23/03/2022, 16:59:48.987] github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc0004215e0, {0x1a9b3a0, 0xc0002d9ad0}, 0xc000257860, 0xc000179c80, {0x195ddc0, 0xc00016c6c0})
[23/03/2022, 16:59:48.987] github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:472 +0x9ba
[23/03/2022, 16:59:48.987] github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc0003a2498, {0x1a9b2f8, 0xc000211a80}, 0xc00032e960)
[23/03/2022, 16:59:48.987] github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:1021 +0xdaa
[23/03/2022, 16:59:48.987] github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc0002fc960, {0x1a9b3a0, 0xc0002d9200}, 0xc0000fa620)
[23/03/2022, 16:59:48.987] github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:812 +0x56b
[23/03/2022, 16:59:48.987] github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x19313c0, 0xc0002fc960}, {0x1a9b3a0, 0xc0002d9200}, 0xc0005944e0, 0x0)
[23/03/2022, 16:59:48.987] github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:385 +0x170
[23/03/2022, 16:59:48.988] google.golang.org/grpc.(*Server).processUnaryRPC(0xc0002b2a80, {0x1aa9d88, 0xc000430ea0}, 0xc0002d25a0, 0xc000419320, 0x1fff4a0, 0x0)
[23/03/2022, 16:59:48.988] google.golang.org/[email protected]/server.go:1282 +0xccf
[23/03/2022, 16:59:48.988] google.golang.org/grpc.(*Server).handleStream(0xc0002b2a80, {0x1aa9d88, 0xc000430ea0}, 0xc0002d25a0, 0x0)
[23/03/2022, 16:59:48.988] google.golang.org/[email protected]/server.go:1619 +0xa2a
[23/03/2022, 16:59:48.988] google.golang.org/grpc.(*Server).serveStreams.func1.2()
[23/03/2022, 16:59:48.988] google.golang.org/[email protected]/server.go:921 +0x98
[23/03/2022, 16:59:48.988] created by google.golang.org/grpc.(*Server).serveStreams.func1
[23/03/2022, 16:59:48.988] google.golang.org/[email protected]/server.go:919 +0x294

Expected output

binary_ast set to "off" without a crash

Actual output

binary_ast set to "off" but with a crash

Steps to reproduce

  1. take reproduction case
  2. apply the configuration
  3. see crash

Additional factoids

oddly enough, if you add brotli to the reproduction case, it doesn't consistently fail but instead sometimes works. from 4 runs: crash, crash, crash, crash, 400 error

│ Error: HTTP status 400: Unrecognized zone setting name: h2_prioritization (1006)
│
│   with cloudflare_zone_settings_override.default,
│   on [zone.tf](http://zone.tf/) line 1, in resource "cloudflare_zone_settings_override" "default":
│    1: resource "cloudflare_zone_settings_override" "default" {

References

No response

jacobbednarz avatar Mar 23 '22 19:03 jacobbednarz

Thank you for reporting this issue! For maintainers to dig into issues it is required that all issues include the entirety of TF_LOG=DEBUG output to be provided. The only parts that should be redacted are your user credentials in the X-Auth-Key, X-Auth-Email and Authorization HTTP headers. Details such as zone or account identifiers are not considered sensitive but can be redacted if you are very cautious. This log file provides additional context from Terraform, the provider and the Cloudflare API that helps in debugging issues. Without it, maintainers are very limited in what they can do and may hamper diagnosis efforts.

This issue has been marked with triage/needs-information and is unlikely to receive maintainer attention until the log file is provided making this a complete bug report.

github-actions[bot] avatar Mar 23 '22 19:03 github-actions[bot]

The same problem

maxpain avatar Apr 03 '22 11:04 maxpain

The same for 3.10.1 provider version, and 1.0.4 of terraform. binary_ast unspecified in config (used "off" by default).

Nmishin avatar Apr 27 '22 14:04 Nmishin

we are facing the same issue as well.. any ETA on when this will be fixed.

│ Error: Unrecognized zone setting name: h2_prioritization (1006) │ │ with module.zone-settings-override.cloudflare_zone_settings_override.zonesettings, │ on ../../modules/zone-settings-override/main.tf line 1, in resource "cloudflare_zone_settings_override" "zonesettings": │ 1: resource "cloudflare_zone_settings_override" "zonesettings" {

Versions used

  • Installing cloudflare/cloudflare v3.21.0...
  • Installed cloudflare/cloudflare v3.21.0 (signed by a HashiCorp partner, key ID DE413CEC881C3283)
  • Installing hashicorp/http v3.0.1...
  • Installed hashicorp/http v3.0.1

udaydaayam avatar Aug 10 '22 10:08 udaydaayam

i'm no longer able to replicate this on the latest version of the provider so closing it out. if you're still experiencing the issue, please open a new issue to diagnose.

jacobbednarz avatar Nov 28 '22 22:11 jacobbednarz