Error accessing remote module registry

Hi,

I’m sure it’s something I am doing wrong as opposed to a bug, hence asking for help here as opposed to a Github issue.

In TF Cloud, when running a plan, I get the plan error:

Terraform v1.0.11
on linux_amd64
Configuring remote state backend...
Initializing Terraform configuration...

Setup failed: Failed terraform init (exit 1): <nil>

Output:
Initializing modules...
╷
│ Error: Error accessing remote module registry
│ 
│ Failed to retrieve available versions for module "website_region_0"
│ (product_main.tf:1) from app.terrafrom.io: Failed to request discovery
│ document: Get "https://app.terrafrom.io/.well-known/terraform.json": dial
│ tcp: lookup app.terrafrom.io on 127.0.0.53:53: no such host.
╵

╷
│ Error: Error accessing remote module registry
│ 
│ Failed to retrieve available versions for module "website_region_0"
│ (product_main.tf:1) from app.terrafrom.io: Failed to request discovery
│ document: Get "https://app.terrafrom.io/.well-known/terraform.json": dial
│ tcp: lookup app.terrafrom.io on 127.0.0.53:53: no such host.

From the line Failed to retrieve available versions for module "website_region_0", my initial thought was to publish the plan’s main.tf into the registry, which didn’t work, and it’s like it referencing itself.

There are very few references to this and they refer to on-prem or TFE. I am pretty certain this is during the terraform init stage. My backend is configured thus:

provider "azurerm" {
  features {}
}

terraform {
  required_providers {
    azurerm = {
      source = "hashicorp/azurerm"
      version = ">=2.86.0"
    }
  }
  backend "remote" {
    hostname = "app.terraform.io"
    organization = "myOrg"

    workspaces {
      name = "myWorkspaceName"
    }
  }
}

I’ve set up a variable group for accessing Azure, but as this is init, it shouldn’t care. As this is running in TF Cloud, I believe I don’t have to pass any credentials for itself.

In the root of the repo, targeted by the workspace, I have main.tf:

module "website_region_0" {
  source              = "app.terrafrom.io/myOrg/website/model"
  version             = ">=0.0.1"
 ...
}

website is a published module.

I don’t know if TF Cloud needs the azurerm provider adding to my private registry or whether it downloads it on the fly (as terraform init would do), but I have added it.

I’ve run out of ideas as to what I have done wrong, so if anyone has any pointers, I’d be grateful if you could share. This is using 1.0.11.

T.I.A

Hi @woter1832,

It looks like your source address has a typo in the registry hostname: you wrote app.terrafrom.io but the hostname is actually app.terraform.io (“form” instead of “from”).

If it’s any consolation, I make that typo when I type “terraform” a lot too! It’s an easy one to make, I suppose because “from” is a more common English word to type than “form”.

That would certainly cause an error! Can’t you buy the domain terrafROm.io, just for people like me? :grinning: I think that is definitely in the ID 10 T category!!!

Thanks @apparentlymart for taking the time to respond.