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

bug using tfenv with cdktf #348

Open
stephengroat opened this issue Jul 16, 2022 · 5 comments
Open

bug using tfenv with cdktf #348

stephengroat opened this issue Jul 16, 2022 · 5 comments

Comments

@stephengroat
Copy link
Contributor

stephengroat commented Jul 16, 2022

have a strange bug where tfenv fails from within cdktf, but does not fail when TFENV_DEBUG=3 is set

not sure how to debug or determine what's wrong

$ cdktf synth
######################################################################## 100.0%
######################################################################## 100.0%
######################################################################## 100.0%
######################################################################## 100.0%
[2022-07-16T18:38:04.540] [ERROR] default - /usr/src/app/.tfenv/lib/tfenv-exec.sh: line 43: /usr/src/app/.tfenv/versions/1.2.4/terraform: Permission denied
/usr/src/app/.tfenv/lib/tfenv-exec.sh: line 43: exec: /usr/src/app/.tfenv/versions/1.2.4/terraform: cannot execute: Permission denied
Terraform CLI not present - Please install a current version https://learn.hashicorp.com/terraform/getting-started/install.html

seems to work if the binary is installed before, i.e. running terraform version before the cdktf command seems to fix it

@SandipGorde-TomTom
Copy link

SandipGorde-TomTom commented May 4, 2023

Hi @stephengroat , Even I am also getting similar error. Can you share how can we fix the issue ?

/home/vsts_azpcontainer/.tfenv/lib/tfenv-exec.sh: line 43: /home/vsts_azpcontainer/.tfenv/versions/1.2.4/terraform: Permission denied
/home/vsts_azpcontainer/.tfenv/lib/tfenv-exec.sh: line 43: exec: /home/vsts_azpcontainer/.tfenv/versions/1.2.4/terraform: cannot execute: Permission denied

@davidjeddy
Copy link
Contributor

Getting the same error here. Triggering tfenv in a Jenkins pipeline in parallel steps. From a quick view it looks like two processes are trying to execute tfenv-exec.sh at the same time. In the case of CDK, @SandipGorde-TomTom and @stephengroat can you validate if your processes are also running in parallel?

@jamesdehart
Copy link

Check out #398 (comment) This helped me resolve my issue.

@djakielski
Copy link

Hey @jamesdehart could you share how you solved this with cdktf?

@davidjeddy
Copy link
Contributor

@jamesdehart djakielski, @jamesdehart details in #398 tfenv should be invoked with require_serial: true configuration during the first invokation. This will prevent the error from being thrown.

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

5 participants