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

Unable to determine version for terraform v0.12.31 #63

Open
asharma0703 opened this issue Nov 8, 2024 · 1 comment
Open

Unable to determine version for terraform v0.12.31 #63

asharma0703 opened this issue Nov 8, 2024 · 1 comment

Comments

@asharma0703
Copy link

I know this is an old version of Terraform but it does block using tflocal with the Terraform version I have to use - if there are other issues with older versions of Terraform maybe it's worth documenting a minimum version.

Description

$ tfenv use 1.9.8
Switching default version to v1.9.8
Default version (when not overridden by .terraform-version or TFENV_TERRAFORM_VERSION) is now: 1.9.8
$ tflocal
Usage: terraform [global options] <subcommand> [args]
...

$  tfenv use 0.12.31
Switching default version to v0.12.31
Default version (when not overridden by .terraform-version or TFENV_TERRAFORM_VERSION) is now: 0.12.31
$ tflocal
Unable to determine version. See error message for details: Expecting value: line 1 column 1 (char 0)

It looks like it's because the version is parsed from terraform version -json here, but it doesn't work for v0.12.31:

$ tfenv use 1.9.8
Switching default version to v1.9.8
Default version (when not overridden by .terraform-version or TFENV_TERRAFORM_VERSION) is now: 1.9.8
$ terraform version -json
{
  "terraform_version": "1.9.8",
  "platform": "darwin_arm64",
  "provider_selections": {},
  "terraform_outdated": false
}

$ tfenv use 0.12.31
Switching default version to v0.12.31
Default version (when not overridden by .terraform-version or TFENV_TERRAFORM_VERSION) is now: 0.12.31
$ terraform version -json
Terraform v0.12.31

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
@alexrashed
Copy link
Member

Hi @asharma0703!
Thanks a lot for opening this issue! You correctly identified the source of the issue.
Unfortunately, your version of terraform really is pretty old. But you have already correctly identified the root issue and as far as I can tell it should be fairly simple to integrate that in the version detection.
What do you think, would you be interested in creating a PR and fixing the issue with a contribution from your side?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants