Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Dependency Outputs Has Insufficiently Helpful Error Message #3567

Open
1 of 2 tasks
yhakbar opened this issue Nov 15, 2024 · 0 comments
Open
1 of 2 tasks

Missing Dependency Outputs Has Insufficiently Helpful Error Message #3567

yhakbar opened this issue Nov 15, 2024 · 0 comments
Labels
bug Something isn't working preserved Preserved issues never go stale

Comments

@yhakbar
Copy link
Collaborator

yhakbar commented Nov 15, 2024

Describe the bug

When a unit depends on outputs from another unit with no dependencies, it throws an error that looks like the following:

08:57:09.936 ERROR  error occurred:

* ./foo/terragrunt.hcl is a dependency of ./bar/terragrunt.hcl but detected no outputs. Either the target module has not been applied yet, or the module has no outputs. If this is expected, set the skip_outputs flag to true on the dependency block.

08:57:09.936 ERROR  Unable to determine underlying exit code, so Terragrunt will exit with error code 1

While the error does accurately describe the problem, it doesn't offer the best prescriptive guidance on how to fix the issue.

Steps To Reproduce

Create the following fixture:

mkdir foo
mkdir bar
touch foo/main.tf
touch bar/main.tf
touch foo/terragrunt.hcl
touch bar/terragrunt.hcl

Then populate bar/terragrunt.hcl with the following:

dependency "foo" {
	config_path = "../foo"
}

Expected behavior

The error that Terragrunt could not determine the underlying exit code should be removed, as it's clear what the underlying error is, and there should be a hint that a user could have used mocks to avoid the issue if they encountered the error during a plan of a dependency that wasn't applied yet.

Ideally, there should actually be an HCL sample emitted that a user could copy + paste to bypass the issue.

Nice to haves

  • Terminal output
  • Screenshots

Versions

  • Terragrunt version: v0.68.13
  • OpenTofu version: v1.8.5
  • Environment details (Ubuntu 20.04, Windows 10, etc.): MacOS

Additional context

I encountered this as an expected error while writing up a guide for new users to adopt Terragrunt. These are the most important errors to get right, and they should be as good as possible.

@yhakbar yhakbar added bug Something isn't working preserved Preserved issues never go stale labels Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working preserved Preserved issues never go stale
Projects
None yet
Development

No branches or pull requests

1 participant