Closed nvigot closed 3 weeks ago
It looks like you might be encountering a permissions issue when Terragrunt is trying to execute the terraform
binary at /usr/bin/terraform
. To help diagnose this further, I'd recommend checking the following:
Confirm that /usr/bin/terraform
is a valid script and executable:
Run the following commands to check if the binary exists and has executable permissions:
ls -la /usr/bin/terraform
Ensure the output indicates that the file exists and has execute (x
) permissions. If not, you can add execute permissions like so:
chmod +x /usr/bin/terraform
Verify that terraform
runs without Terragrunt:
Test whether the terraform
binary runs independently by running:
/usr/bin/terraform --version
If this command works, it suggests that terraform
itself is correctly set up.
Provide steps to reproduce: If the binary is valid and executable but the issue persists, it would help to share an example repository and detailed steps on how to reproduce the issue.
Hm, it happens on my env too :thinking:
terragrunt console --terragrunt-log-level debug
[INFO] Getting version from tgenv-version-name
[INFO] TGENV_VERSION is 0.68.4
17:05:25.495 DEBUG Terragrunt Version: 0.68.4
17:05:25.496 DEBUG Did not find any locals block: skipping evaluation.
17:05:25.496 DEBUG Running command: tofu --version
17:05:25.496 DEBUG Engine is not enabled, running command directly in .
17:05:25.533 DEBUG tofu version: 1.7.0
17:05:25.533 DEBUG Reading Terragrunt config file at ./terragrunt.hcl
17:05:25.533 DEBUG Did not find any locals block: skipping evaluation.
17:05:25.534 DEBUG Did not find any locals block: skipping evaluation.
17:05:25.536 DEBUG Running command: tofu init
17:05:25.537 DEBUG Engine is not enabled, running command directly in .
17:05:25.567 STDOUT tofu: Initializing the backend...
17:05:25.567 STDOUT tofu: Initializing provider plugins...
17:05:25.567 STDOUT tofu: OpenTofu has been successfully initialized!
17:05:25.567 STDOUT tofu:
17:05:25.567 STDOUT tofu: You may now begin working with OpenTofu. Try running "tofu plan" to see
17:05:25.567 STDOUT tofu: any changes that are required for your infrastructure. All OpenTofu commands
17:05:25.567 STDOUT tofu: should now work.
17:05:25.567 STDOUT tofu: If you ever set or change modules or backend configuration for OpenTofu,
17:05:25.567 STDOUT tofu: rerun this command to reinitialize your working directory. If you forget, other
17:05:25.567 STDOUT tofu: commands will detect it and remind you to do so if necessary.
17:05:25.571 DEBUG Running command: tofu console
17:05:25.571 DEBUG Engine is not enabled, running command directly in .
17:05:25.571 ERROR Error closing pty: invalid argument
17:05:25.572 ERROR tofu invocation failed in .
17:05:25.572 ERROR error occurred:
* Failed to execute "tofu console" in .
fork/exec /home/denis256/bin/tofu: operation not permitted
17:05:25.572 DEBUG *fs.PathError fork/exec /home/denis256/bin/tofu: operation not permitted
/home/circleci/project/internal/os/exec/ptty_unix.go:40 (0x1510f2c)
/home/circleci/project/internal/os/exec/cmd.go:61 (0x1510387)
/home/circleci/project/shell/run_shell_cmd.go:193 (0x16a9715)
/home/circleci/project/telemetry/metrics.go:42 (0xaaf473)
/home/circleci/project/telemetry/telemetry.go:80 (0x16a80cd)
/home/circleci/project/telemetry/traces.go:38 (0xab1e0f)
/home/circleci/project/telemetry/telemetry.go:79 (0x16a7fc9)
/home/circleci/project/shell/run_shell_cmd.go:111 (0x16a7c4b)
/home/circleci/project/shell/run_shell_cmd.go:72 (0x16a7b05)
/home/circleci/project/cli/commands/terraform/action.go:457 (0x1bc73c9)
/home/circleci/project/cli/commands/terraform/action.go:327 (0x1bc66dc)
/home/circleci/project/cli/commands/terraform/action.go:419 (0x1bc6f0c)
/home/circleci/project/cli/commands/terraform/action.go:326 (0x1bc62ce)
/home/circleci/project/cli/commands/terraform/action.go:237 (0x1bc58c7)
/home/circleci/project/cli/commands/terraform/action.go:83 (0x1bc4b32)
/home/circleci/project/cli/commands/terraform/command.go:47 (0x22cf505)
/home/circleci/project/cli/app.go:235 (0x22d0f47)
/home/circleci/go/pkg/mod/golang.org/x/sync@v0.8.0/errgroup/errgroup.go:78 (0x165d5d0)
/usr/local/go/src/runtime/asm_amd64.s:1700 (0x477c21)
17:05:25.572 ERROR Unable to determine underlying exit code, so Terragrunt will exit with error code 1
There is a regression between versions v0.68.0-beta2024100702 and terragrunt-v0.68.0-beta2024100801, confirmed on Linux and RHEL with both OpenTofu and Terraform. The other functionalities remain unaffected.
$ terragrunt-v0.68.0-beta2024100702 --version
terragrunt version v0.68.0-beta2024100702
$ terragrunt-v0.68.0-beta2024100702 console
19:30:13.129 INFO Retrieved output from terraform
>
$ terragrunt-v0.68.0-beta2024100801 --version
terragrunt version v0.68.0-beta2024100801
$ terragrunt-v0.68.0-beta2024100801 console
19:30:57.923 ERROR Error closing pty: invalid argument
19:30:57.926 ERROR terraform invocation failed in .
19:30:57.926 ERROR error occurred:
* Failed to execute "terraform console" in .
fork/exec /opt/homebrew/bin/terraform: operation not permitted
19:30:57.927 ERROR Unable to determine underlying exit code, so Terragrunt will exit with error code 1
Can report, happens the same for me. Terragrunt unable to run terraform console
terragrunt: 0.68.4
terraform: 1.7.5
Resolved in v0.68.5 release.
Describe the bug
terragrunt console has stopped working since commit afd5d7f962bd1e651f04a44968342ed1642a8e8e. Release v0.68.0-beta2024100702 is the latest working version.
Steps To Reproduce
Run terragrunt console on Linux/macOS
Versions