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

Error: Unreadable module directory - The directory .terraform/modules/host-project/modules/project_factory_shared_vpc could not be read. #943

Open
dvmorris opened this issue Oct 2, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@dvmorris
Copy link

dvmorris commented Oct 2, 2024

TL;DR

$ terraform init

Initializing the backend...
Initializing modules...
Downloading registry.terraform.io/terraform-google-modules/project-factory/google 17.0.0 for host-project...
- host-project in .terraform/modules/host-project/modules/project_factory_shared_vpc
╷
│ Error: Unreadable module directory
│ 
│ The directory .terraform/modules/host-project/modules/project_factory_shared_vpc could not be read. This is a bug in Terraform and should be reported.
╵

Expected behavior

$ terraform init

Initializing the backend...
Initializing modules...
Downloading registry.terraform.io/terraform-google-modules/project-factory/google 17.0.0 for project-factory...
- project-factory in .terraform/modules/project-factory
- project-factory.budget in .terraform/modules/project-factory/modules/budget
- project-factory.essential_contacts in .terraform/modules/project-factory/modules/essential_contacts
- project-factory.gsuite_group in .terraform/modules/project-factory/modules/gsuite_group
- project-factory.project-factory in .terraform/modules/project-factory/modules/core_project_factory
- project-factory.project-factory.project_services in .terraform/modules/project-factory/modules/project_services
- project-factory.quotas in .terraform/modules/project-factory/modules/quota_manager
- project-factory.shared_vpc_access in .terraform/modules/project-factory/modules/shared_vpc_access

Initializing provider plugins...
- Finding hashicorp/google versions matching ">= 3.43.0, >= 4.28.0, >= 5.41.0, < 7.0.0"...
- Finding hashicorp/google-beta versions matching ">= 3.43.0, >= 4.11.0, >= 5.41.0, < 7.0.0"...
- Finding hashicorp/null versions matching ">= 2.1.0"...
- Finding hashicorp/random versions matching ">= 2.2.0"...
- Finding hashicorp/time versions matching ">= 0.5.0"...
- Installing hashicorp/google v6.5.0...
- Installed hashicorp/google v6.5.0 (signed by HashiCorp)
- Installing hashicorp/google-beta v6.5.0...
- Installed hashicorp/google-beta v6.5.0 (signed by HashiCorp)
- Installing hashicorp/null v3.2.3...
- Installed hashicorp/null v3.2.3 (signed by HashiCorp)
- Installing hashicorp/random v3.6.3...
- Installed hashicorp/random v3.6.3 (signed by HashiCorp)
- Installing hashicorp/time v0.12.1...
- Installed hashicorp/time v0.12.1 (signed by HashiCorp)

Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.

Observed behavior

Downloading registry.terraform.io/terraform-google-modules/project-factory/google 16.0.1 for host-project...
- host-project in .terraform/modules/host-project/modules/project_factory_shared_vpc
╷
│ Error: Unreadable module directory
│ 
│ The directory .terraform/modules/host-project/modules/project_factory_shared_vpc could not be read. This is a bug in Terraform and should be reported.
╵

Terraform Configuration

This one works as expected: https://github.com/terraform-google-modules/terraform-google-project-factory/tree/master/examples/simple_project

This one results in the above error: https://github.com/terraform-google-modules/terraform-google-project-factory/tree/master/examples/shared_vpc

Terraform Version

v1.9.7

Additional information

No response

@dvmorris dvmorris added the bug Something isn't working label Oct 2, 2024
@dvmorris
Copy link
Author

dvmorris commented Oct 2, 2024

Sorry, I had a copy/paste issue in my environment. I see that the module name has a typo in it. Sorry about that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant