-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
When using Cache Server and trying to pull a sub-module from a Terraform registry that uses absolute URLs in it's self discovery the module will fail to retrieve with a message:
│ Error: Error accessing remote module registry
│
│ on my-module.tf line 1:
│ 1: module "my-module" {
│
│ Failed to retrieve available versions for module "my-module"
│ (my-module.tf:1) from private.registry.url: the request failed after
│ 2 attempts, please try again later: Get
│ "https://<hostname><absolute-url>/registry/my-module/aws/versions":
│ dial tcp: lookup <hostname>https on <IP>:<PORT>: no such
│ host.Steps To Reproduce
- Use a registry that uses absolute paths in it's self-discovery, e.g.:
$ curl https://packages.syncron.team/.well-known/terraform.json
{
"modules.v1" : "https://<hostname>/somepath/modules/",
}- Pull the module within a
.tffile:
module "my-module" {
source = "<hostname>/registry/my-module/aws"
version = "= 1.0.0"
}- Try to run
terragrunt plan - Observe the error
Expected behavior
Terragrunt pulls the module
Versions
- Terragrunt version:
0.93.11 - OpenTofu/Terraform version:
1.8.5 - Environment details (Ubuntu 20.04, Windows 10, etc.): Ubuntu 24.04
Additional information
I've traced the root of the problem to https://github.com/gruntwork-io/terragrunt/blob/main/internal/providercache/provider_cache.go#L322
It seems that the Cache Server is naively assuming relative URLs without double checking (and DiscoveryURL is also just a container for the contents present in the file).
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working