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 invoke terraform when line feed is CRLF #243

Closed
DaemonDude23 opened this issue Feb 10, 2021 · 1 comment · May be fixed by #434
Closed

Unable to invoke terraform when line feed is CRLF #243

DaemonDude23 opened this issue Feb 10, 2021 · 1 comment · May be fixed by #434

Comments

@DaemonDude23
Copy link

This is mostly for posterity as I've identified the cause of the problem and it's an easy fix.

tfenv 2.2.0

Issue:
If the .terraform-version file is set to CRLF (not LF), and you have an empty newline in it like so:

0.14.6

If you try to run a terraform command or tfenv use 0.14.6, you'll get:

Switching default version to v0.14.6
Default version file overridden by /BLA/BLA/.terraform-version, changing the default version has no effect
No versions matching '' found in remote
/terraform: No such file or directorynv/2.2.0/libexec/tfenv-exec: line 105: /home/linuxbrew/.linuxbrew/Cellar/tfenv/2.2.0/versions/0.14.6
'terraform version' failed. Something is seriously wrong

The fix:
Remove the blank newline, or switch the file's line feed to LF

@fractos
Copy link

fractos commented Jul 11, 2024

This really feels like tfenv should be more robust around this. I keep hitting the issue.

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

Successfully merging a pull request may close this issue.

2 participants