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
Improve "terraform init" error message when requiring sudo #24901
Comments
terraform init doesn't normally require sudo. Can you tell me why you think this was sudo-related? |
@danieldreier See reference Issue and this is why I tried sudo and it ended up working for me |
@lamw that referenced issue ended somewhat ambiguously, and I don't have enough data on your particular issue to confirm that it's the same, so I'd like to start over troubleshooting-wise. Can you please include the output of a terraform init when you run |
Sure. Here's the output
Also, if I manually curl
|
Interesting. I'm surprised to see this fail and curl work. Do you have to configure a VPN or proxy for any of your other applications? |
Disconnected all VPNs already, no proxy of any sorts. I've even dropped my network interface and re-added (in case there were any issues). Same behavior :( |
This is absolutely odd. Is it possible you have If that is not the case, my next suggestion would be to try creating a different user account on your mac and running from there to check the different between that vs actually needing root permissions. |
I have a similar issue. Even root does not seem to fix the issue. I am running the whole thing within a docker container. HTTP_PROXY and HTTPS_PORXY are unset I am using hashicorp/terraform:0.12.26 For debugging purposes, I did a curl before init. Curl works fine
|
@rnsv are you able to share the dockerized environment where you're able to reproduce this? |
Finally solved this problem and thanks to https://discuss.hashicorp.com/t/error-when-running-terraform-init/3135/4?u=lamw This was PITA to figure out the issue and it would be really nice to see this enhanced for when this occurs as it has nothing to do with not being able to connect to registry. I don't even why these expired certs are considered "valid" even though they expired but could be due to Microsoft RDP mentioned in thread which I also use |
Terraform Version
Expected Behavior
If sudo or elevated privileges is required, the error message should state as such rather than connectivity issue which is miss-leading and incorrect.
Actual Behavior
The error thrown when performing
terraform init
on my MacOS system was that it was unable to reach TF Registry.Steps to Reproduce
References
The text was updated successfully, but these errors were encountered: