Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty error summary when plan encounters 'auth.zone_not_found' #1662

Closed
2 tasks done
d-lord opened this issue Jun 1, 2022 · 1 comment
Closed
2 tasks done

Empty error summary when plan encounters 'auth.zone_not_found' #1662

d-lord opened this issue Jun 1, 2022 · 1 comment
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@d-lord
Copy link

d-lord commented Jun 1, 2022

Confirmation

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

Terraform and Cloudflare provider version

Terraform v0.14.11, provider v3.15.0

Affected resource(s)

cloudflare_record

Terraform configuration files

resource "cloudflare_record" "parking_dmarc" {
  name = "_dmarc.example.com"
  zone_id = "any zone ID as long as it doesn't exist"
  value = "irrelevant"
  type = "TXT"
  proxied = false
  allow_overwrite = false
}

Debug output

2022/06/01 13:35:33 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
  Use TF_LOG=TRACE to see Terraform's internal logs.
  ----
2022/06/01 13:35:34 [INFO] Terraform version: 0.14.11
2022/06/01 13:35:34 [INFO] Go runtime version: go1.15.6
2022/06/01 13:35:34 [INFO] CLI args: []string{"/private/var/tmp/_bazel_dal/59ab09c8acad3ee1d38e4c331dabc57d/execroot/com_canva_infrastructure/bazel-out/darwin-fastbuild/bin/app/cloudflare/parking/terraform-runner-debugging.runfiles/com_canva_infrastructure/../terraform_toolchain_0_14_11_darwin_amd64/terraform", "plan", "-var-file=/private/var/tmp/_bazel_dal/59ab09c8acad3ee1d38e4c331dabc57d/execroot/com_canva_infrastructure/bazel-out/darwin-fastbuild/bin/app/cloudflare/parking/__global-debugging__.tfvars", "-state=/private/var/tmp/_bazel_dal/59ab09c8acad3ee1d38e4c331dabc57d/execroot/com_canva_infrastructure/bazel-out/darwin-fastbuild/bin/app/cloudflare/parking/debugging.tfstate", "-detailed-exitcode=true"}
2022/06/01 13:35:34 [DEBUG] Attempting to open CLI config file: /private/var/tmp/_bazel_dal/59ab09c8acad3ee1d38e4c331dabc57d/execroot/com_canva_infrastructure/bazel-out/darwin-fastbuild/bin/app/cloudflare/parking/terraform-runner-debugging.runfiles/com_canva_infrastructure/../terraform_toolchain_0_14_11_darwin_amd64/.terraformrc
2022/06/01 13:35:34 Loading CLI configuration from /private/var/tmp/_bazel_dal/59ab09c8acad3ee1d38e4c331dabc57d/execroot/com_canva_infrastructure/bazel-out/darwin-fastbuild/bin/app/cloudflare/parking/terraform-runner-debugging.runfiles/com_canva_infrastructure/../terraform_toolchain_0_14_11_darwin_amd64/.terraformrc
2022/06/01 13:35:34 [DEBUG] Not reading CLI config directory because config location is overridden by environment variable
2022/06/01 13:35:34 [ERROR] Error finding global config directory: user: Current requires cgo or $USER, $HOME set in environment
2022/06/01 13:35:34 [WARN] Cannot initialize remote host credentials manager: can't locate credentials file: user: Current requires cgo or $USER, $HOME set in environment
2022/06/01 13:35:34 [DEBUG] Explicit provider installation configuration is set
2022/06/01 13:35:34 [ERROR] Error finding global config directory: user: Current requires cgo or $USER, $HOME set in environment
2022/06/01 13:35:34 [ERR] Checkpoint setup error: user: Current requires cgo or $USER, $HOME set in environment
2022/06/01 13:35:34 [INFO] CLI command args: []string{"plan", "-var-file=/private/var/tmp/_bazel_dal/59ab09c8acad3ee1d38e4c331dabc57d/execroot/com_canva_infrastructure/bazel-out/darwin-fastbuild/bin/app/cloudflare/parking/__global-debugging__.tfvars", "-state=/private/var/tmp/_bazel_dal/59ab09c8acad3ee1d38e4c331dabc57d/execroot/com_canva_infrastructure/bazel-out/darwin-fastbuild/bin/app/cloudflare/parking/debugging.tfstate", "-detailed-exitcode=true"}
2022/06/01 13:35:34 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
  Use TF_LOG=TRACE to see Terraform's internal logs.
  ----
2022/06/01 13:35:34 [DEBUG] New state was assigned lineage "838e9db9-b94f-421d-9d82-8de71d86c353"
2022/06/01 13:35:34 [DEBUG] checking for provisioner in "."
2022/06/01 13:35:34 [DEBUG] checking for provisioner in "/private/var/tmp/_bazel_dal/59ab09c8acad3ee1d38e4c331dabc57d/execroot/com_canva_infrastructure/bazel-out/darwin-fastbuild/bin/app/cloudflare/parking/terraform-runner-debugging.runfiles/terraform_toolchain_0_14_11_darwin_amd64"
2022/06/01 13:35:34 [INFO] Failed to read plugin lock file .terraform/plugins/darwin_amd64/lock.json: open .terraform/plugins/darwin_amd64/lock.json: no such file or directory
2022/06/01 13:35:34 [INFO] backend/local: starting Plan operation
2022-06-01T13:35:34.061+1000 [INFO]  plugin: configuring client automatic mTLS
2022-06-01T13:35:34.086+1000 [DEBUG] plugin: starting plugin: path=/private/var/tmp/_bazel_dal/59ab09c8acad3ee1d38e4c331dabc57d/execroot/com_canva_infrastructure/bazel-out/darwin-fastbuild/bin/app/cloudflare/parking/.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.15.0/darwin_amd64/terraform-provider-cloudflare_v3.15.0 args=[/private/var/tmp/_bazel_dal/59ab09c8acad3ee1d38e4c331dabc57d/execroot/com_canva_infrastructure/bazel-out/darwin-fastbuild/bin/app/cloudflare/parking/.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.15.0/darwin_amd64/terraform-provider-cloudflare_v3.15.0]
2022-06-01T13:35:34.091+1000 [DEBUG] plugin: plugin started: path=/private/var/tmp/_bazel_dal/59ab09c8acad3ee1d38e4c331dabc57d/execroot/com_canva_infrastructure/bazel-out/darwin-fastbuild/bin/app/cloudflare/parking/.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.15.0/darwin_amd64/terraform-provider-cloudflare_v3.15.0 pid=26693
2022-06-01T13:35:34.091+1000 [DEBUG] plugin: waiting for RPC address: path=/private/var/tmp/_bazel_dal/59ab09c8acad3ee1d38e4c331dabc57d/execroot/com_canva_infrastructure/bazel-out/darwin-fastbuild/bin/app/cloudflare/parking/.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.15.0/darwin_amd64/terraform-provider-cloudflare_v3.15.0
2022-06-01T13:35:34.103+1000 [INFO]  plugin.terraform-provider-cloudflare_v3.15.0: configuring server automatic mTLS: timestamp=2022-06-01T13:35:34.103+1000
2022-06-01T13:35:34.121+1000 [DEBUG] plugin: using plugin: version=5
2022-06-01T13:35:34.121+1000 [DEBUG] plugin.terraform-provider-cloudflare_v3.15.0: plugin address: address=/tmp/plugin3014330750 network=unix timestamp=2022-06-01T13:35:34.121+1000
2022-06-01T13:35:34.168+1000 [WARN]  plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2022-06-01T13:35:34.169+1000 [DEBUG] plugin: plugin process exited: path=/private/var/tmp/_bazel_dal/59ab09c8acad3ee1d38e4c331dabc57d/execroot/com_canva_infrastructure/bazel-out/darwin-fastbuild/bin/app/cloudflare/parking/.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.15.0/darwin_amd64/terraform-provider-cloudflare_v3.15.0 pid=26693
2022-06-01T13:35:34.169+1000 [DEBUG] plugin: plugin exited
2022/06/01 13:35:34 [INFO] terraform: building graph: GraphTypeValidate
2022/06/01 13:35:34 [DEBUG] ProviderTransformer: "cloudflare_record.parking_dmarc" (*terraform.NodeValidatableResource) needs provider["registry.terraform.io/cloudflare/cloudflare"]
2022/06/01 13:35:34 [DEBUG] ReferenceTransformer: "cloudflare_record.parking_dmarc" references: []
2022/06/01 13:35:34 [DEBUG] ReferenceTransformer: "var.flavor" references: []
2022/06/01 13:35:34 [DEBUG] ReferenceTransformer: "var.region" references: []
2022/06/01 13:35:34 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/cloudflare/cloudflare\"]" references: []
2022/06/01 13:35:34 [DEBUG] Starting graph walk: walkValidate
2022-06-01T13:35:34.171+1000 [INFO]  plugin: configuring client automatic mTLS
2022-06-01T13:35:34.196+1000 [DEBUG] plugin: starting plugin: path=/private/var/tmp/_bazel_dal/59ab09c8acad3ee1d38e4c331dabc57d/execroot/com_canva_infrastructure/bazel-out/darwin-fastbuild/bin/app/cloudflare/parking/.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.15.0/darwin_amd64/terraform-provider-cloudflare_v3.15.0 args=[/private/var/tmp/_bazel_dal/59ab09c8acad3ee1d38e4c331dabc57d/execroot/com_canva_infrastructure/bazel-out/darwin-fastbuild/bin/app/cloudflare/parking/.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.15.0/darwin_amd64/terraform-provider-cloudflare_v3.15.0]
2022-06-01T13:35:34.199+1000 [DEBUG] plugin: plugin started: path=/private/var/tmp/_bazel_dal/59ab09c8acad3ee1d38e4c331dabc57d/execroot/com_canva_infrastructure/bazel-out/darwin-fastbuild/bin/app/cloudflare/parking/.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.15.0/darwin_amd64/terraform-provider-cloudflare_v3.15.0 pid=26694
2022-06-01T13:35:34.199+1000 [DEBUG] plugin: waiting for RPC address: path=/private/var/tmp/_bazel_dal/59ab09c8acad3ee1d38e4c331dabc57d/execroot/com_canva_infrastructure/bazel-out/darwin-fastbuild/bin/app/cloudflare/parking/.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.15.0/darwin_amd64/terraform-provider-cloudflare_v3.15.0
2022-06-01T13:35:34.211+1000 [INFO]  plugin.terraform-provider-cloudflare_v3.15.0: configuring server automatic mTLS: timestamp=2022-06-01T13:35:34.211+1000
2022-06-01T13:35:34.229+1000 [DEBUG] plugin.terraform-provider-cloudflare_v3.15.0: plugin address: address=/tmp/plugin831526113 network=unix timestamp=2022-06-01T13:35:34.229+1000
2022-06-01T13:35:34.229+1000 [DEBUG] plugin: using plugin: version=5
2022-06-01T13:35:34.284+1000 [WARN]  plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2022-06-01T13:35:34.285+1000 [DEBUG] plugin: plugin process exited: path=/private/var/tmp/_bazel_dal/59ab09c8acad3ee1d38e4c331dabc57d/execroot/com_canva_infrastructure/bazel-out/darwin-fastbuild/bin/app/cloudflare/parking/.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.15.0/darwin_amd64/terraform-provider-cloudflare_v3.15.0 pid=26694
2022-06-01T13:35:34.285+1000 [DEBUG] plugin: plugin exited
2022/06/01 13:35:34 [INFO] backend/local: plan calling Plan
2022/06/01 13:35:34 [INFO] terraform: building graph: GraphTypePlan
2022/06/01 13:35:34 [DEBUG] ProviderTransformer: "cloudflare_record.parking_dmarc (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/cloudflare/cloudflare"]
2022/06/01 13:35:34 [DEBUG] ReferenceTransformer: "cloudflare_record.parking_dmarc (expand)" references: []
2022/06/01 13:35:34 [DEBUG] ReferenceTransformer: "var.flavor" references: []
2022/06/01 13:35:34 [DEBUG] ReferenceTransformer: "var.region" references: []
2022/06/01 13:35:34 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/cloudflare/cloudflare\"]" references: []
2022/06/01 13:35:34 [DEBUG] Starting graph walk: walkPlan
2022-06-01T13:35:34.286+1000 [INFO]  plugin: configuring client automatic mTLS
2022-06-01T13:35:34.311+1000 [DEBUG] plugin: starting plugin: path=/private/var/tmp/_bazel_dal/59ab09c8acad3ee1d38e4c331dabc57d/execroot/com_canva_infrastructure/bazel-out/darwin-fastbuild/bin/app/cloudflare/parking/.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.15.0/darwin_amd64/terraform-provider-cloudflare_v3.15.0 args=[/private/var/tmp/_bazel_dal/59ab09c8acad3ee1d38e4c331dabc57d/execroot/com_canva_infrastructure/bazel-out/darwin-fastbuild/bin/app/cloudflare/parking/.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.15.0/darwin_amd64/terraform-provider-cloudflare_v3.15.0]
2022-06-01T13:35:34.314+1000 [DEBUG] plugin: plugin started: path=/private/var/tmp/_bazel_dal/59ab09c8acad3ee1d38e4c331dabc57d/execroot/com_canva_infrastructure/bazel-out/darwin-fastbuild/bin/app/cloudflare/parking/.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.15.0/darwin_amd64/terraform-provider-cloudflare_v3.15.0 pid=26695
2022-06-01T13:35:34.314+1000 [DEBUG] plugin: waiting for RPC address: path=/private/var/tmp/_bazel_dal/59ab09c8acad3ee1d38e4c331dabc57d/execroot/com_canva_infrastructure/bazel-out/darwin-fastbuild/bin/app/cloudflare/parking/.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.15.0/darwin_amd64/terraform-provider-cloudflare_v3.15.0
2022-06-01T13:35:34.326+1000 [INFO]  plugin.terraform-provider-cloudflare_v3.15.0: configuring server automatic mTLS: timestamp=2022-06-01T13:35:34.326+1000
2022-06-01T13:35:34.344+1000 [DEBUG] plugin: using plugin: version=5
2022-06-01T13:35:34.344+1000 [DEBUG] plugin.terraform-provider-cloudflare_v3.15.0: plugin address: address=/tmp/plugin3669746503 network=unix timestamp=2022-06-01T13:35:34.344+1000
2022-06-01T13:35:34.391+1000 [INFO]  plugin.terraform-provider-cloudflare_v3.15.0: 2022/06/01 13:35:34 [INFO] Cloudflare Client configured for user:: timestamp=2022-06-01T13:35:34.391+1000
2022/06/01 13:35:34 [DEBUG] Resource instance state not found for node "cloudflare_record.parking_dmarc", instance cloudflare_record.parking_dmarc
2022/06/01 13:35:34 [DEBUG] ReferenceTransformer: "cloudflare_record.parking_dmarc" references: []
2022/06/01 13:35:34 [DEBUG] ReferenceTransformer: "cloudflare_record.parking_dmarc[\"example.com\"] (orphan)" references: []
2022/06/01 13:35:34 [DEBUG] refresh: cloudflare_record.parking_dmarc: no state, so not refreshing
cloudflare_record.parking_dmarc["example.com"]: Refreshing state... [id=2f1c742ec5c7fd2987ccc1c084971245]
2022-06-01T13:35:34.395+1000 [INFO]  plugin.terraform-provider-cloudflare_v3.15.0: 2022/06/01 13:35:34 [DEBUG] Cloudflare API Request Details:
---[ REQUEST ]---------------------------------------
GET /client/v4/zones/94ba5561397bab3922d98fcc96f1ba2a/dns_records/2f1c742ec5c7fd2987ccc1c084971245 HTTP/1.1
Host: api.cloudflare.com
User-Agent: terraform/0.14.11 terraform-plugin-sdk/2.10.1 terraform-provider-cloudflare/3.15.0
Authorization: Bearer <REDACTED>
Content-Type: application/json
Accept-Encoding: gzip


-----------------------------------------------------: timestamp=2022-06-01T13:35:34.395+1000
2022-06-01T13:35:34.970+1000 [INFO]  plugin.terraform-provider-cloudflare_v3.15.0: 2022/06/01 13:35:34 [DEBUG] Cloudflare API Response Details:
---[ RESPONSE ]--------------------------------------
HTTP/2.0 404 Not Found
Cf-Cache-Status: DYNAMIC
Cf-Ray: 7144e66a6eabe9bf-BNE
Content-Type: application/json; charset=UTF-8
Date: Wed, 01 Jun 2022 03:35:35 GMT
Expect-Ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Server: cloudflare
Set-Cookie: __cflb=0H28vgHxwvgAQtjUGU4vq74ZFe3sNVUZSdHW9rSMvzR; SameSite=Lax; path=/; expires=Wed, 01-Jun-22 06:05:36 GMT; HttpOnly
Set-Cookie: __cfruid=f03540ccc04ed0813ca8ab3357bf160036407166-1654054535; path=/; domain=.api.cloudflare.com; HttpOnly; Secure; SameSite=None
Vary: Accept-Encoding
X-Envoy-Upstream-Service-Time: 7

{
  "error": "auth.zone_not_found"
}

-----------------------------------------------------: timestamp=2022-06-01T13:35:34.970+1000
2022/06/01 13:35:34 [INFO] backend/local: plan operation completed

Error: Empty Summary: This is always a bug in the provider and should be reported to the provider developers.


2022-06-01T13:35:34.973+1000 [WARN]  plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2022-06-01T13:35:34.974+1000 [DEBUG] plugin: plugin process exited: path=/private/var/tmp/_bazel_dal/59ab09c8acad3ee1d38e4c331dabc57d/execroot/com_canva_infrastructure/bazel-out/darwin-fastbuild/bin/app/cloudflare/parking/.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.15.0/darwin_amd64/terraform-provider-cloudflare_v3.15.0 pid=26695
2022-06-01T13:35:34.974+1000 [DEBUG] plugin: plugin exited

Panic output

No response

Expected output

Terraform would print an error message saying something like:

Zone '94ba5561397bab3922d98fcc96f1ba2a' not found while refreshing state for 'cloudflare_record.parking_dmarc["example.com"]'

Actual output

Terraform prints:

Error: Empty Summary: This is always a bug in the provider and should be reported to the provider developers.

Steps to reproduce

  1. Ensure you have an API token with (I'm guessing) read access to list zones and DNS records.
  2. terraform plan the above configuration.
  3. Observe the error message at the bottom.

Additional factoids

Ran into this while refreshing state for a big list of domains, one of which had been removed from our account. It took some work to track down, but would have been a cinch with an error message provided :)

Refreshing state for multiple records (eg all relating to the same missing zone) will produce an equal number of errors with "Empty Summary".

Thanks for making this provider available!

References

Looks a bit like #1621, but that relates to apply and shows a different error.

@d-lord d-lord added kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jun 1, 2022
@jacobbednarz
Copy link
Member

there are a couple of things to note here. the first is that this wouldn't have been caught by the error handling as the payload isn't compatible with our v4 envelope. it depends on the structure being correct otherwise it raises a generic error (basically what we have here). i've checked internally and this should now be rectified. the second part of this that we adjusted the error handling via #1740 (v3.19.0) so this should now be handled automatically.

i'm going to close this off as a dependant of #1740 but do let me know if you're still seeing this on the newer versions.

@jacobbednarz jacobbednarz removed the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Sep 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

2 participants