cloudflare / terraform-provider-cloudflare

Cloudflare Terraform Provider
https://registry.terraform.io/providers/cloudflare/cloudflare
Mozilla Public License 2.0
789 stars 610 forks source link

cloudflare_zone_settings_override Unrecognized zone setting name #1775

Closed aleksandrovpa closed 2 years ago

aleksandrovpa commented 2 years ago

Confirmation

Terraform and Cloudflare provider version

Terraform v1.2.2 on darwin_arm64

Affected resource(s)

cloudflare_zone_settings_override

Terraform configuration files

module.simple_life.module.this.cloudflare_zone_settings_override.this will be created
  + resource "cloudflare_zone_settings_override" "this" {
      + id                       = (known after apply)
      + initial_settings         = (known after apply)
      + initial_settings_read_at = (known after apply)
      + readonly_settings        = (known after apply)
      + zone_id                  = ""
      + zone_status              = (known after apply)
      + zone_type                = (known after apply)

      + settings {
          + always_online               = "on"
          + always_use_https            = "on"
          + automatic_https_rewrites    = "on"
          + binary_ast                  = (known after apply)
          + brotli                      = "on"
          + browser_cache_ttl           = 1200
          + browser_check               = "on"
          + cache_level                 = "aggressive"
          + challenge_ttl               = 1800
          + ciphers                     = []
          + cname_flattening            = "flatten_at_root"
          + development_mode            = "off"
          + early_hints                 = "on"
          + email_obfuscation           = "on"
          + filter_logs_to_cloudflare   = (known after apply)
          + h2_prioritization           = "on"
          + hotlink_protection          = "off"
          + http2                       = "on"
          + http3                       = "on"
          + image_resizing              = "off"
          + ip_geolocation              = "on"
          + ipv6                        = "off"
          + log_to_cloudflare           = (known after apply)
          + max_upload                  = 100
          + min_tls_version             = "1.2"
          + mirage                      = "on"
          + opportunistic_encryption    = "on"
          + opportunistic_onion         = "on"
          + orange_to_orange            = (known after apply)
          + origin_error_page_pass_thru = (known after apply)
          + polish                      = "lossless"
          + prefetch_preload            = (known after apply)
          + privacy_pass                = "on"
          + proxy_read_timeout          = (known after apply)
          + pseudo_ipv4                 = "off"
          + response_buffering          = (known after apply)
          + rocket_loader               = "off"
          + security_level              = "medium"
          + server_side_exclude         = "on"
          + sort_query_string_for_cache = (known after apply)
          + ssl                         = "flexible"
          + tls_1_2_only                = (known after apply)
          + tls_1_3                     = "zrt"
          + tls_client_auth             = (known after apply)
          + true_client_ip_header       = (known after apply)
          + universal_ssl               = "on"
          + visitor_ip                  = (known after apply)
          + waf                         = "on"
          + webp                        = "on"
          + websockets                  = "on"
          + zero_rtt                    = "on"

          + minify {
              + css  = "on"
              + html = "on"
              + js   = "on"
            }

          + mobile_redirect {
              + status    = "off"
              + strip_uri = false
            }

          + security_header {
              + enabled            = false
              + include_subdomains = false
              + max_age            = 0
              + nosniff            = false
              + preload            = false
            }
        }
    }

Debug output

2022-07-15T12:40:59.072+0300 [DEBUG] provider.terraform-provider-cloudflare_v3.18.0: Cloudflare API Response Details: ---[ RESPONSE ]-------------------------------------- HTTP/2.0 400 Bad Request Connection: close Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Cf-Cache-Status: DYNAMIC Cf-Ray: 72b18a213db6152e-LCA Content-Type: application/json Date: Fri, 15 Jul 2022 09:40:59 GMT Expect-Ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" Expires: Sun, 25 Jan 1981 05:00:00 GMT Pragma: no-cache Server: cloudflare Set-Cookie: cflb=0H28vgHxwvgAQtjUGU56Rb8iNWZVUvXho69pAhEykgM; SameSite=Lax; path=/; expires=Fri, 15-Jul-22 12:11:00 GMT; HttpOnly Set-Cookie: cfruid=08df6c05722f05ecea552cf1758d772befb2dec2-1657878059; path=/; domain=.api.cloudflare.com; HttpOnly; Secure; SameSite=None Strict-Transport-Security: max-age=31536000 Vary: Accept-Encoding X-Content-Type-Options: nosniff X-Frame-Options: SAMEORIGIN

{ "success": false, "errors": [ { "code": 1006, "message": "Unrecognized zone setting name: h2_prioritization" } ], "messages": [], "result": null } -----------------------------------------------------: timestamp=2022-07-15T12:40:59.071+0300

log.LOG

Panic output

No response

Expected output

Terraform apply finished without errors

Actual output

Error: Unrecognized zone setting name: h2_prioritization Error: Unrecognized zone setting name: image_resizing

Steps to reproduce

Using cf-terraforming generation create terraform block with existing cloudflare_zone_settings_override, run terraform plan/apply

Additional factoids

I've read all of similar issues here and tried each workaround but have no luck. Also i've turned some parameters to on/off (cause terraform object name is override) but still the same problem. As i can see in API, fields image_resizing and h2_prioritization has a "editable": true (also i've tried turn them on/off via UI but have no luck) I've made terraform state rm for this resource too.

For now, i think we can't use terraform for manage these settings and this is awful. And also very often i get Error: Plugin did not respond... We couldn't import it and couldn't create, idk what to say more

References

https://github.com/cloudflare/terraform-provider-cloudflare/issues/961 https://github.com/cloudflare/terraform-provider-cloudflare/issues/533 https://github.com/cloudflare/terraform-provider-cloudflare/issues/1297

github-actions[bot] commented 2 years ago

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.

aleksandrovpa commented 2 years ago

Have provided the log file already as attachment since its too big for pasting content

istvanfedak commented 2 years ago

@aleksandrovpa look into Plan-Dependent Settings

I've seen the Unrecognized zone setting name: h2_prioritization before.

I was able to resolve the issue by setting h2_prioritization = null which defaults to "off". Unfortunately I see in your config that you're attempting to set h2_prioritization = "on" so I'm not sure how to resolve the issue.

Have you tried to set h2_prioritization = null apply the changes and then set h2_prioritization = "on" and re-apply?

jacobbednarz commented 2 years ago

also see https://github.com/cloudflare/terraform-provider-cloudflare/issues/1787#issuecomment-1190716389