You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When DNS resolver is misconfigured (it happened to me in Docker container after suspending laptop and resuming in other network), the terraform plan command fails on SIGSEGV. I'm using remote backend on app.terraform.io.
Hopefully, terraform workspace list handles error correctly with a reasonable error message Error: Failed to request discovery document: Get https://app.terraform.io/.well-known/terraform.json: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
Terraform Version
Terraform v0.12.9
+ provider.aws v2.31.0
Terraform Configuration Files
Not relevant for this issue
Debug Output
Pasting debug output here since it's very short (TF fails soon):
TF_LOG=TRACE terraform apply /tmp/plan
2019/10/07 10:27:18 [INFO] Terraform version: 0.12.9
2019/10/07 10:27:18 [INFO] Go runtime version: go1.12.9
2019/10/07 10:27:18 [INFO] CLI args: []string{"/bin/terraform", "apply", "/tmp/plan"}
2019/10/07 10:27:18 [DEBUG] Attempting to open CLI config file: /root/credentials.tf
2019/10/07 10:27:18 Loading CLI configuration from /root/credentials.tf
2019/10/07 10:27:18 [INFO] CLI command args: []string{"apply", "/tmp/plan"}
2019/10/07 10:27:18 [TRACE] Meta.BackendForPlan: instantiated backend of type *remote.Remote
2019/10/07 10:27:18 [DEBUG] Service discovery for app.terraform.io at https://app.terraform.io/.well-known/terraform.json
2019/10/07 10:27:29 [DEBUG] checking for provider in "."
2019/10/07 10:27:29 [DEBUG] checking for provider in "/bin"
2019/10/07 10:27:29 [DEBUG] checking for provider in ".terraform/plugins/linux_amd64"
2019/10/07 10:27:29 [DEBUG] found provider "terraform-provider-aws_v2.31.0_x4"
2019/10/07 10:27:29 [DEBUG] found valid plugin: "aws", "2.31.0", "/root/aws/.terraform/plugins/linux_amd64/terraform-provider-aws_v2.31.0_x4"
2019/10/07 10:27:29 [DEBUG] checking for provisioner in "."
2019/10/07 10:27:29 [DEBUG] checking for provisioner in "/bin"
2019/10/07 10:27:29 [DEBUG] checking for provisioner in ".terraform/plugins/linux_amd64"
2019/10/07 10:27:29 [TRACE] Meta.BackendForPlan: backend *remote.Remote supports operations
looks like some error checking on the Configure stage isn't well handled in command/meta_backend.go, func BackendForPlan
I've tried the following patch, seems to work
diff --git a/command/meta_backend.go b/command/meta_backend.go
index c62be4630..ad51ef681 100644
--- a/command/meta_backend.go+++ b/command/meta_backend.go@@ -246,6 +246,9 @@ func (m *Meta) BackendForPlan(settings plans.Backend) (backend.Enhanced, tfdiags
configureDiags := b.Configure(newVal)
diags = diags.Append(configureDiags)
+ if configureDiags.HasErrors() {+ return nil, diags+ }
// If the backend supports CLI initialization, do it.
if cli, ok := b.(backend.CLI); ok {
now I get a proper message when applying from plan file
$ terraform apply tfplan
Error: Failed to request discovery document: Get https://app.terraform.io/.well-known/terraform.json: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
When DNS resolver is misconfigured (it happened to me in Docker container after suspending laptop and resuming in other network), the
terraform plan
command fails on SIGSEGV. I'm using remote backend onapp.terraform.io
.Hopefully,
terraform workspace list
handles error correctly with a reasonable error messageError: Failed to request discovery document: Get https://app.terraform.io/.well-known/terraform.json: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
Terraform Version
Terraform Configuration Files
Not relevant for this issue
Debug Output
Pasting debug output here since it's very short (TF fails soon):
Crash Output
see crash.log
Expected Behavior
A self-explanatory error message like
Cannot resolve host app.terraform.io: Network timeout
or so.Actual Behavior
SIGSEGV crash
Steps to Reproduce
/etc/resolv.conf
to an unreachable addressterraform apply
Additional Context
N/A
References
N/A
The text was updated successfully, but these errors were encountered: