Troubleshooting "terragrunt.hcl file not found" error when using run-all in Spacelift

Last updated: September 15, 2025

If you're encountering the error "You attempted to run terragrunt in a folder that does not contain a terragrunt.hcl file" when using Terragrunt's run-all functionality in Spacelift, this typically indicates a configuration issue with your stack settings.

Prerequisites for run-all in Spacelift

To use terragrunt run-all from a top-level or subfolder directory in Spacelift, ensure the following settings are configured:

  1. Terragrunt-native mode is enabled for your stack

  2. Use Run All is turned on in the stack settings

  3. Your working directory points to the appropriate folder (can be a subfolder without its own terragrunt.hcl)

  4. Subfolders under your working directory contain the terragrunt.hcl files you want to execute

Common Issue: Runtime Configuration Override

Even with the correct stack settings, you may still encounter the error if your runtime configuration has run_all: false set. This override prevents Spacelift from using the run-all functionality, causing it to look for a terragrunt.hcl file in the working directory instead of scanning subfolders.

To verify this:

  1. Check the runtime configuration of your failed run

  2. Look for run_all: false in the configuration

  3. If present, remove this override or set it to true

How run-all works in Spacelift

When properly configured, Spacelift's Terragrunt-native mode with run-all enabled will:

  • Start from your configured working directory

  • Scan that directory and all subfolders for terragrunt.hcl files

  • Execute all commands (including init) with the --all flag

  • Run modules in dependency order automatically

This behavior matches what you would expect when running terragrunt run-all locally from the same directory.

Troubleshooting Tips

If you're still experiencing issues:

  • Use --terragrunt-log-level debug to see which directories Terragrunt is scanning (set this using the TF_CLI_ARGS environment variable: TF_CLI_ARGS="--terragrunt-log-level debug")

  • Verify your directory structure contains the expected terragrunt.hcl files in subfolders

  • Double-check that no runtime configuration overrides are preventing run-all from being used

For more detailed information about Terragrunt run-all in Spacelift, see the official documentation.