tfutils / tfenv

Terraform version manager
MIT License
4.43k stars 450 forks source link

404 during specified package install #372

Open crosbygw opened 1 year ago

crosbygw commented 1 year ago

Installing Terraform v0.12.31 Downloading release tarball from https://releases.hashicorp.com/terraform/0.12.31/terraform_0.12.31_darwin_arm64.zip curl: (22) The requested URL returned error: 404

colmsnowplow commented 1 year ago

I hit this problem too.

When I navigate to https://releases.hashicorp.com/terraform/ it looks like the issue is with the path - the directories are all terraform_X.X.X, rather than just the version. Eg. the binary I need is at https://releases.hashicorp.com/terraform/0.13.5/terraform_0.13.5_darwin_amd64.zip .

Seems like it might be an easy fix?

colmsnowplow commented 1 year ago

@crosbygw I notice you're also on arm - I resolved by setting export TFENV_ARCH=amd64. Works as expected for me once that's set!

norchen commented 1 year ago

Thank you @colmsnowplow for pointing out. I cam across the same issue and double checked link. Setting TFENV_ARCH as you suggested works like charm 🙌

n3ph commented 1 year ago

@Zordrak @OJFord This was fixed by https://github.com/tfutils/tfenv/commit/c30dae23c8fc70cc0022dc9c34a95da646dc8249

~
➜ tfenv --version
tfenv 3.0.0

~
➜ tfenv install 0.12.31
Installing Terraform v0.12.31
Downloading release tarball from https://releases.hashicorp.com/terraform/0.12.31/terraform_0.12.31_darwin_amd64.zip
################################################################################################################################################# 100.0%
Downloading SHA hash file from https://releases.hashicorp.com/terraform/0.12.31/terraform_0.12.31_SHA256SUMS
Not instructed to use Local PGP (/opt/homebrew/Cellar/tfenv/3.0.0/use-{gpgv,gnupg}) & No keybase install found, skipping OpenPGP signature verification
Archive:  /var/folders/md/4w4vvwp17416xtmcnpv2d_n80000gq/T/tfenv_download.90yksz/terraform_0.12.31_darwin_amd64.zip
  inflating: /opt/homebrew/Cellar/tfenv/3.0.0/versions/0.12.31/terraform
Installation of terraform v0.12.31 successful. To make this your default version, run 'tfenv use 0.12.31'

~ took 5s
➜
ankajain commented 2 months ago

I faced the same problem today again. And after defining TFENV_ARCH, it got resolved.