Loading...
Loading...
### Terraform Version ```shell Terraform v1.11.4 on darwin_arm64 ``` ### Terraform Configuration Files Given a terraform module at bitbucket.org:some/internal-project: ```terraform module "module_copy_1" { source = "git::git@bitbucket.org:our-organization/parent-project?ref=2.8.0" # Properties } module "module_copy_2" { source = "git::git@bitbucket.org:our-organization/parent-project?ref=2.8.0" # Properties } ``` Where `parent-project` has the following module: ```terraform module "internal_project_release_5_0_6" { source = "git::git@bitbucket.org:our-organization/internal-project?ref=5.0.6" upload_prefix = "releases/5.0.6" } ``` And `our-organization/internal-project` has: ```terraform resource "qbee_filemanager_file" "some_hidden_file" { path = "${var.upload_prefix}/.update" sourcefile = "${path.module}/files/shared/.update" file_sha256 = filesha256("${path.module}/files/shared/.update") } ``` ### Debug Output The relevant part of the debug output, where this module is copied: ``` 2025-04-15T12:59:36.376+0200 [DEBUG] Module installer: begin module_copy_1.internal_project_release_5_0_6 2025-04-15T12:59:36.376+0200 [TRACE] ModuleInstaller: module_copy_1.internal_project_release_5_0_6 is not yet installed 2025-04-15T12:59:36.376+0200 [TRACE] ModuleInstaller: cleaning directory .terraform/modules/module_copy_1.internal_project_release_5_0_6 prior to install of module_copy_1.internal_project_release_5_0_6 2025-04-15T12:59:36.376+0200 [TRACE] ModuleInstaller: module_copy_1.internal_project_release_5_0_6 address "git::ssh://git@bitbucket.org/our-organization/internal-project?ref=5.0.6" will be handled by go-getter Downloading git::ssh://git@bitbucket.org/our-organization/internal-project?ref=5.0.6 for module_copy_1.internal_project_release_5_0_6... 2025-04-15T12:59:36.376+0200 [TRACE] getmodules: fetching "git::ssh://git@bitbucket.org/our-organization/internal-project?ref=5.0.6" to ".terraform/modules/module_copy_1.internal_project_release_5_0_6" 2025-04-15T12:59:42.533+0200 [TRACE] ModuleInstaller: module_copy_1.internal_project_release_5_0_6 "git::ssh://git@bitbucket.org/our-organization/internal-project?ref=5.0.6" was downloaded to .terraform/modules/module_copy_1.internal_project_release_5_0_6 2025-04-15T12:59:42.538+0200 [DEBUG] Module installer: module_copy_1.internal_project_release_5_0_6 installed at .terraform/modules/module_copy_1.internal_project_release_5_0_6 - module_copy_1.internal_project_release_5_0_6 in .terraform/modules/module_copy_1.internal_project_release_5_0_6 ... 2025-04-15T13:00:11.527+0200 [TRACE] ModuleInstaller: cleaning directory .terraform/modules/module_copy_2.internal_project_release_5_0_6 prior to install of module_copy_2.internal_project_release_5_0_6 2025-04-15T13:00:11.527+0200 [TRACE] ModuleInstaller: module_copy_2.internal_project_release_5_0_6 address "git::ssh://git@bitbucket.org/our-organization/internal-project?ref=5.0.6" will be handled by go-getter Downloading git::ssh://git@bitbucket.org/our-organization/internal-project?ref=5.0.6 for module_copy_2.internal_project_release_5_0_6... 2025-04-15T13:00:11.527+0200 [TRACE] getmodules: copying previous install of "git::ssh://git@bitbucket.org/our-organization/internal-project?ref=5.0.6" from .terraform/modules/module_copy_1.internal_project_release_5_0_6 to .terraform/modules/module_copy_2.internal_project_release_5_0_6 2025-04-15T13:00:11.660+0200 [TRACE] ModuleInstaller: module_copy_2.internal_project_release_5_0_6 "git::ssh://git@bitbucket.org/our-organization/internal-project?ref=5.0.6" was downloaded to .terraform/modules/module_copy_2.internal_project_release_5_0_6 2025-04-15T13:00:11.664+0200 [DEBUG] Module installer: module_copy_2.internal_project_release_5_0_6 installed at .terraform/modules/module_copy_2.internal_project_release_5_0_6 - module_copy_2.internal_project_release_5_0_6 in .terraform/modules/module_copy_2.internal_project_release_5_0_6 ``` ### Expected Behavior The hidden file in our `internal-project/files/.update` should be present for both module installations. I want to either force Terraform to not copy existing modules and download each time, or ideally, correctly use the cached directory and not ignore dot-files. ### Actual Behavior The file starting with a `.` is only present for the first module downloaded. The second module instead copies the installed module, as specified in https://github.com/hashicorp/terraform/blob/c161997dbfc7a5eeca10c465c5e1f347ceaecbd0/internal/getmodules/getter.go#L125, ignoring the dot-files, as mentioned in https://github.com/hashicorp/terraform/blob/c161997dbfc7a5eeca10c465c5e1f347ceaecbd0/internal/copy/copy_dir.go#L31. ### Steps to Reproduce 1. `terraform init` 2. `terraform plan` The plan will fail since the dot-file does not exist, making the `sha256` method crash. ### Additional Context _No response_ ### References _No response_ ### Generative AI / LLM assisted development? _No response_
Click on a version to see all relevant bugs
Terraform Integration
Learn more about where this data comes from
Bug Scrub Advisor
Streamline upgrades with automated vendor bug scrubs
BugZero Enterprise
Wish you caught this bug sooner? Get proactive today.