terraform-provider-cloudflare
terraform-provider-cloudflare copied to clipboard
getting: Polish WebP conversion can be only triggered when Polish setting is enabled
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
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.
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
@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.
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
}
}
- 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"
i think the solution would be to make webp to have a block and put polish setting inside the webp block?
Same result as @KyleNesium described. This is still an issue with:
Terraform v1.0.8 provider.cloudflare v3.1.0
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"
}
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.