Skip to content
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 throwing error on Mac M1 (Darwin) #45

Closed
tavsec opened this issue Jan 19, 2023 · 5 comments
Closed

Terraform init throwing error on Mac M1 (Darwin) #45

tavsec opened this issue Jan 19, 2023 · 5 comments
Labels
bug Something isn't working stage/accepted

Comments

@tavsec
Copy link

tavsec commented Jan 19, 2023

Hello everyone!
I was following this tutorial: https://developer.hashicorp.com/nomad/tutorials/autoscaler/horizontal-cluster-scaling, and got stuck on terraform init step. Once I run terraform init, I get the following errors:

Initializing modules...

Initializing the backend...

Initializing provider plugins...
- Reusing previous version of hashicorp/nomad from the dependency lock file
- Reusing previous version of hashicorp/null from the dependency lock file
- Reusing previous version of hashicorp/template from the dependency lock file
- Reusing previous version of hashicorp/local from the dependency lock file
- Reusing previous version of hashicorp/random from the dependency lock file
- Reusing previous version of hashicorp/aws from the dependency lock file
- Installing hashicorp/null v3.1.0...
- Installed hashicorp/null v3.1.0 (signed by HashiCorp)
- Installing hashicorp/local v2.1.0...
- Installed hashicorp/local v2.1.0 (signed by HashiCorp)
- Installing hashicorp/random v3.1.0...
- Installed hashicorp/random v3.1.0 (signed by HashiCorp)
╷
│ Error: Incompatible provider version
│
│ Provider registry.terraform.io/hashicorp/nomad v1.4.13 does not have a package available for your current platform, darwin_arm64.
│
│ Provider releases are separate from Terraform CLI releases, so not all providers are available for all platforms. Other versions of this provider may have different platforms
│ supported.
╵

╷
│ Error: Incompatible provider version
│
│ Provider registry.terraform.io/hashicorp/template v2.2.0 does not have a package available for your current platform, darwin_arm64.
│
│ Provider releases are separate from Terraform CLI releases, so not all providers are available for all platforms. Other versions of this provider may have different platforms
│ supported.
╵

╷
│ Error: Incompatible provider version
│
│ Provider registry.terraform.io/hashicorp/aws v2.70.0 does not have a package available for your current platform, darwin_arm64.
│
│ Provider releases are separate from Terraform CLI releases, so not all providers are available for all platforms. Other versions of this provider may have different platforms
│ supported.
╵

First I was following the tutorial on #learn branch (as instruted in the tutorial), after that I tried main branch, but the error still persists.

This is my terraform -v output:

Terraform v1.3.7
on darwin_arm64
+ provider registry.terraform.io/hashicorp/aws v2.70.0
+ provider registry.terraform.io/hashicorp/local v2.1.0
+ provider registry.terraform.io/hashicorp/nomad v1.4.13
+ provider registry.terraform.io/hashicorp/null v3.1.0
+ provider registry.terraform.io/hashicorp/random v3.1.0
+ provider registry.terraform.io/hashicorp/template v2.2.0

Thanks, and have a nice day!

@tavsec
Copy link
Author

tavsec commented Jan 19, 2023

Short update, after running terraform init -upgrade, I narrowed the problem down to one error:

Upgrading modules...
- hashistack_cluster in ../modules/aws-hashistack
- hashistack_jobs in ../../../shared/terraform/modules/shared-nomad-jobs
Downloading registry.terraform.io/matti/resource/shell 1.5.0 for my_ip_address...
- my_ip_address in .terraform/modules/my_ip_address

Initializing the backend...

Initializing provider plugins...
- Finding latest version of hashicorp/local...
- Finding latest version of hashicorp/random...
- Finding latest version of hashicorp/template...
- Finding hashicorp/aws versions matching "~> 2.65"...
- Finding hashicorp/nomad versions matching ">= 1.4.6"...
- Finding latest version of hashicorp/null...
- Installing hashicorp/aws v2.70.4...
- Installed hashicorp/aws v2.70.4 (signed by HashiCorp)
- Installing hashicorp/nomad v1.4.19...
- Installed hashicorp/nomad v1.4.19 (signed by HashiCorp)
- Installing hashicorp/null v3.2.1...
- Installed hashicorp/null v3.2.1 (signed by HashiCorp)
- Installing hashicorp/local v2.3.0...
- Installed hashicorp/local v2.3.0 (signed by HashiCorp)
- Installing hashicorp/random v3.4.3...
- Installed hashicorp/random v3.4.3 (signed by HashiCorp)
╷
│ Error: Incompatible provider version
│
│ Provider registry.terraform.io/hashicorp/template v2.2.0 does not have a package available for your current platform, darwin_arm64.
│
│ Provider releases are separate from Terraform CLI releases, so not all providers are available for all platforms. Other versions of this provider may have different platforms
│ supported.
╵

@jrasell
Copy link
Member

jrasell commented Jan 19, 2023

Hi @tavsec and thanks for raising this issue. It seems the hashicorp/template provider has been archived and we should be using builtin template function instead. The demos will therefore need to be updated in order to work on Apple silicon and is something we will need to look into.

@jrasell jrasell added bug Something isn't working stage/accepted labels Jan 19, 2023
@tavsec
Copy link
Author

tavsec commented Jan 19, 2023

Hey @jrasell, thank you for reply!
Will wait until then :)

@jrasell
Copy link
Member

jrasell commented Jan 19, 2023

Hi @tavsec, I have raised #46 to update the AWS Terraform code which I have tested as much as I can, but I don't have an M1. If you're interested in running the demo, please try that PR and let me know how you find it.

@tavsec
Copy link
Author

tavsec commented Jan 23, 2023

@jrasell I can confirm that #46 did resolve the issue, so I'm closing this issue. Thank you for quick fix!

@tavsec tavsec closed this as completed Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stage/accepted
Projects
None yet
Development

No branches or pull requests

2 participants