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

Terragrunt command not found #223

Open
gabrieloshiro opened this issue Aug 5, 2024 · 14 comments
Open

Terragrunt command not found #223

gabrieloshiro opened this issue Aug 5, 2024 · 14 comments
Labels
bug Something isn't working hacktoberfest

Comments

@gabrieloshiro
Copy link

gabrieloshiro commented Aug 5, 2024

Describe the bug
I get the message

command not found: terragrunt

After installing terragrunt via tenv

To Reproduce
Steps to reproduce the behavior:

  1. Follow ubuntu instructions to install tenv
  2. install terraform and terragrunt via tenv (using tenv without parameters)
  3. execute terragrunt

Expected behavior
Terragrunt is in the PATH variable and it works properly.

Environment (please complete the following information):

  • OS: Ubuntu 6.5.0-45-generic
  • tenv version 3.0.0
@kvendingoldo kvendingoldo added the bug Something isn't working label Aug 5, 2024
@kvendingoldo
Copy link
Collaborator

Hi @gabrieloshiro,
Thank you for reporting. Which version of tenv do you use?

@gabrieloshiro
Copy link
Author

tenv version v3.0.0 (I edited the original post)

@Webgardener
Copy link

reproducing same behavior with 3.0.0

@Nmishin
Copy link
Collaborator

Nmishin commented Aug 14, 2024

@gabrieloshiro @Webgardener did you install tenv via snap or dpkg?
could you please show the output of command which tenv?

@applevladko
Copy link

applevladko commented Aug 16, 2024

I install tenv into docker container for pipelines using

RUN curl -Lo tenv.tar.gz "https://github.com/tofuutils/tenv/releases/download/v${TENV_VERSION}/tenv_v${TENV_VERSION}_$(uname)_x86_64.tar.gz" &&
tar -xzf tenv.tar.gz &&
mv tenv /usr/local/bin/ &&
rm tenv.tar.gz &&
ln -s /var/task/* /usr/local/bin &&
tenv --version

update-path is not working, I believe because of there are no binaries in folder /root/.tenv/bin which is exported by that command.
there are no folder /root/.tenv/bin at all.
Binaries are placed into /root/.tenv/Terraform/$version/terraform

so I had to add "ln -s /var/task/* /usr/local/bin" to make it work as binaries are present in task (for pipelines scenario)

@dvaumoron
Copy link
Contributor

dvaumoron commented Aug 16, 2024

the proxy binaries are in the archive tenv.tar.gz, you should copy them at the same place as tenv

update-path is meant to resolve conflict with other tool installation and suppose that the proxy binaries are in the same folder than tenv, it can not resolve an issue with missing binaries.

@dvaumoron dvaumoron closed this as not planned Won't fix, can't repro, duplicate, stale Aug 25, 2024
@kvendingoldo
Copy link
Collaborator

@applevladko does it solve your issue?

@Webgardener
Copy link

Webgardener commented Sep 5, 2024

No i need to remain on version 2.7.9 of tenv, which work well.
I used dpkg to install tenv

@kvendingoldo kvendingoldo reopened this Sep 5, 2024
@kvendingoldo
Copy link
Collaborator

I'll try on the weekend 3.X version; @Webgardener which os do you use? Give me a name and version, pls

@gabrieloshiro
Copy link
Author

@gabrieloshiro @Webgardener did you install tenv via snap or dpkg?
could you please show the output of command which tenv?

Sorry for the late response, I installed it via snap.

I also confirm that uninstalling everything and reverting to version 2.7.9 solves the issue.

@Webgardener
Copy link

I'll try on the weekend 3.X version; @Webgardener which os do you use? Give me a name and version, pls

Debian GNU/Linux 12 \n \l

@dmurvihill
Copy link

dmurvihill commented Sep 26, 2024

Seeing this also on 2.0.8 with terraform

$ sudo snap install tenv --channel=latest/candidate
Fetch and check assertions for snap "tenv" (37)                                                                                                                                                                                    \
Fetch and check assertions for snap "tenv" (37)                                                                                                                                                                                    /
Fetch and check assertions for snap "tenv" (37)                                                                                                                                                                                    -tenv (candidate) 2.0.8 from Alexander Sharov (kvendingoldo) installed

$ tenv --version
tenv version v2.0.8

$ tenv tf use latest
No compatible version found locally, search a remote one...
Fetching all releases information from https://releases.hashicorp.com/terraform/index.json
Found compatible version remotely : 1.9.6
Installing Terraform 1.9.6
Fetching release information from https://releases.hashicorp.com/terraform/1.9.6/index.json
Downloading https://releases.hashicorp.com/terraform/1.9.6/terraform_1.9.6_linux_amd64.zip
Downloading https://releases.hashicorp.com/terraform/1.9.6/terraform_1.9.6_SHA256SUMS
Downloading https://releases.hashicorp.com/terraform/1.9.6/terraform_1.9.6_SHA256SUMS.sig
Downloading https://www.hashicorp.com/.well-known/pgp-key.txt
Installation of Terraform 1.9.6 successful
Written 1.9.6 in /home/dolan/snap/tenv/37/.tenv/Terraform/version

$ terraform --version
Command 'terraform' not found, but can be installed with:
sudo snap install terraform

System is Ubuntu on WSL:

$ uname -a
Linux DS-m1mCk0PCLnQi 5.15.153.1-microsoft-standard-WSL2 #1 SMP Fri Mar 29 23:14:13 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

@Webgardener
Copy link

@gabrieloshiro @Webgardener did you install tenv via snap or dpkg?
could you please show the output of command which tenv?

Sorry for the late response, I installed it via snap.

I also confirm that uninstalling everything and reverting to version 2.7.9 solves the issue.

I'll try on the weekend 3.X version; @Webgardener which os do you use? Give me a name and version, pls

debian 12

@dmurvihill
Copy link

dmurvihill commented Oct 7, 2024

Added this to my bash profile and it works now.

NOTE: tenv use will not have any effect until the profile is re-imported.

If you didn't install with snap, you'll probably have to update tenv_base_path on line 2.

source_tenv () {
    tenv_base_path="${HOME}/snap/tenv/current/.tenv";
    for tool in $(ls "${tenv_base_path}"); do
        tool_dir="${tenv_base_path}/${tool}";
        if [[ -f "${tool_dir}/version" ]]; then
            tool_version=$(cat "${tool_dir}/version");
            export PATH="${tool_dir}/${tool_version}:${PATH}";
        fi      
    done
}

source_tenv;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hacktoberfest
Projects
None yet
Development

No branches or pull requests

7 participants