Terragrunt "run-all ... encountered errors" in CI
A run-all command finished with at least one unit failing, and Terragrunt prints an aggregated summary. The summary is not the root cause: the real error is in the output of the specific unit that failed, higher up in the log.
What this error means
terragrunt run-all plan/apply ends with a summary like "N errors occurred" or "run-all encountered errors", listing which unit directories failed.
ERRO[0042] 2 errors occurred:
* [live/prod/db] exit status 1
* [live/prod/app] error acquiring the state lock
ERRO[0042] Unable to determine underlying exit code, so Terragrunt will exit with error code 1Common causes
A downstream unit failed for its own reason
The summary aggregates unit failures. Each listed directory has its own error (auth, lock, resource) earlier in the log.
A dependency failed, cascading to dependents
A unit that others depend on failed, so run-all could not proceed with the units waiting on its outputs.
How to fix it
Read the first failing unit, not the summary
- Scroll up to the earliest unit error in the log.
- Fix that unit in isolation with
--terragrunt-working-dir. - Re-run run-all once the root unit passes.
terragrunt plan --terragrunt-working-dir live/prod/dbKeep going to collect all failures at once
Use the error-handling flag so run-all reports every unit failure in one pass instead of stopping early.
terragrunt run-all apply --terragrunt-ignore-dependency-errorsHow to prevent it
- Fix and validate individual units before running the whole stack.
- Keep dependencies explicit so failures do not cascade silently.
- Run
run-all planin CI to surface unit errors before apply.