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

data-source/dns_txt_record_set: Large (>512 byte) Records Return Errors #157

Closed
bflad opened this issue Jul 26, 2021 · 2 comments · Fixed by #199
Closed

data-source/dns_txt_record_set: Large (>512 byte) Records Return Errors #157

bflad opened this issue Jul 26, 2021 · 2 comments · Fixed by #199
Assignees
Labels

Comments

@bflad
Copy link
Contributor

bflad commented Jul 26, 2021

Terraform Version

Terraform v1.0.3
on darwin_amd64

Affected Data Source

  • dns_txt_record_set

Terraform Configuration Files

data "dns_txt_record_set" "test" {
  host = "terraform.io"
}

Expected Behavior

Successful data source results, with 7 records.

Actual Behavior

=== RUN   TestAccDataDnsTxtRecordSet_Basic
    data_dns_txt_record_set_test.go:13: Step 1/1 error: Error running pre-apply refresh: exit status 1
        2021/06/24 15:53:58 [DEBUG] Using modified User-Agent: Terraform/0.12.30 HashiCorp-terraform-exec/0.13.3
        
        Error: error looking up TXT records for "terraform.io": lookup terraform.io on 127.0.0.53:53: no such host
        
          on terraform_plugin_test.tf line 2, in data "dns_txt_record_set" "test":
           2: data "dns_txt_record_set" "test" {
--- FAIL: TestAccDataDnsTxtRecordSet_Basic (0.59s)
    data_dns_txt_record_set_test.go:13: Step 1/1 error: Error running pre-apply refresh: exit status 1
        Error: error looking up TXT records for "terraform.io": lookup terraform.io on 192.168.69.1:53: cannot unmarshal DNS message
          on terraform_plugin_test.tf line 2, in data "dns_txt_record_set" "test":
           2: data "dns_txt_record_set" "test" {

Same occurs across other large TXT records, such as:

  • google.com (625 bytes locally)
  • hashicorp.com (950 bytes locally)

Steps to Reproduce

  1. go test -count=1 -run=TestAccDataDnsTxtRecordSet_Basic -v ./internal/provider on main (soon to be its own test)

Important Factoids

# Note: MSG SIZE and EDNS being enabled

$ dig TXT terraform.io

; <<>> DiG 9.10.6 <<>> TXT terraform.io
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 13897
;; flags: qr rd ra; QUERY: 1, ANSWER: 7, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;terraform.io.			IN	TXT

;; ANSWER SECTION:
terraform.io.		300	IN	TXT	"google-site-verification=LQZvxDzrGE-ZLudDpkpj-gcXN-5yF7Z6C-4Rljs3I_Q"
terraform.io.		300	IN	TXT	"_globalsign-domain-verification=O81xyb7YxpdGeHWkniit_VBT4vTXz9__NFrNMoTwFg"
terraform.io.		300	IN	TXT	"google-site-verification=y974ACvos30pN7_OBgEZb_byZV8qYtK0G6WZfE7OX8s"
terraform.io.		300	IN	TXT	"google-site-verification=8d7FpfB8aOEYAIkoaVKxg7Ibj438CEypjZTH424Pews"
terraform.io.		300	IN	TXT	"google-site-verification=9D7erI6Bfd9EOHKSIXRe0XQaqAFAjToBtZmyYRzMm34"
terraform.io.		300	IN	TXT	"v=spf1 -all"
terraform.io.		300	IN	TXT	"keybase-site-verification=5HKqMvJnTWpe8W-Aa8r0y3wuy1bhQ6LwcjaxKE9BOQU"

;; Query time: 22 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Mon Jul 26 09:53:53 EDT 2021
;; MSG SIZE  rcvd: 558

# dig will automatically failover to TCP, which Go's stub resolver may not

$ dig +noedns TXT terraform.io
;; Truncated, retrying in TCP mode.

; <<>> DiG 9.10.6 <<>> +noedns TXT terraform.io
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 60177
;; flags: qr rd ra; QUERY: 1, ANSWER: 7, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;terraform.io.			IN	TXT

;; ANSWER SECTION:
terraform.io.		203	IN	TXT	"_globalsign-domain-verification=O81xyb7YxpdGeHWkniit_VBT4vTXz9__NFrNMoTwFg"
terraform.io.		203	IN	TXT	"keybase-site-verification=5HKqMvJnTWpe8W-Aa8r0y3wuy1bhQ6LwcjaxKE9BOQU"
terraform.io.		203	IN	TXT	"google-site-verification=9D7erI6Bfd9EOHKSIXRe0XQaqAFAjToBtZmyYRzMm34"
terraform.io.		203	IN	TXT	"v=spf1 -all"
terraform.io.		203	IN	TXT	"google-site-verification=LQZvxDzrGE-ZLudDpkpj-gcXN-5yF7Z6C-4Rljs3I_Q"
terraform.io.		203	IN	TXT	"google-site-verification=8d7FpfB8aOEYAIkoaVKxg7Ibj438CEypjZTH424Pews"
terraform.io.		203	IN	TXT	"google-site-verification=y974ACvos30pN7_OBgEZb_byZV8qYtK0G6WZfE7OX8s"

;; Query time: 12 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Mon Jul 26 09:55:30 EDT 2021
;; MSG SIZE  rcvd: 547

Failures can be influenced by intermediate DNS resolvers changing the response message size.

References

@bflad
Copy link
Contributor Author

bflad commented Feb 22, 2022

This should be partially resolved with golang/go#51127 with Go 1.18 and more fully if EDNS support is added in Go 1.19.

@bflad bflad self-assigned this Mar 21, 2022
bflad added a commit that referenced this issue Mar 21, 2022
Reference: golang/go#51127
Reference: #157
Reference: #188

Updates the testing and release processes to the latest 1.16.x version, which resolves a longstanding Go resolver issue with responses greater than 512 bytes. Verifies by enabling a previously skipped acceptance test.

Also adds CHANGELOG entries for upstream module updates which are bundled with this provider release, which may fix specific EDNS handling issues.
bflad added a commit that referenced this issue Mar 21, 2022
Reference: golang/go#51127
Reference: #157
Reference: #188

Updates the testing and release processes to the latest 1.16.x version, which resolves a longstanding Go resolver issue with responses greater than 512 bytes. Verifies by enabling a previously skipped acceptance test.

Also adds CHANGELOG entries for upstream module updates which are bundled with this provider release, which may fix specific EDNS handling issues.
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant