tfutils / tfenv

Terraform version manager
MIT License
4.51k stars 454 forks source link

Module *** has finished with an error: exit status 126 #398

Open hryamzik opened 1 year ago

hryamzik commented 1 year ago

I've made a repository to reproduce this issue. Note that it happens on first run only, there're other requirements to catch it too:

On one of runs I managed to get the following error:

/root/.tfenv/libexec/tfenv-exec: line 105: /var/lib/tfenv-versions/versions/1.2.2/terraform: Permission denied
/root/.tfenv/libexec/tfenv-exec: line 105: exec: /var/lib/tfenv-versions/versions/1.2.2/terraform: cannot execute: Permission denied
ERRO[0073] Terraform invocation failed in ...
ERRO[0073] Module ... has finished with an error: 1 error occurred:
    * exit status 126

Also sometimes the error is 127, not 126.

jamesdehart commented 9 months ago

I see the same issue when running a pre-commit hook.

To resolve this for pre-commit hooks I had to add require_serial: true for where the first time tfenv would be used.