-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Terraform init with etcdv3 backend hangs on failed SSL handshake #19185
Comments
When cert_path and key_path are not specified, openssl indicates a bad certificate error:
When cert_path and key_path are specified the SSL connection is successful:
|
seems to be happening with 0.12.26 still. |
Still happening with Terraform v0.12.28 |
In case this helps, here is how our team's internal docs describe what to do in this situation (assuming it is the same problem we see): Terraform hangs on terraform initIf Terraform hangs during terraform init and etcdv3 backend is configured, please make sure that backend endpoints are configured correctly. List of endpoints should contain ETCD endpoint hostname and port with protocol scheme. The reason for that is that the Databases for ETCD cluster is hidden behind a load balancer which terminates SSL. As a consequence, instead validating the ETCD certificate for the ETCD cluster using the client library, Terraform validates the SSL connection for the load balancer using the system trusted CA store. This means that backend SSL configuration in Terraform does not have any effect. Terraform is unable to verify SSL certificateIf Terraform reports certificate validation errors for the backend, make sure you have added the CA certificate provided to system wide trusted certificates store. To get CA certificate for SSL connection setup if you do not have it handy:
For instance, on macOS it should be added to System Keychain, under Certificates section, and it's trust settings should be switched to Always trust. |
This tripped me up today also, because In my case it appears to be that golang DNS resolution is failing. I am working locally with terraform source which has an this leads me to believe that when it would be very helpful if there was some diagnostic output to help identify |
Still happening with Terraform v0.13.4. |
still happeinging with Terraform v0.14.5. Is anyone actively working on this issue? Thanks. |
I had the exact same issue. Check out my pull request Maybe you can test the pull and write a comment. |
Hello! Thanks for reporting this. We removed the etcd backends in Terraform v1.3 because they hasn't had a dedicated maintainer for a few versions now and so they were becoming problematic to keep working in newer Terraform versions. Since these backend are no longer present in the Terraform codebase, I'm going to close this issue. If you're currently using one of these backends with an older version of Terraform, see Removal of Deprecated State Storage Backends in the Terraform v1.3 upgrade guide for some information on the available options for migration. Thanks again! |
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. |
Terraform Version
Terraform Configuration Files
Debug Output
https://gist.github.com/smayre/c63136ca127ce5b5ee4a3a6fede54d2d
Crash Output
None
Expected Behavior
Terraform should initialise successfully.
Actual Behavior
Terraform hangs and produces no additional output.
No keys are created in etcd.
Steps to Reproduce
With the above configuration file:
terraform init
Additional Context
My trouble shooting indicates that Terraform is not successfully completing the SSL handshake.
It appears that even though cert_path and key_path options are not specified, terraform still tries to send a client certificate. This 'certificate' is invalid and causes a 'bad certificate' error and the SSL handshake fails. Terraform does not handle this gracefully and hangs.
If cert_path and key_path are specified then terraform initialises successfully as expected.
Note: in either case my etcd is not configured to perform client cert authentication.
References
The text was updated successfully, but these errors were encountered: