Closed mcat-ee closed 1 year ago
I modified the example to create an A
record as follows:
resource "porkbun_dns_record" "ns_records" {
domain = local.top_level_domain
name = local.subdomain
type = "A"
content = "127.0.0.1"
notes = "Test case!"
}
This results in the following plan:
# porkbun_dns_record.ns_records will be created
+ resource "porkbun_dns_record" "ns_records" {
+ content = "127.0.0.1"
+ domain = "example.info"
+ id = (known after apply)
+ name = "testing"
+ notes = "Test case!"
+ type = "A"
}
It appears to have the same result:
porkbun_dns_record.ns_records: Creating...
porkbun_dns_record.ns_records: Still creating... [10s elapsed]
porkbun_dns_record.ns_records: Still creating... [20s elapsed]
porkbun_dns_record.ns_records: Still creating... [30s elapsed]
porkbun_dns_record.ns_records: Still creating... [40s elapsed]
porkbun_dns_record.ns_records: Still creating... [50s elapsed]
These are the DEBUG logs when the interrupt is triggered - it looks like the Provider plugin might be encountering an unhandled EOF from Porkbun?
porkbun_dns_record.ns_records: Still creating... [9m0s elapsed]
^C
Interrupt received.
Please wait for Terraform to exit or data loss may occur.
Gracefully shutting down...
Stopping operation...
2023-03-22T12:05:38.424+1030 [WARN] terraform: Stop called, initiating interrupt sequence
2023-03-22T12:05:38.424+1030 [WARN] terraform: run context exists, stopping
2023-03-22T12:05:38.424+1030 [INFO] terraform: waiting for graceful stop to complete
^C
Two interrupts received. Exiting immediately. Note that data loss may have occurred.
2023-03-22T12:05:42.258+1030 [WARN] running operation was forcefully canceled
╷
│ Error: operation canceled
│
│
╵
2023-03-22T12:05:42.262+1030 [ERROR] plugin6.(*GRPCProvider).ApplyResourceChange: error="rpc error: code = Unavailable desc = error reading from server: EOF"
2023-03-22T12:05:42.262+1030 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2023-03-22T12:05:42.264+1030 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/cullenmcdermott/porkbun/0.2.0/darwin_arm64/terraform-provider-porkbun_v0.2.0 pid=20671
2023-03-22T12:05:42.264+1030 [DEBUG] provider: plugin exited
Thanks for the report and the details. I have been busy with some other stuff so I haven't had a chance to look into this yet but I will try to soon!
I'm facing a similar issue, has any of you find a way to solve it? Thanks by this library btw, I was not aware I could control the DNS with terraform 🚀
I have also encountered similar behavior and in my case it was caused by the domain name not "Enabled for API access".
I have also submitted a PR to fix error handling by surfacing the error immediately instead of hanging forever. If enabling the domain for API access doesn't help you, you can preview the fix by following the terraform provider development overrides to point your terraform at the binary built from the PR branch.
v0.2.1 is available on the registry (thank you @parabolala). If this doesn't fix the original issue then please reach back out on this or a new issue with TF_LOG=debug
set and logs attached and I'll take look (and not forget about it this time 😄 )
Thanks for developing this provider plugin!
The issue
When I attempt to generate an NS record using the provider, it appears to perpetually hang (alt-tabbing to my terminal, the current attempt to create 4 records is up to
Still creating... [8m50s elapsed]
Use case
I'm creating a hosted zone in AWS for a subdomain on an externally-hosted DNS provider, and then attempting to create NS records in Porkbun.
Example Terraform config
This results in the following plan:
Expected Result
The NS record is created in <30 seconds
Actual Result
When the plan is
apply
ed, the logs are as follows:Interestingly, using the
ctrl+c
interrupt at this point raises the messagePlease wait for Terraform to exit or data loss may occur. Gracefully shutting down..
but theStill creating...
logs continue to be printed.