hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.75k stars 9.1k forks source link

[Bug]: Error: Failed to instantiate provider "aws" to obtain schema: Unrecognized remote plugin message: This usually means that the plugin is either invalid or simply needs to be recompiled to support the latest protocol. #37342

Open magnum31415 opened 4 months ago

magnum31415 commented 4 months ago

Terraform Core Version

0.12.31

AWS Provider Version

v4.67.0

Affected Resource(s)

When I launch a simple terraform plan -var-file=xxx.tfvars -out=plan.out it crashes with this error:

Failed to instantiate provider "aws" to obtain schema: Unrecognized remote plugin message:

It only crashes when I launch terraform (0.12.31) in a Intel Mac Laptop, in windows laptop the same command in the same tf repo works perfectly.

I use tfenv, with other TF versions and they work perfectly in my Intel Mac with similar repos.

The issue only appears with : Intel Mac Laptop + terraform (0.12.31)

Expected Behavior

The correct plan execution

Actual Behavior

Error: Failed to instantiate provider "aws" to obtain schema: Unrecognized remote plugin message: 

This usually means that the plugin is either invalid or simply
needs to be recompiled to support the latest protocol._

Enabling debug it complains about this error

2024-05-08T09:31:49.217+0200 [TRACE] plugin.stdio: waiting for stdio data
2024-05-08T09:31:49.218+0200 [WARN]  plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unimplemented desc = unknown service plugin.GRPCStdio"
2024/05/08 09:31:49 [TRACE] GRPCProvider: Close
2024-05-08T09:31:49.222+0200 [DEBUG] plugin: plugin process exited: path=/Users/xxxxx/Documents/12.AWS/1.python/Productos/pentera-corp/.terraform/plugins/darwin_amd64/terraform-provider-template_v2.2.0_x4 pid=94976
2024-05-08T09:31:49.222+0200 [DEBUG] plugin: plugin exited
2024/05/08 09:31:49 [TRACE] LoadSchemas: retrieving schema for provisioner "local-exec"
2024-05-08T09:31:49.222+0200 [DEBUG] plugin: starting plugin: path=/Users/xxxxx/.tfenv/versions/0.12.31/terraform args=[/Users/xxxxxx/.tfenv/versions/0.12.31/terraform, internal-plugin, provisioner, local-exec]
2024-05-08T09:31:49.229+0200 [DEBUG] plugin: plugin started: path=/Users/xxxxxx/.tfenv/versions/0.12.31/terraform pid=94977
2024-05-08T09:31:49.229+0200 [DEBUG] plugin: waiting for RPC address: path=/Users/xxxxx/.tfenv/versions/0.12.31/terraform
2024-05-08T09:31:51.639+0200 [DEBUG] plugin.terraform: 2024/05/08 09:31:51 [INFO] Terraform version: 0.12.31  
2024-05-08T09:31:51.640+0200 [DEBUG] plugin.terraform: 2024/05/08 09:31:51 [INFO] Go runtime version: go1.12.13
2024-05-08T09:31:51.640+0200 [DEBUG] plugin.terraform: 2024/05/08 09:31:51 [INFO] CLI args: []string{"/Users/xxxxx/.tfenv/versions/0.12.31/terraform", "internal-plugin", "provisioner", "local-exec"}
2024-05-08T09:31:51.640+0200 [DEBUG] plugin.terraform: 2024/05/08 09:31:51 [DEBUG] Attempting to open CLI config file: /Users/xxxxx/.terraformrc
2024-05-08T09:31:51.640+0200 [DEBUG] plugin.terraform: 2024/05/08 09:31:51 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2024-05-08T09:31:51.642+0200 [DEBUG] plugin.terraform: 2024/05/08 09:31:51 [INFO] CLI command args: []string{"internal-plugin", "provisioner", "local-exec"}
2024-05-08T09:31:51.642+0200 [DEBUG] plugin.terraform: local-exec-provisioner (internal) 2024/05/08 09:31:51 [INFO] Starting provisioner plugin local-exec
2024-05-08T09:31:51.645+0200 [DEBUG] plugin.terraform: plugin address: address=/var/folders/b4/s0cy45wd55qfhk6fcc89qfnh0000gn/T/plugin801772193 network=unix timestamp=2024-05-08T09:31:51.644+0200
2024-05-08T09:31:51.645+0200 [DEBUG] plugin: using plugin: version=5
**2024-05-08T09:31:51.646+0200 [TRACE] plugin.stdio: waiting for stdio data
2024-05-08T09:31:51.650+0200 [WARN]  plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"**
2024-05-08T09:31:51.654+0200 [DEBUG] plugin: plugin process exited: path=/Users/xxxxx/.tfenv/versions/0.12.31/terraform pid=94977
2024-05-08T09:31:51.654+0200 [DEBUG] plugin: plugin exited

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

provider "aws" {
  alias   = "corp"
  region  = "eu-west-1"
  version = "~> 4.20"
}

Steps to Reproduce

terraform plan -var-file=app.tfvars -out=plan.out

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

v

Would you like to implement a fix?

None

github-actions[bot] commented 4 months ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

justinretzolk commented 4 months ago

Similar #30088