terraform-provider-aws: Plugin crashes when plan and apply
Community Note
- Please vote on this issue by adding a π reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave β+1β or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Terraform CLI and Terraform AWS Provider Version
Both terraform plan and terraform apply crashes several times with following errors before successfully applied:
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
β·
β Error: Unrecognized remote plugin message:
β
β This usually means that the plugin is either invalid or simply
β needs to be recompiled to support the latest protocol.
β
β
β΅
ERRO[0062] 1 error occurred:
* exit status 1
terraform -v output:
Terraform v1.0.10
on darwin_amd64
+ provider registry.terraform.io/hashicorp/aws v3.65.0
+ provider registry.terraform.io/hashicorp/external v2.1.0
+ provider registry.terraform.io/hashicorp/local v2.1.0
+ provider registry.terraform.io/hashicorp/null v3.1.0
+ provider registry.terraform.io/hashicorp/random v3.1.0
Downgraded the aws provider to 3.63.0 seem fixed the issue.
Running machine:
β ~ uname -mprsv
Darwin 20.6.0 Darwin Kernel Version 20.6.0: Tue Oct 12 18:33:38 PDT 2021; root:xnu-7195.141.8~1/RELEASE_ARM64_T8101 arm64 arm
Affected Resource(s)
Command failed in both plan and apply for most of AWS resources.
Terraform Configuration Files
Debug Output
Panic Output
Expected Behavior
plan and apply should run successfully.
Actual Behavior
plan and apply failed several times randomly.
Steps to Reproduce
Use aws provider with version 3.64 or 3.65 on Mac M1 laptop (arm64).
Important Factoids
References
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 54
- Comments: 35 (6 by maintainers)
Commits related to this issue
- Set TFENV_ARCH to help tfenv to use correct arch https://github.com/hashicorp/terraform-provider-aws/issues/21749#issuecomment-989592861 — committed to kblcuk/dotfiles by kblcuk 2 years ago
- Set TFENV_ARCH to help tfenv to use correct arch https://github.com/hashicorp/terraform-provider-aws/issues/21749#issuecomment-989592861 — committed to kblcuk/dotfiles by kblcuk 2 years ago
@francisATgwn I had exactly the same problem the other day. I use tfenv for managing terraform versions, so for me the fix was to
TFENV_ARCHtoarm64terraform initto get arm64-versions of pluginsHope that helps!
FYI, this has happened to me for months with the x64 executable on an M1 mac. I just painfully have to
terraform apply/planmany times, sometimes 4-5 times before it works properly. Is painful to use. Switching over to the ARM-based executable seems to have fixed the problem though.Hello,
I (and another colleague) ran into the same problem. Here is a small example of the behaviour:
As you can see, itβs not consistent at all. Successive calls to
plandoesnβt return the same error. I attached 2 stack traces hereI use also a M1 chip. Terraform was installed with
tfenvand seems to run under Rosetta 2.I donβt have time to investigate further right now unfortunately. Hope it helps!
Closing this Issue as newer versions of the provider and/or macOS seems to have stopped the problem occurring.
If you are using tfenv, you must enter this value in the environment variable.
So
darwin_arm64should be output in terraform version.@kblcuk Iβm using tfenv also. I tried that and it works. Iβll see if this helps decrease or eliminate the provider errors.
@smithatlanta Are you running with an M1 mac?
About the providers that donβt have the binaries for
arm64: Even some that are not deprecated donβt support it. F.i. datadog.@kblcuk Thank you so much for the
TFENV_ARCHfix. Iβve been fighting with terraform and terra grunt for a month since I got my M1 thinking it was some issue with the new AWS provider or something because SURELY tfenv and tgenv wouldβve installed the proper version of everything right? right??This should be in the docs.