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

getting: Polish WebP conversion can be only triggered when Polish setting is enabled

Open jakshi opened this issue 6 years ago • 8 comments

When I try to enable polish and webp in cloudflare_zone_settings_override resource I get:

Error: error from makeRequest: HTTP status 400: content "{"success":false,"errors":[{"code":1020,"message":"Polish WebP conversion can be only triggered when Polish setting is enabled"},{"code":1006,"message":"Unrecognized zone setting name"}],"messages":[],"result":null}"

According to documentation in https://www.terraform.io/docs/providers/cloudflare/r/zone_settings_override.html#webp:

webp. Note that the value specified will be ignored unless polish is turned on (i.e. is "lossless" or "lossy")

So I expect it to be ignored (or have polish enabled and then webp enabled) instead of getting the error.

$ terraform --version Terraform v0.12.9

  • provider.aws v2.30.0
  • provider.cloudflare v2.0.0
  • provider.template v2.1.2

jakshi avatar Oct 05 '19 09:10 jakshi

I'm getting the same error. It happens when creating a new cloudflare_zone_settings_override resource. Disabling webp, create resource with polish enabled, set webp to on again seems to work for me.

maetthu avatar Oct 07 '19 20:10 maetthu

This happens for me in an existing cloudflare_zone_settings_override resource.

$terraform -version
Terraform v0.12.28
+ provider.aws v3.0.0
+ provider.cloudflare v2.9.0

ZebraFlesh avatar Aug 04 '20 18:08 ZebraFlesh

@jakshi @maetthu @ZebraFlesh can one of you please provide a reproduction case for this one? I'm not sure I have enough to go off here.

jacobbednarz avatar Jan 22 '21 04:01 jacobbednarz

Pretty straight forward, use a resource similar to the following:

resource "cloudflare_zone_settings_override" "test-resource" {
  zone_id = <your zone id>
  settings {
    polish           = "lossy"
    webp             = "on"  # webp needs to enabled after polish; it's a two step process that cannot be achieved in a single commit
  }
}

ZebraFlesh avatar Jan 22 '21 17:01 ZebraFlesh

  • Terraform v0.12.30
  • provider.cloudflare v2.6.0

Settings

polish           = "lossy"
webp             = "on"

Output:

[2021-03-20T11:29:39.141Z] Error: HTTP status 400: Polish WebP conversion can be only triggered when Polish setting is enabled (1020)
[2021-03-20T11:29:39.141Z] Error: HTTP status 400: Polish WebP conversion can be only triggered when Polish setting is enabled (1020)

The polish setting was persisted, but the webp was not.

On the second run both seem to apply fine. [2021-03-20T11:44:31.609Z] ~ webp = "off" -> "on"

KyleNesium avatar Mar 20 '21 11:03 KyleNesium

i think the solution would be to make webp to have a block and put polish setting inside the webp block?

vital4ik avatar Apr 09 '21 18:04 vital4ik

Same result as @KyleNesium described. This is still an issue with:

Terraform v1.0.8 provider.cloudflare v3.1.0

zicodes avatar Oct 04 '21 11:10 zicodes

i think the solution would be to make webp to have a block and put polish setting inside the webp block?

or the other way around

polish {
  mode = "lossy"
  webp = "on"
  avif = "on"
}

perosb avatar Jun 03 '22 11:06 perosb

closing this as unresolved since there isn't anything we can do at the moment. the zone settings management will be overhauled in a future release and this is on the list to get some attention so we'll address it there (and not in the current resource).

in the meantime, all i can recommend is applying it initially in two passes and only manage the values in cloudflare_zone_setting_override that are not the defaults.

jacobbednarz avatar Feb 10 '23 04:02 jacobbednarz