0.10.6
n/a
Get: git::ssh://[email protected]/org/utils?ref=v0.1.0//to_qualified_name
Get: git::ssh://[email protected]/org/utils?ref=v0.1.0//to_tags
Error loading modules: module tag_qname: invalid source string: ../to_qualified_name
n/a
We have a single git repo that contains a collection of modules that are in subdirectories. The idea is to not have to create a repo for a collection of very small modules that mainly transform input variables into output. Some of these modules use each other, so within these modules, there are references to peer folders. For example:
module "tag_qname" {
source = "../to_qualified_name"
environment = "${var.environment}"
name = "${var.name}"
}
In 0.9.x this was working. In 0.10.x, we now get error above. It seems that terraform is downloading github subdir sources are standalone modules under .terraform/modules and no longer can modules that come from a single git repo able to reference each other.
Get the error under Debug Output
../moduleB<repo url>?ref=version//moduleAterraform get and see the error about moduleA not able to find ../moduleBUsed to work in 0.9.x!!!
n/a
It also used to work in 0.10.2. Is this a regression?
I confirm this was working until 0.10.5 version but after some changes on the terraform/config/module/tree.go it stopped working
Diff: https://github.com/hashicorp/terraform/compare/refs/tags/v0.10.5...refs/tags/v0.10.6
Module Source:
source = "[email protected]:org/repo.git?ref=v1.1.1//terraform/"
.modules folder:

Module Source:
source = "[email protected]:org/repo.git?ref=v1.1.1//terraform/"
.modules folder:

Before 0.10.6 it was cloning the entire repo instead of just the folder where the terraform module source resides. This is particularly used when using relative folder references such as:
# -- VERSION
output "version" { value = "${file("${path.module}/../VERSION")}" }
Thanks for reporting the issue!
This is a duplicate of #16138, already has a patch being tested in master.
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.
Most helpful comment
I confirm this was working until 0.10.5 version but after some changes on the
terraform/config/module/tree.goit stopped workingDiff: https://github.com/hashicorp/terraform/compare/refs/tags/v0.10.5...refs/tags/v0.10.6
Previous behaviour (<= 0.10.5)
Module Source:
.modules folder:

Actual behaviour (>= 0.10.6)
Module Source:
.modules folder:
Conclusion
Before 0.10.6 it was cloning the entire repo instead of just the folder where the terraform module source resides. This is particularly used when using relative folder references such as: