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.81k stars 9.16k forks source link

[Bug]: Provider crashes on M1 Macbook #39783

Closed paul-civitas closed 6 days ago

paul-civitas commented 1 week ago

Terraform Core Version

1.5.7

AWS Provider Version

5.72.1

Affected Resource(s)

aws_secretsmanager_secret_version (???)

Expected Behavior

The plugin loads

Actual Behavior

Error: timeout while waiting for plugin to start

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

This is literally all...

terraform {
  required_providers {
    keycloak = {
      source = "mrparkers/keycloak"
      version = "4.4.0"
    }
    aws = {
      source = "hashicorp/aws"
      version = "5.72.1"
    }
  }
}

data "aws_secretsmanager_secret_version" "keycloak_admin" {
  secret_id = "eks/${terraform.workspace}/keycloak/admin_password"
}
provider "keycloak" {

    client_id     = "admin-cli"
    username      = "user"
    password      = data.aws_secretsmanager_secret_version.keycloak_admin.secret_string
    url           = "https://keycloak-admin.${terraform.workspace}.private.civitaslearning.com"
}

Steps to Reproduce

It just happens intermittently, can't consistently reproduce

Debug Output

2024-10-17T14:18:12.086-0500 [INFO]  Terraform version: 1.5.7                                                                              14:18:14 [56/1867]
2024-10-17T14:18:12.086-0500 [DEBUG] using github.com/hashicorp/go-tfe v1.26.0
2024-10-17T14:18:12.086-0500 [DEBUG] using github.com/hashicorp/hcl/v2 v2.16.2
2024-10-17T14:18:12.086-0500 [DEBUG] using github.com/hashicorp/terraform-svchost v0.1.0
2024-10-17T14:18:12.086-0500 [DEBUG] using github.com/zclconf/go-cty v1.12.2
2024-10-17T14:18:12.086-0500 [INFO]  Go runtime version: go1.20.7
2024-10-17T14:18:12.086-0500 [INFO]  CLI args: []string{"/Users/pauldejean/.asdf/installs/terraform/1.5.7/bin/terraform", "apply"}
2024-10-17T14:18:12.086-0500 [DEBUG] Attempting to open CLI config file: /Users/pauldejean/.terraformrc
2024-10-17T14:18:12.086-0500 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2024-10-17T14:18:12.086-0500 [DEBUG] checking for credentials in "/Users/pauldejean/.terraform.d/plugins"
2024-10-17T14:18:12.086-0500 [DEBUG] checking for credentials in "/Users/pauldejean/.terraform.d/plugins/darwin_amd64"
2024-10-17T14:18:12.086-0500 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2024-10-17T14:18:12.086-0500 [DEBUG] will search for provider plugins in /Users/pauldejean/.terraform.d/plugins
2024-10-17T14:18:12.086-0500 [DEBUG] ignoring non-existing provider search directory /Users/pauldejean/Library/Application Support/io.terraform/plugins
2024-10-17T14:18:12.086-0500 [DEBUG] ignoring non-existing provider search directory /Library/Application Support/io.terraform/plugins
2024-10-17T14:18:12.088-0500 [INFO]  CLI command args: []string{"apply"}
2024-10-17T14:18:12.091-0500 [DEBUG] New state was assigned lineage "e0d225b3-0065-7240-0948-3b498aaf58c3"
2024-10-17T14:18:14.287-0500 [DEBUG] checking for provisioner in "."
2024-10-17T14:18:14.287-0500 [DEBUG] checking for provisioner in "/Users/pauldejean/.asdf/installs/terraform/1.5.7/bin"
2024-10-17T14:18:14.287-0500 [DEBUG] checking for provisioner in "/Users/pauldejean/.terraform.d/plugins"
2024-10-17T14:18:14.287-0500 [DEBUG] checking for provisioner in "/Users/pauldejean/.terraform.d/plugins/darwin_amd64"
2024-10-17T14:18:14.289-0500 [INFO]  backend/local: starting Apply operation
2024-10-17T14:18:14.292-0500 [DEBUG] created provider logger: level=debug
2024-10-17T14:18:14.293-0500 [INFO]  provider: configuring client automatic mTLS
2024-10-17T14:18:14.312-0500 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/hashicorp/aws/5.72.1/darwin_amd64/terraform-provider-aws_v5.72.1_x5 args=[.terraform/providers/registry.terraform.io/hashicorp/aws/5.72.1/darwin_amd64/terraform-provider-aws_v5.72.1_x5]                 2024-10-17T14:18:14.333-0500 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/hashicorp/aws/5.72.1/darwin_amd64/terraform-provider-aws_v5.72.1_x5 pid=11814
2024-10-17T14:18:14.333-0500 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/hashicorp/aws/5.72.1/darwin_amd64/ter
raform-provider-aws_v5.72.1_x5
2024-10-17T14:18:14.526-0500 [DEBUG] provider.terraform-provider-aws_v5.72.1_x5: Starting github.com/hashicorp/terraform-provider-aws@5.72.1 (go1.23.2)...
2024-10-17T14:18:14.526-0500 [DEBUG] provider.terraform-provider-aws_v5.72.1_x5: Initializing Terraform AWS Provider...
2024-10-17T14:18:14.561-0500 [INFO]  provider.terraform-provider-aws_v5.72.1_x5: configuring server automatic mTLS: timestamp=2024-10-17T14:18:14.561-0500
2024-10-17T14:18:14.598-0500 [DEBUG] provider.terraform-provider-aws_v5.72.1_x5: plugin address: address=/var/folders/6q/yhb6rp616_7f3531h96t85t00000gp/T/plugin121864731 network=unix timestamp=2024-10-17T14:18:14.598-0500
2024-10-17T14:18:14.599-0500 [DEBUG] provider: using plugin: version=5
2024-10-17T14:18:15.391-0500 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2024-10-17T14:18:15.402-0500 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/aws/5.72.1/darwin_amd64/terra
form-provider-aws_v5.72.1_x5 pid=11814
2024-10-17T14:18:15.402-0500 [DEBUG] provider: plugin exited
2024-10-17T14:18:15.402-0500 [DEBUG] created provider logger: level=debug
2024-10-17T14:18:15.402-0500 [INFO]  provider: configuring client automatic mTLS
2024-10-17T14:18:15.409-0500 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/mrparkers/keycloak/4.4.0/darwin_amd64/terraform-provider-keycloak_v4.4.0 args=[.terraform/providers/registry.terraform.io/mrparkers/keycloak/4.4.0/darwin_amd64/terraform-provider-keycloak_v4.4.0]
2024-10-17T14:18:15.417-0500 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/mrparkers/keycloak/4.4.0/darwin_amd64/terrafor
m-provider-keycloak_v4.4.0 pid=11815
2024-10-17T14:18:15.417-0500 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/mrparkers/keycloak/4.4.0/darwin_amd64/terraform-provider-keycloak_v4.4.0
2024-10-17T14:18:15.438-0500 [INFO]  provider.terraform-provider-keycloak_v4.4.0: configuring server automatic mTLS: timestamp=2024-10-17T14:18:15.438-0500
2024-10-17T14:18:15.460-0500 [DEBUG] provider.terraform-provider-keycloak_v4.4.0: plugin address: address=/var/folders/6q/yhb6rp616_7f3531h96t85t00000gp/T/plugin1426313246 network=unix timestamp=2024-10-17T14:18:15.460-0500
2024-10-17T14:18:15.461-0500 [DEBUG] provider: using plugin: version=5
2024-10-17T14:18:15.490-0500 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2024-10-17T14:18:15.492-0500 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/mrparkers/keycloak/4.4.0/darwin_amd64/terraform-provider-keycloak_v4.4.0 pid=11815
2024-10-17T14:18:15.492-0500 [DEBUG] provider: plugin exited
2024-10-17T14:18:15.493-0500 [DEBUG] Building and walking validate graph
2024-10-17T14:18:15.494-0500 [DEBUG] ProviderTransformer: "keycloak_realm.realm" (*terraform.NodeValidatableResource) needs provider["registry.terraform.io/mrparkers/keycloak"]
2024-10-17T14:18:15.494-0500 [DEBUG] ProviderTransformer: "data.aws_secretsmanager_secret_version.keycloak_admin" (*terraform.NodeValidatableResource) needsprovider["registry.terraform.io/hashicorp/aws"]
2024-10-17T14:18:15.494-0500 [DEBUG] ReferenceTransformer: "keycloak_realm.realm" references: []
2024-10-17T14:18:15.494-0500 [INFO]  ReferenceTransformer: reference not found: "terraform.workspace"
2024-10-17T14:18:15.494-0500 [DEBUG] ReferenceTransformer: "data.aws_secretsmanager_secret_version.keycloak_admin" references: []
2024-10-17T14:18:15.494-0500 [DEBUG] ReferenceTransformer: "local.workspaces (expand)" references: []
2024-10-17T14:18:15.494-0500 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/hashicorp/aws\"]" references: []
2024-10-17T14:18:15.494-0500 [INFO]  ReferenceTransformer: reference not found: "terraform.workspace"
2024-10-17T14:18:15.494-0500 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/mrparkers/keycloak\"]" references: [data.aws_secretsmanager_secret_version.keycloak_admin]
2024-10-17T14:18:15.495-0500 [DEBUG] Starting graph walk: walkValidate
2024-10-17T14:18:15.496-0500 [DEBUG] created provider logger: level=debug
2024-10-17T14:18:15.496-0500 [INFO]  provider: configuring client automatic mTLS
2024-10-17T14:18:15.504-0500 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/hashicorp/aws/5.72.1/darwin_amd64/terraform-provider-aws_v5.72.1_x5 args=[.terraform/providers/registry.terraform.io/hashicorp/aws/5.72.1/darwin_amd64/terraform-provider-aws_v5.72.1_x5]
2024-10-17T14:18:15.525-0500 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/hashicorp/aws/5.72.1/darwin_amd64/terraform-provider-aws_v5.72.1_x5 pid=11816
2024-10-17T14:18:15.525-0500 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/hashicorp/aws/5.72.1/darwin_amd64/terraform-provider-aws_v5.72.1_x5
2024-10-17T14:18:15.633-0500 [DEBUG] provider.terraform-provider-aws_v5.72.1_x5: assertion failed [arm_interval().contains(address)]: code fragment does not contain the given arm address
2024-10-17T14:18:15.633-0500 [DEBUG] provider.terraform-provider-aws_v5.72.1_x5: (CodeFragmentMetadata.cpp:48 instruction_extents_for_arm_address)
2024-10-17T14:19:15.526-0500 [ERROR] vertex "provider[\"registry.terraform.io/hashicorp/aws\"]" error: timeout while waiting for plugin to start
╷
│ Error: timeout while waiting for plugin to start
│
│
╵
2024-10-17T14:19:15.527-0500 [WARN]  provider: plugin failed to exit gracefully
2024-10-17T14:19:15.529-0500 [DEBUG] provider.terraform-provider-aws_v5.72.1_x5:
2024-10-17T14:19:15.529-0500 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/aws/5.72.1/darwin_amd64/terra
form-provider-aws_v5.72.1_x5 pid=11816 error="signal: killed"

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

github-actions[bot] commented 1 week ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

paul-civitas commented 1 week ago

This is where it seems to freeze:

2024-10-17T14:25:03.201-0500 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/hashicorp/aws/5.72.1/darwin_amd64/terraform-provider-aws_v5.72.1_x5 pid=12098
2024-10-17T14:25:03.201-0500 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/hashicorp/aws/5.72.1/darwin_amd64/terraform-provider-aws_v5.72.1_x5
2024-10-17T14:25:03.373-0500 [DEBUG] provider.terraform-provider-aws_v5.72.1_x5: assertion failed [arm_interval().contains(address)]: code fragment does not contain the given arm address
2024-10-17T14:25:03.373-0500 [DEBUG] provider.terraform-provider-aws_v5.72.1_x5: (CodeFragmentMetadata.cpp:48 instruction_extents_for_arm_address)
paul-civitas commented 1 week ago

Works without issue for opentofu 1.6.3 which is how I've resolved this for now. I don't know why terraform 1.5.7 has the provider crashing like this.

danielpersonius commented 1 week ago

same error for me on M2 macbook. upgraded opentofu to v1.8.3 but noticed it was the darwin_amd64 version. so re-installed homebrew correctly for apple silicon via the pkg and now have opentofu darwin_arm64. also uninstalled terraform which was installed via brew. all that resolved the issue for me

paul-civitas commented 1 week ago

I'm experiencing this on:

Terraform v1.5.7
on darwin_amd64

Your version of Terraform is out of date! The latest version
is 1.9.8. You can update by downloading from https://www.terraform.io/downloads.html

So not using terraform via Rosetta.

paul-civitas commented 1 week ago

If terraform 1.5.7 (which many people will be using for uhh various reasons even though its several versions out of date) isn't supported for this provider it would be nice to know that explicitly as it would impact our decision making on some things.

paul-civitas commented 1 week ago

I'm experiencing this on:

Terraform v1.5.7
on darwin_amd64

Your version of Terraform is out of date! The latest version
is 1.9.8. You can update by downloading from https://www.terraform.io/downloads.html

So not using terraform via Rosetta.

Apparently I can't read... Apparently I am transpiling it ugg. I'll have to dig into how that happened.

justinretzolk commented 6 days ago

Hey @paul-civitas 👋 Thank you for taking the time to raise this, and for following up with additional information! This was noticed already in #39523, so I'm going to close this issue in favor of that one in an effort to keep the conversation centralized.

github-actions[bot] commented 6 days ago

[!WARNING] This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them.

Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.