-
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/apply kills Macbook Pro M1 Network connection #349 #31467
Comments
Thanks for the issue. This is certainly quite concerning, though I'm glad you can use the AMD binaries as a workaround. We haven't been able to reproduce this issue on M1 laptops, so there could be something about your system that causes this to happen. Perhaps there is some security software installed, a proxy, or some other customisation? Does this problem happen only with Terraform, or with other programs (especially other Go binaries)? |
Hi @kmoe |
Hi @jeff-auth0, you might consider posting this in the Community Forum as well as on the Apple Forums. This is unlikely to be a bug in Terraform, as this is the first report in the 19 months since the release of the M1 chipset. However, I will leave this open for now just in case others have this same issue and can offer a reproducible use case. Out of curiosity, did you use Migration Assistant to go from Intel to M1? I initially used Migration Assistant, which I had been using on Intel Macs since 2007, and it caused bizarre, inexplicable problems. I had to reinstall MacOS from scratch and manually move my data and reinstall my applications. You may not have that issue, that was just my personal experience. |
Hi folks, Thanks for help |
@jeff-auth0 thanks for sharing this issue and the workaround. I had been stuck on this same issue for several days and disabling IPv6 also resolved it for me. I am also on Macbook Pro M1 |
Can we get this issue opened again? Disabling IPv6 is not a fix. When I run terraform init it completely breaks the system networking. |
@ryankearney As far as i know this is not terraform issue. Try restarting laptop after disabling IPv6. Just curious how did you disable IPv6 ? |
@jeff-auth0 I changed "Configure IPv6" to "Link-local only" on my primary/active adapter. Only then did terraform plan (or running VS Code with the HashiCorp Terraform extension installed) not break networking. I just installed terraform today on a M1 MacBook Pro and had this issue and a Google search led me here. I will reformat my laptop in the future and only install homebrew and terraform to test, but either the terraform binary is breaking networking, or it's triggering something else installed which is causing networking to break. Some network level apps I have installed are Little Snitch, PaloAlto Global Protect VPN Client, ProtonVPN, and Docker. |
@ryankearney VPN's and firewall can block terraform connections. As long as you can use terraform init/plan and other commands now then you don't need to format your laptop. |
@jeff-auth0 I understand how VPNs and firewalls work, thanks though. Disabling IPv6 is not a solution. |
I am still facing this issue. If I try: terraform apply or plan, it takes looong time to refresh the state and it works sometimes at the end of the long wait. Manytimes, I had to interrupt the process as it takes too long and also blocks my network connection... |
I'm facing this issue on a non M1 mac, and it doesn't happen consistently. For example I managed to plan/apply my terraform code, but on subsequent plans the network crash happens. From what I can tell this may not be directly caused by terraform, but by the AWS provider as the issue happens when I kill that process. Is anyone else who is having this issue also seeing it with the AWS provider, and does killing that process when terraform hangs also cause the crash? |
@HarryTennent I haven't tested with the AWS provider, but it's happening 100% of the time for me with the Azure provider. Also happens by simply having the official Terraform extension installed in VS Code and I open a .tf file. Whatever the extension is invoking behind the scenes is crashing the network stack as well. |
Same here on MacBook Pro M2, sometime |
I am going to re-open this, even though it is highly unlikely that it is an issue with the code of Terraform itself. I tried searching go/golang for relevant issues, but my searching did not reveal anything relevant. If anyone happens across relevant-looking open golang networking issues, please let us know here so we can track it. |
Thank you @crw I have 2 M1 MacBook Pros and only one of them exhibits this behavior when connected to the same network. The one having the issue is due for a clean wipe anyway, so I will use this opportunity to try removing Little Snitch, all the VPN clients, and other things that could interact with the network stack to figure out what terraform might be interacting with that causes this. |
I have the exact same problem on M1 silicon! But it only happens when I tether from my iPhone, I don't have any problems on wireless or ethernet connection at home. As soon as I run terraform plan, destroy or apply my connection drops when tethered. It could be a coincidence but this problem only appeared after installing 12.5.1. Update: Setting my tethered wireless connection to link local for IPv6 works around the issue for me. Interestingly trying to download the Terraform installer from the Hashicorp website would also hang prior to the workaround... |
I'm also having this issue on a Intel Macbook. Terraform plan/apply freezes the network stack and the macbook becomes pretty much unusable running with latest version of terraform installed through homebrew on macos version 12.5.1 (haven't used terraform before). Edit: |
Disabling ipv6 on macos solved the problem, I hope this gets fixed soon. |
The closest relevant issue in the Go repository is golang/go#52839. Current hypothesis as to the conditions needed to produce this issue:
Please comment if you are able to reproduce this issue without all of the above conditions, e.g. if you are not using IPv6. At this point I assume the architecture question (AMD vs ARM) is a red herring. Request for reproductionsIf you are able to reproduce this issue with any reliability, I'd be grateful if you can try the following:
Please comment saying whether this fixes the issue or not and showing the output of Terraform. |
Great find @kmoe I can confirm the existence of an IPv6 link-local DNS resolver. Additionally, if I manually configure my resolvers such that no link-local addresses are present (while still maintaining the rest of my machines IPv6 configuration), then I do not exhibit this behavior. |
@kmoe I am able to reproduce the issue 100% of times I run I also followed your steps to build from source. go version go1.19 darwin/arm64 I ran Happy to compile with different flags and other versions of go at your request. |
Terraform v1.3.1, which will be released later today, may fix this issue. Please re-test when available. @ryankearney I am particularly concerned with the behaviour you have seen because it seems to disprove the hypothesis in #31467 (comment). I'd be grateful if you could re-run the command with @tpolekhin, this looks to be a separate, though likely related, bug. If Terraform v1.3.1 does not resolve this then please open a separate GitHub issue. Since none of the Terraform devs have been able to reproduce this, we're currently debugging this one blind, which is not ideal. Thanks for your patience and responses. |
I've been getting this as well, and upgrading to 1.3.1 doesn't seem to have fixed it |
The amd64 version seems to work fine. However, I've noticed that connecting using my home internet (1GBps, but supports IPv6) is significantly slower than via my phone (4G, but doesn't support IPv6) |
Bump. Fresh new mac book with m2 and terraform 1.3.2 - terraform apply kills network and the rest of mac os system. |
I've been experiencing this for months now, over 2 different M1 Macbooks. Everything typically works fine for a few months then suddenly every time I run a terraform command the network dies, and any app using the network connection has to be force quit, and ultimately my laptop rebooted. Was driving me nuts until I found this post. Update: Disabling IPv6 fixed the issue |
Terraform 1.3.3 still has this problem. If my WiFi has IPv6 enabled then running |
Unfortunately disabling IPv6 does not work for me on Intel Mac. Running |
@d4rky-pl this is likely a different issue that will not be solved via this ticket; I am not aware of an issue open that fits your description. Specifically the impact on Intel macOS, vs Apple Silicon, and the fact that it does not seem to be connected to IPv6. If it persists, please consider opening a new issue. Thanks! @pacorreia similarly, since this issue is targeting Apple Silicon macOS, I do not know that a fix from this issue will help you in WSL. That said if we do find a root cause and fix for this issue, it may be worth retesting. Thanks! |
In my case what was discovered was weird, if I point Wsl to solve dns using my home gateway ip, somehow terraform/go dns gives preference to ipv6 record which can't be solved inside WSL. But when I reverted it to use the host Nat ip address then it started behaving by solving dns using ipv4 record. really weird |
For what it's worth, I've experienced this issue very strongly on an 2019 Intel Mac. Now I've upgraded to MacOS Ventura 13.0.1, and I no longer have any issues whatsoever(using terraform 1.3.2 currently). |
@crw I'm not sure if it's the different issue or not but for me a workaround was to connect using Wi-Fi tethering to my Android phone which seems to be exact opposite of someone here reported earlier. I'll try to debug this issue more in-depth later and report a new issue if I figure out what's the combination of things that may be causing it (it could still be somehow IPv6 related). |
M1 MacBook Pro (Ventura 13.0.1) terraform init and targeted (small) terraform plans work fine Large terraform plans kill my network connectivity, network connectivity is restored after the plan has errored out Things I've tried:
All with the same outcome |
Intel MacBook (Monterey 12.5), disabling IPv6 did not help. This workaround to list GCP APIs in
|
Same issue occurred for me on my 2021 Macbook pro M1 Max, only happens when I tethered to my mobile hotspot. After configuring ipv6 to |
I've switched from Intel to M2 Macbook and the problem still persists. Any news? |
Checking the upstream issue per #31467 (comment), I do not see any progress. I'd imagine that would need to be fixed for this issue to move forward. |
There is something very odd going on in the Mac network stack that extends beyond Terraform here. Naturally I'd enjoy a clever hack within Terraform that can get around this, but it seems unlikely to surface while golang/go#52839 remains open. |
My terraform init/plan/apply operations on the m1 take FOREVER. FOREVER. I didn't even realize it wasn't supposed to be this slow until after I installed terraform into an x86_64 EC2 machine, and saw the difference. Without exaggeration, I've probably lost WEEKS of my life and productivity over the last year, working with terraform in this kind of half-working, slow state. It's absolutely ABSURD. None of the suggestions mentioned in this thread are helping, at all, in any way. Compared to the way it runs on my EC2, this is absolutely unusable and unproductive. Frankly, I'm floored. |
Same issue on a brand new M2 MBP. |
I encountered the same issue using Terraform v1.2.3 on the darwin_arm64 platform (MacBook Pro M2). Interestingly, the setup first worked for 6 months without any problems, and from one day to another, all outgoing requests for Terraform were slowed down significantly. After a few hours of debugging, the only thing that helped was to switch to the darwin_amd64 version of Terraform, where the issue was instantly resolved. |
For me the workaround was to use local DNS server (cloudflared) and pointing system DNS settings to it. |
I'm experiencing this same issues on a Windows 10 PC, running Terraform plan on WSL in a ubuntu-20.04 container. Terraform plan progresses veeery slowly, and the internet connection on my host also slows down, until my entire host loses its internet connection and the TF plan fails. |
Has there been any update on this one? I'm still getting this problem in Feb 2024. Mac OS 14.2.1 None of this seemed to resolve the issue. Does anyone know where it's at or a solid work around other than to use the AMD version or disable IPv6 (which didn't work for me). To be clear when this crashes my network, it crashes the whole network I'm on. So if anyone else is connected to the same router their internet crashes too. I've also tried this by tethering to my phone and get the same result. |
I recently faced issues with running terraform plan on my MacBook M3 Pro, receiving an error stating "timeout while waiting for plugin to start." Initially, I had Terraform installed as Terraform v1.9.8 on darwin_amd64. After removing the amd64 version, I installed Terraform v1.9.8 on darwin_arm64, which resolved the issue for me. |
Problem
Apple M1 Macbook pro network connection dies when run
terraform init.
I also used[tfenv](https://github.com/tfutils/tfenv)
to manage different terraform versions. I tried all different terraformARM
versions from the latest to 1.1.0. Nothing worked.The only way I could get the network connection back was to restart the laptop.
Temporary workaround
Install the terraform
AMD
version, and it works.ARM Version tried
1.2.5, 1.1.0, 1.3.0-alpha
The text was updated successfully, but these errors were encountered: