terraform-switcher: Stopped working inside terraform project
❯ tfswitch
Reading required version from terraform file
Cannot get list from mirror: https://releases.hashicorp.com/terraform
Reading required version from constraint: ~> 1.1, >= 1.1.2
Version does not exist or invalid terraform version format.
Format should be #.#.# or #.#.#-@# where # are numbers and @ are word characters.
For example, 0.11.7 and 0.11.9-beta1 are valid versions
error parsing constraint: ~> 1.1, >= 1.1.2
No version found to match constraint. Follow the README.md instructions for setup. https://github.com/warrensbox/terraform-switcher/blob/master/README.md
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 80
- Comments: 49 (5 by maintainers)
Commits related to this issue
- Merge branch 'master' into gh-224 — committed to TheWeatherCompany/terraform-switcher by deleted user 5 years ago
- Update the version of terraform switcher (#100) This version of terraform-switcher has a fix for the API breakage issue that occured in 2022W19 (see https://github.com/warrensbox/terraform-switcher/i... — committed to coopnorge/engineering-docker-images by aucampia 5 years ago
PR is up: https://github.com/warrensbox/terraform-switcher/pull/225
Fixed with release 0.13.1221
workaround
In first terminal
Then in another terminal
Team anyone working on fix ?
Hi, we have the same error, a lot of our jobs that are not working , have you planned a fix or a workaround ? Thanks
Using the temp version at the moment.
https://github.com/Jukie/terraform-switcher/releases/tag/0.13.12345
🤔 I wonder if, in the interest of solving the problem quickly, it might not be better to use https://github.com/warrensbox/terraform-switcher/pull/225 to fix this issue - and to open a separate issue for using the new API.
I think a lot of people are using tfswitch in their pipelines, and eventually they don’t want to use a local mirror (nice workaround by the way, thanks for it @aderuelle) and thus desperately waiting for a working tfswitch version to be released.
Just a thought - ymmv. 💭
Same problem here (;
I have a working hack for this. testing it locally then I’ll figure out how to make a PR.
it shows them all, the default is only 10. Should be relatively easy to implement an interface to use this instead of the current url. Working on a patch at the moment
https://releases.hashicorp.com/docs/api/v1/#operation/getReleasesV1
I would love this to become a new source of truth, but it provides quite limited subset of versions at the moment:
I wouldn’t mind helping out @Jukie / @warrensbox
hmm, so from multiple attempts one time it worked fine, I guess this local problem on my macos, thanks for a response.
@aderuelle I couldn’t find a github repo for it so I opened one here in the terraform repo and also sent them an email.
Works only, when the version is present on the machine!
As I actually need to download it (inside CI)… decided to go with good old curl
Hi everyone, I think that I have a similar problem. I’m trying to switch some specific terraform versions, however I got the following error:
The provided terraform version does not exist. Trytfswitch -lto see all available versions.I tried with two different versions of tfswitch. Initially: `➜ ~ tfswitch -v
Version: 0.12.1092`
And then I have upgraded to:
`➜ ~ tfswitch -v
Version: 0.13.1218`
semver =
\/(\d+\.\d+\.\d+)\/Seems like the links in the release page are now missing the trailing slash in href=
@andrewsavino1 tried at least 5 times, both on ci and locally and it didn’t work, so created the ticket. Now it works on both platforms
@DP19 did you manage to get the
afterparameter right ? I can’t get past the 1.0.10 release here …Look like pull request is in place : pull request LINK
FYI: https://www.hashicorp.com/blog/announcing-the-hashicorp-releases-api