terragrunt icon indicating copy to clipboard operation
terragrunt copied to clipboard

Terragrunt graph not working correct with find_in_parent_folders

Open mueller-tobias opened this issue 11 months ago • 1 comments

Describe the bug We're evaluating terragrunt graph as an alternative to run-all. But it seems to have difficulties with find_in_parent_folders. We've tested a little bit with the example live infrastructure repo but when we run the terragrunt graph plan command for example in the webserver directory

A normal terragrunt run-all plan/apply is working without problems.

Since our production repository is leaned on this example we can't switch/test our pipeline to the new feature.

ERRO[0000] Error: Error in function call
       prefix=[/tmp/terragrunt-infrastructure-live-example] 
ERRO[0000]   on /tmp/terragrunt-infrastructure-live-example/terragrunt.hcl line 9, in locals:  prefix=[/tmp/terragrunt-infrastructure-live-example] 
ERRO[0000]    9:   account_vars = read_terragrunt_config(find_in_parent_folders("account.hcl"))  prefix=[/tmp/terragrunt-infrastructure-live-example] 
ERRO[0000]                                               prefix=[/tmp/terragrunt-infrastructure-live-example] 
ERRO[0000] Call to function "find_in_parent_folders" failed: ParentFileNotFoundError: Could not find a account.hcl in any of the parent folders of
/tmp/terragrunt-infrastructure-live-example/terragrunt.hcl. Cause: Traversed all the way to the root..
  prefix=[/tmp/terragrunt-infrastructure-live-example] 
ERRO[0000] Error processing module at '/tmp/terragrunt-infrastructure-live-example/terragrunt.hcl'. How this module was found: Terragrunt config file found in a subdirectory of /tmp/terragrunt-infrastructure-live-example. Underlying error: /tmp/terragrunt-infrastructure-live-example/terragrunt.hcl:9,41-64: Error in function call; Call to function "find_in_parent_folders" failed: ParentFileNotFoundError: Could not find a account.hcl in any of the parent folders of /tmp/terragrunt-infrastructure-live-example/terragrunt.hcl. Cause: Traversed all the way to the root.. 
ERRO[0000] Unable to determine underlying exit code, so Terragrunt will exit with error code 1 

To Reproduce Clone the terragrunt-infrastructure-live-example Repository add the S3 and AWS values and try a terragrunt graph plan

Expected behavior It should run the plan command on all dependencies.

Versions

  • Terragrunt version: 0.55.15
  • openTofu version: v1.6.2
  • Environment details (Ubuntu 20.04, Windows 10, etc.): MacOS 14.3 + Ubuntu 22.04

mueller-tobias avatar Mar 15 '24 10:03 mueller-tobias

Hi, any ETA on this? would really appreciate moving to graph

Nilsas avatar Apr 26 '24 13:04 Nilsas