Skip to content

'Error: Failed to read module directory' after upgrading to terraform 1.2.7 #31615

@pickgr

Description

@pickgr

Terraform Version

$ terraform version
Terraform v1.2.7
on darwin_amd64

Terraform Configuration Files

module "vpc_endpoints_nocreate" {
  source  = "terraform-aws-modules/vpc/aws//modules/vpc-endpoints"
  version = "3.7.0"

  create = false
}

Debug Output

2022-08-10T11:55:40.986-1000 [TRACE] modsdir: writing modules manifest to .terraform/modules/modules.json
╷
│ Error: Failed to read module directory
│
│ Module directory .terraform/modules/platform.vpc_endpoints_nocreate/modules/vpc-endpoints does not exist or cannot be read.

Expected Behavior

No errors during init.

Actual Behavior

Init failed with error show above.

Steps to Reproduce

  1. terraform init -upgrade

Additional Context

References

I believe this may be related to #31573

Also see the public submodule in the registry at https://registry.terraform.io/modules/terraform-aws-modules/vpc/aws/latest/submodules/vpc-endpoints

Note how there are two backslashes for the path for the source specified in the example.

Unfortunately, I don't have time to dig into it further right now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugconfirmeda Terraform Core team member has reproduced this issueregistry

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions