-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
[Bug]: Terraform apply command freezes during AWS provider initialization #39523
Comments
Community NoteVoting for Prioritization
Volunteering to Work on This Issue
|
I forgot to add, reverting to provider 5.68.0 works like a champ. |
I have the same issue with v5.69.0. UPD: Chip - Apple M1 Pro |
What we found for our team is that only x86 provider did not work as it should. Mac with intel or arm doesn't matter, if you use 5.69.0_x86 (with Rosseta on arm) there will be some kind of problems. |
I have the same issue with v5.69.0(hashicorp/aws/5.69.0/darwin_amd64/terraform-provider-aws_v5.69.0_x5) and chip Apple M3 with Rosetta 2. |
Same issue on Apple M3 |
It seems to be an issue only with Apple M chips, the version Also, it works fine when I use the same version in the CDKTF. Quite odd. |
I was trying to figure this out for 3 hours today what it was. Was convinced it was a provider and here we are. Thanks for whoever reported this. |
Looks like these projects have had similar errors recently: |
I’m using an Apple M3 with tfenv configured to the amd64 architecture in my TFENV_ARCH environment variable. This is because, in the projects I work on with my team, not everyone uses Apple M3; most of them are on Linux. To stay aligned with the rest of the team, I always configure my Terraform binary to work in amd64. Therefore, in my case, I’m on Apple M3 and using Rosetta 2. This issue only started happening with the latest version of the AWS provider (5.69.0). With version 5.68.0, everything works perfectly, only get the error that @law mentioned with version 5.69.0. @cailen I tried running the command with the environment variable you suggested (
While this reduced the number of log lines, the issue persists and fails at the same elements. Below is an excerpt from the logs:
|
@jotasixto The binaries are all made with the same code. I would think you could use the native copies (darwin arm64) to run anything locally on your computer and the other users could use darwin amd64 or whatever other flavor without issue. We do this where I work. Some are still on older Intel Macs. We also run things via Github Actions using Linux Amd64. I'm not at all discounting that it is broken, but you may be better off using the native version for your system unless there is no compatible one (like for very old versions of Terraform). |
@cailen Unfortunately, some of our legacy projects (which we are currently working on updating) use version 3 of the AWS provider, which doesn't have a compiled version for ARM to download. Therefore, I am unable to work with them locally on my machine. This is why I also have the Terraform binary configured to use |
@jotasixto makes sense then! Are you sure they don't have ARM copies though? From 3.30.0 there are ARM versions for Darwin. https://releases.hashicorp.com/terraform-provider-aws/3.30.0/. Maybe you are stuck using a version less than 3.30.0, but it may be worth trying to upgrade to the latest 3.x version if you can. The ARM version of Terraform also runs a lot faster. |
@cailen I apologize for the confusion earlier. I was replying from my phone at the time and recalling from memory, as it had been a few months since I last worked on this issue. Now that I’ve had the chance to check it again on my laptop, I can confirm that the problem was actually related to HashiCorp providers and not AWS providers.
I should have verified this before responding. However, this issue is causing a similar kind of blockage in legacy projects, as I can't remove the providers without following the proper migration process. Additionally, using the darwin_arm64 binary in my case is not a viable solution to work on the migration of these projects. Thank you for your understanding, and I appreciate your suggestion! |
Since Terraform Cloud runners are all x64, I lock my arch to that anyway on my M macs... helps with the lock file hashes as well. Maybe this is overkill but until this issue it's been working well for me. |
If I'm not mistaken, in the past Pulumi use terraform providers in the end, not sure if they still do it for some cases like this. If so, could be it. I'm not sure about stt 🤔
And about this, I just double checked and that CDKTF was using |
Same issue Downgrade to v5.68 fixed the issue. Also I want to emphasize on a comment above on how hard the problematic v5.70 providers hit your CPU and memory |
I find it crazy that this has not been triaged yet. What is going on, maintainers? @marcosentino @breathingdust @justinretzolk |
Just chiming in: back-pinning to Macbook Pro M3 And the |
Could anyone who is experiencing this with v5.69.0 or v5.70.0 see if they have the same problem with v5.65.0 or v5.66.0? |
In my case (M3, Terraform |
I got the same as mars64 (M3, Terraform When I tried to run multiple projects in parallel (4x), I did get a similar behaviour as the ones from versions My guess is there is some sort of a lock that prevents TF from spawning (too many - ~5 maybe) new processes, so since the versions |
Also impacted me. Running on M1 MacBook. AWS provider 5.69 and 5.70 would never work and were taking 80%+ CPU constantly. Dropping back to 5.68 worked, but another workaround worked too - use the amd64 provider (5.70) and set GODEBUG=asyncpreemptoff=1. Seems that 5.69+ is currently not good on Apple Silicon. |
Same here. M3, terraform |
Same here on M1. Terraform |
Also a confirmation on M2 machine with TF 1.9.5: using >=5.69.0 results in timeout. Downgrade to 5.68.0 "resolves" the issue. At the same time on a different M1 machine with TF 1.9.7 and 5.70.0 works just as expected. |
Relates golang/go#68485. |
Terraform Core Version
1.5.7
AWS Provider Version
5.69.0
Affected Resource(s)
n/a
Expected Behavior
'terraform apply' should continue, and ask me for confirmation before applying changes
Actual Behavior
When running `terraform apply, the process freezes during the initialization of the AWS provider. The command does not complete and requires manual termination.
Relevant Error/Panic Output Snippet
Terraform Configuration Files
https://gist.github.com/law/62b9c75214c18a015c37f16285a13ba4
Steps to Reproduce
TF_LOG=debug terraform apply
(orterragrunt init
) when using the above providerDebug Output
https://gist.github.com/law/5271d0e0cd052d438a194eb50c11da63
Panic Output
No response
Important Factoids
No response
References
No response
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: