tfutils/tfenv

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

hryamzik opened this issue · 1 comments

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:

  • TFENV_CONFIG_DIR has to be set
  • several processes of terraform should be triggered, terragrant run-all handles this. If you set parallelism to 1 it just works.

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.

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.