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

Terraform gives a misleading error message if an incorrect submodule name is specified #35836

Closed
cblkwell opened this issue Oct 10, 2024 · 2 comments · Fixed by #35839
Closed
Assignees
Labels
bug confirmed a Terraform Core team member has reproduced this issue new new issue not yet triaged

Comments

@cblkwell
Copy link

Terraform Version

Terraform v1.9.5
on darwin_arm64

Terraform Configuration Files

module "karpenter_fg_profile" {
  source  = "terraform-aws-modules/eks/aws//modules/fargate_profile"
  version = "~> v20.24"

...

Debug Output

(This isn't really relevant -- the error is correct, just misleading)

Expected Behavior

In the source given in the Terraform code, the actual source is fargate-profile, not fargate_profile. Terraform should say that that submodule does not exist within the source module.

Actual Behavior

In actuality, Terraform gives this error:

╷
│ Error: Unreadable module directory
│
│ The directory .terraform/modules/karpenter_fg_profile/modules/fargate_profile could not be read. This is a bug in
│ Terraform and should be reported.
╵

While this is true, it makes it sound like the directory exists and cannot be read, but what is actually the case is that the directory does not even exist, fargate-profile does.

Steps to Reproduce

1.terraform init

Additional Context

No response

References

No response

@cblkwell cblkwell added bug new new issue not yet triaged labels Oct 10, 2024
@liamcervante liamcervante added the confirmed a Terraform Core team member has reproduced this issue label Oct 11, 2024
@liamcervante liamcervante self-assigned this Oct 11, 2024
@crw
Copy link
Contributor

crw commented Oct 11, 2024

Thanks for this report!

Copy link
Contributor

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug confirmed a Terraform Core team member has reproduced this issue new new issue not yet triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants