each time I run tf plan / apply it fails on page rules with this:
Error: error from makeRequest: HTTP status 404: content "404 page not found\n"
Error: error from makeRequest: HTTP status 404: content "404 page not found\n"
Error: error from makeRequest: HTTP status 404: content "404 page not found\n"
Error: error from makeRequest: HTTP status 404: content "404 page not found\n"
Error: error from makeRequest: HTTP status 404: content "404 page not found\n"
Error: error from makeRequest: HTTP status 404: content "404 page not found\n"
reproduced on 2.17.0 and 2.18.0 provider versions
13.05
page_rules
2021-02-03T14:10:53.247+0200 [DEBUG] plugin.terraform-provider-cloudflare_v2.18.0: 181
2021-02-03T14:10:53.247+0200 [DEBUG] plugin.terraform-provider-cloudflare_v2.18.0: {
2021-02-03T14:10:53.247+0200 [DEBUG] plugin.terraform-provider-cloudflare_v2.18.0: "result": {
2021-02-03T14:10:53.247+0200 [DEBUG] plugin.terraform-provider-cloudflare_v2.18.0: "id": "3815a507b2437f1f8e5e5b3b96c4cd22",
2021-02-03T14:10:53.247+0200 [DEBUG] plugin.terraform-provider-cloudflare_v2.18.0: "targets": [
2021-02-03T14:10:53.247+0200 [DEBUG] plugin.terraform-provider-cloudflare_v2.18.0: {
2021-02-03T14:10:53.247+0200 [DEBUG] plugin.terraform-provider-cloudflare_v2.18.0: "target": "url",
2021-02-03T14:10:53.247+0200 [DEBUG] plugin.terraform-provider-cloudflare_v2.18.0: "constraint": {
2021-02-03T14:10:53.247+0200 [DEBUG] plugin.terraform-provider-cloudflare_v2.18.0: "operator": "matches",
2021-02-03T14:10:53.247+0200 [DEBUG] plugin.terraform-provider-cloudflare_v2.18.0: "value": "https:\/\/oc.mydomain.com\/remote.php\/dav\/uploads\/*"
2021-02-03T14:10:53.247+0200 [DEBUG] plugin.terraform-provider-cloudflare_v2.18.0: }
2021-02-03T14:10:53.247+0200 [DEBUG] plugin.terraform-provider-cloudflare_v2.18.0: }
2021-02-03T14:10:53.247+0200 [DEBUG] plugin.terraform-provider-cloudflare_v2.18.0: ],
2021-02-03T14:10:53.247+0200 [DEBUG] plugin.terraform-provider-cloudflare_v2.18.0: "actions": [
2021-02-03T14:10:53.247+0200 [DEBUG] plugin.terraform-provider-cloudflare_v2.18.0: {
2021-02-03T14:10:53.247+0200 [DEBUG] plugin.terraform-provider-cloudflare_v2.18.0: "id": "waf",
2021-02-03T14:10:53.247+0200 [DEBUG] plugin.terraform-provider-cloudflare_v2.18.0: "value": "off"
2021-02-03T14:10:53.247+0200 [DEBUG] plugin.terraform-provider-cloudflare_v2.18.0: }
2021-02-03T14:10:53.247+0200 [DEBUG] plugin.terraform-provider-cloudflare_v2.18.0: ],
2021-02-03T14:10:53.247+0200 [DEBUG] plugin.terraform-provider-cloudflare_v2.18.0: "priority": 40,
2021-02-03T14:10:53.247+0200 [DEBUG] plugin.terraform-provider-cloudflare_v2.18.0: "status": "active",
.terraform-provider-cloudflare_v2.18.0: "created_on": "2020-11-06T15:57:46.000000Z",
2021-02-03T14:10:53.247+0200 [DEBUG] plugin.terraform-provider-cloudflare_v2.18.0: "modified_on": "2020-12-06T12:29:07.000000Z"
2021-02-03T14:10:53.247+0200 [DEBUG] plugin.terraform-provider-cloudflare_v2.18.0: },
2021-02-03T14:10:53.247+0200 [DEBUG] plugin.terraform-provider-cloudflare_v2.18.0: "success": true,
2021-02-03T14:10:53.247+0200 [DEBUG] plugin.terraform-provider-cloudflare_v2.18.0: "errors": [],
2021-02-03T14:10:53.247+0200 [DEBUG] plugin.terraform-provider-cloudflare_v2.18.0: "messages": []
2021-02-03T14:10:53.247+0200 [DEBUG] plugin.terraform-provider-cloudflare_v2.18.0: }
2021-02-03T14:10:53.247+0200 [DEBUG] plugin.terraform-provider-cloudflare_v2.18.0: 0
2021-02-03T14:10:53.247+0200 [DEBUG] plugin.terraform-provider-cloudflare_v2.18.0:
2021-02-03T14:10:53.247+0200 [DEBUG] plugin.terraform-provider-cloudflare_v2.18.0:
2021-02-03T14:10:53.247+0200 [DEBUG] plugin.terraform-provider-cloudflare_v2.18.0: -----------------------------------------------------
2021-02-03T14:10:53.247+0200 [DEBUG] plugin.terraform-provider-cloudflare_v2.18.0: 2021/02/03 14:10:53 [DEBUG] Cloudflare Page Rule read configuration: cloudflare.PageRule{ID:"3815a507b2437f1f8e5e5b3b96c4cd22", Targets:[]cloudflare.PageRuleTarget{cloudflare.PageRuleTarget{Target:"url", Constraint:struct { Operator string "json:\"operator\""; Value string "json:\"value\"" }{Operator:"matches", Value:"https://oc.mydomain.com/remote.php/dav/uploads/*"}}}, Actions:[]cloudflare.PageRuleAction{cloudflare.PageRuleAction{ID:"waf", Value:"off"}}, Priority:40, Status:"active", ModifiedOn:time.Time{wall:0x0, ext:63742854547, loc:(*time.Location)(nil)}, CreatedOn:time.Time{wall:0x0, ext:63740275066, loc:(*time.Location)(nil)}}
2021-02-03T14:10:53.247+0200 [DEBUG] plugin.terraform-provider-cloudflare_v2.18.0: 2021/02/03 14:10:53 [DEBUG] Cloudflare Page Rule actions configuration: map[string]interface {}{"waf":"off"}
Error: error from makeRequest: HTTP status 404: content "404 page not found\n"
Error: error from makeRequest: HTTP status 404: content "404 page not found\n"
Error: error from makeRequest: HTTP status 404: content "404 page not found\n"
2021-02-03T14:10:53.250+0200 [WARN] plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
not fail
just do tf plan / apply
amount of 404s each run is different.
I have similar issues when trying to run terraform to update worker config.
Various output from this command -
./run_terraform.sh vivastreet.cl apply
that then ends with -
Error: error from makeRequest: HTTP status 404: content "404 page not foundn"
@riuvshyn I'm afraid I need more information for the reproduction steps and configuration as this doesn't reproduce on just any configuration. Are you able to provide a bare minimum reproduction case on a new installation?
@jamiemil if your issue isn't the same as the original one (resources, steps, etc) please open a new issue following the issue template provided so we can track them separately.
We're already in touch with the CF support team regarding this issue, but wanted to share some context here which would help to reproduce it.
After we start running Terraform in debug mode, not sure if it is limited to, but we identified that /client/v4/zones/:zoneid/custom_pages/:custom_page_type endpoint is returning sporadic 404s. And regardless of Terraform, even a basic curl request is giving the exact same response.
Thanks @canthefason. Looks like this is potential a larger issue with the API and not just Terraform. Let's put this on hold until the internal tickets are addressed.
NOTE: In the meantime, don't terraform apply changes as most resources that hit 404's will remove the resources from the state file and may end up with undesirable side effects.
@riuvshyn @jamiemil @canthefason this issue has been mitigated internally and wasn't related to page rules (or Terraform at all) but instead a change to the custom pages service which, unfortunately, the Terraform output doesn't convey well at all. To make matters worse, reproduction wasn't consistent making the diagnosis more annoying than it needs to be. I'm hoping to have a dig into the debug output in the near future and see what we can do about surfacing more useful errors in these scenarios.
Can you please check your Terraform runs again and confirm you're seeing the issue resolved on your end before I close this out?
thanks for checking in @jacobbednarz, it is all looking good right now.
awesome, i'm going to close this out but feel free to either ping here or the support tickets if you need more information.
@jacobbednarz awesome! yeh page_rules were just a red herring...