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

Error: could not read response body: %!w(<nil>) #1850

Closed
2 tasks done
goressss opened this issue Aug 22, 2022 · 5 comments
Closed
2 tasks done

Error: could not read response body: %!w(<nil>) #1850

goressss opened this issue Aug 22, 2022 · 5 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/needs-information Indicates an issue needs more information in order to work on it.

Comments

@goressss
Copy link

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 version: 1.0.7
cloudflare provider version: 3.20.0 and we updated provider to latest version 3.21.0

Affected resource(s)

cloudflare/cloudflare
This is an issue with the terraform cloudflare provider.

Terraform configuration files

resource "cloudflare_record" "mx-5-1" {
  zone_id  = local.cf_zone_id
  name     = local.cf_zone
  value    = "alt1.aspmx.l.google.com"
  type     = "MX"
  priority = "5"
}

Debug output

I don't think it's interesting for this issue

Panic output

No response

Expected output

│ Error: could not read response body: %!w()

│ with module..cloudflare_record.mx-5-1,
│ on domains/
**/external.tf line 46, in resource "cloudflare_record" "mx-5-1":
│ 46: resource "cloudflare_record" "mx-5-1" {

Actual output

No changes. Your infrastructure matches the configuration.

Steps to reproduce

terraform plan

Additional factoids

No configuration manipulations were carried out, at one point when planning the terraform, errors began to occur on all domains, cloudflare records, etc.
updated the provider to the latest version, the errors were not corrected.
at the moment, when setting the parameter parallelism=1, the errors go away, but the planning stage takes a very long time, with values ​​of parallelism above 1, errors begin to appear.

References

No response

@goressss goressss 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 Aug 22, 2022
@github-actions
Copy link
Contributor

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.

@github-actions github-actions bot added triage/needs-information Indicates an issue needs more information in order to work on it. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Aug 22, 2022
@goressss
Copy link
Author

2022-08-22T12:46:07.570Z [DEBUG] provider.terraform-provider-cloudflare_v3.21.0: Cloudflare API Request Details:
---[ REQUEST ]---------------------------------------
GET /client/v4/zones//dns_records/** HTTP/1.1
Host: api.cloudflare.com
User-Agent: terraform/1.0.7 terraform-plugin-sdk/2.10.1 terraform-provider-cloudflare/dev
Authorization: Bearer **************
Content-Type: application/json
Accept-Encoding: gzip
-----------------------------------------------------: timestamp=2022-08-22T12:46:07.570Z
2022-08-22T12:46:07.654Z [DEBUG] provider.terraform-provider-cloudflare_v3.21.0: Cloudflare API Response Details:
---[ RESPONSE ]--------------------------------------
HTTP/2.0 429 Too Many Requests
Connection: close
Cache-Control: no-cache
Cf-Ray: 73ebb5a1bb8cbca6-ALA
Content-Type: application/json
Date: Mon, 22 Aug 2022 12:46:07 GMT
Expect-Ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Retry-After: 248
Server: cloudflare
Vary: Accept-Encoding
{
"success": false,
"errors": [
{
"code": 971,
"message": "Please wait and consider throttling your request speed"
}
],
"messages": [],
"result": null
}
-----------------------------------------------------: timestamp=2022-08-22T12:46:07.654Z
2022-08-22T12:46:07.654Z [ERROR] provider.terraform-provider-cloudflare_v3.21.0: Response contains error diagnostic: diagnostic_detail= diagnostic_summary="could not read response body: %!w()" tf_proto_version=5.3 tf_provider_addr=registry.terraform.io/cloudflare/cloudflare @caller=github.com/hashicorp/[email protected]/tfprotov5/internal/diag/diagnostics.go:56 @module=sdk.proto tf_resource_type=cloudflare_record tf_rpc=ReadResource diagnostic_severity=ERROR tf_req_id=1da5610a-7415-1cbe-8bd7-4caef68dab83 timestamp=2022-08-22T12:46:07.654Z

@goressss
Copy link
Author

GET /client/v4/zones//dns_records/** HTTP/1.1
Host: api.cloudflare.com
User-Agent: terraform/1.0.7 terraform-plugin-sdk/2.10.1 terraform-provider-cloudflare/dev
Authorization: Bearer ****
Content-Type: application/json
Accept-Encoding: gzip
-----------------------------------------------------: timestamp=2022-08-22T12:45:02.066Z
2022-08-22T12:45:02.449Z [DEBUG] provider.terraform-provider-cloudflare_v3.21.0: Cloudflare API Response Details:
---[ RESPONSE ]--------------------------------------
HTTP/2.0 429 Too Many Requests
Connection: close
Cf-Cache-Status: DYNAMIC
Cf-Ray: 73ebb4010dcebcb2-ALA
Content-Type: application/json
Date: Mon, 22 Aug 2022 12:45:02 GMT
Expect-Ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Server: cloudflare
Set-Cookie: __cflb=0H28vgHxwvgAQtjUGU56Rb8iNWZVUvXhtwzU7cGeyX3; SameSite=Lax; path=/; expires=Mon, 22-Aug-22 15:15:03 GMT; HttpOnly
Set-Cookie: __cfruid=03d346db192ddd7ddce0b92b134784fdc06acef2-1661172302; path=/; domain=.api.cloudflare.com; HttpOnly; Secure; SameSite=None
Vary: Accept-Encoding
{
"success": false,
"errors": [
{
"code": 10000,
"message": "Rate limited. Please wait and consider throttling your request speed"
}
]
}
-----------------------------------------------------: timestamp=2022-08-22T12:45:02.448Z
2022-08-22T12:45:02.854Z [DEBUG] provider.terraform-provider-cloudflare_v3.21.0: Cloudflare API Request Details:

@garrettgalow
Copy link
Contributor

From the debug logs, it looks like you are getting rate limited. If you are an enterprise customer you can reach out to your account team about getting a higher rate limit, otherwise you will need to reduce the rate you make calls. That is likely why the parallelism setting is affecting this.

@jacobbednarz
Copy link
Member

there is a fix in the underlying library (cloudflare/cloudflare-go#1043) to propagate the out of retries condition to the end user which is what is lacking here at the moment. if you build the current version of master, you can get the changes now.

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. triage/needs-information Indicates an issue needs more information in order to work on it.
Projects
None yet
Development

No branches or pull requests

3 participants