You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Since tenv v2, I can't fetch the TF CLI when detecting the required_version from a .tf file. I get the Error: no compatible version found error.
It worked in v1 and I can use tenv tf install 1.7.0 without problem in v2.
To Reproduce
Steps to reproduce the behavior:
Write a basic providers.tf
# Configure the Terraform backend for remote state
terraform {
required_version = "~> 1.7.0"
}
Run tenv tf detect -v
Fails
Expected behavior
It should download the correct version like when using tenv tf install.
Environment (please complete the following information):
OS: Linux
tofuenv version 2.0.3
Additional context
root@818c4335f354:/# cat providers.tf
# Configure the Terraform backend for remote state
terraform {
required_version = "~> 1.7.0"
}
root@818c4335f354:/# tenv --version
tenv version v2.0.3
root@818c4335f354:/# tenv tf detect -v
2024-06-11T12:53:52.586Z [DEBUG] tenv: Failed to read file: error="open .terraform-version: no such file or directory"
2024-06-11T12:53:52.586Z [DEBUG] tenv: Failed to read file: error="open .tfswitchrc: no such file or directory"
2024-06-11T12:53:52.586Z [DEBUG] tenv: Failed to read terragrunt file: error="open terragrunt.hcl: no such file or directory"
2024-06-11T12:53:52.586Z [DEBUG] tenv: Failed to read terragrunt file: error="open terragrunt.hcl.json: no such file or directory"
2024-06-11T12:53:52.586Z [DEBUG] tenv: Failed to read file: error="open /root/.terraform-version: no such file or directory"
2024-06-11T12:53:52.586Z [DEBUG] tenv: Failed to read file: error="open /root/.tfswitchrc: no such file or directory"
2024-06-11T12:53:52.586Z [DEBUG] tenv: Failed to read terragrunt file: error="open /root/terragrunt.hcl: no such file or directory"
2024-06-11T12:53:52.586Z [DEBUG] tenv: Failed to read terragrunt file: error="open /root/terragrunt.hcl.json: no such file or directory"
2024-06-11T12:53:52.586Z [DEBUG] tenv: Failed to read file: error="open /root/.tenv/Terraform/version: no such file or directory"
No version files found for Terraform, fallback to latest-allowed strategy
Scan project to find .tf files
2024-06-11T12:53:52.586Z [DEBUG] tenv: Read: filePaths=["providers.tf"]
2024-06-11T12:53:52.587Z [DEBUG] tenv: Failed to read file: error="open /root/.tenv/Terraform/constraint: no such file or directory"
2024-06-11T12:53:52.587Z [DEBUG] tenv: Find: constraints=["~> 1.7.0"]
Error: no compatible version found
Usage:
tenv tf detect [flags]
Flags:
-a, --arch string specify arch for binaries downloading (default "amd64")
-f, --force-remote force search on versions available at TFENV_REMOTE url
-h, --help help for detect
-k, --key-file string local path to PGP public key file (replace check against remote one)
-n, --no-install disable installation of missing version (default true)
-c, --remote-conf string path to remote configuration file (advanced settings)
-u, --remote-url string remote url to install from
Global Flags:
-q, --quiet no unnecessary output (and no log)
-r, --root-path string local path to install versions of OpenTofu, Terraform, Terragrunt, and Atmos (default "/root/.tenv")
-v, --verbose verbose output (and set log level to Trace)
no compatible version found
The text was updated successfully, but these errors were encountered:
By default, we disabled autoinstall in V2 via detect command. I think that we can add flag to the command to install tools automatically, like tenv tf detect --install
Describe the bug
Since tenv v2, I can't fetch the TF CLI when detecting the required_version from a .tf file. I get the
Error: no compatible version found
error.It worked in v1 and I can use
tenv tf install 1.7.0
without problem in v2.To Reproduce
Steps to reproduce the behavior:
providers.tf
tenv tf detect -v
Expected behavior
It should download the correct version like when using
tenv tf install
.Environment (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: