im2nguyen / rover

Interactive Terraform visualization. State and configuration explorer.
MIT License
3.01k stars 177 forks source link

Error access remote module registry - TLS handshake timeout #94

Open pezhore opened 2 years ago

pezhore commented 2 years ago

I'm running into an issue when trying to parse Terraform code with modules from the registry.

main.tf

# Linux VM module here
module "linuxvms" {
  vm_depends_on = [vsphere_folder.projectFolder]
  for_each     = local.config.linux
  source       = "Terraform-VMWare-Modules/vm/vsphere"
  version      = "3.4.1"
  vmtemp       = data.vsphere_virtual_machine.tmpl_ubuntu_20_04_desktop.name
  instances    = 1
  staticvmname = each.key
  vmrp         = "${data.vsphere_compute_cluster.cluster.name}/Resources"
  vmfolder     = "Infra/pezhore/terratest"

  disk_size_gb = [local.config.linux[each.key].disk]

  network = {
    (data.vsphere_network.network.name) = [""] # To use DHCP create Empty list ["",""]; You can also use a CIDR annotation;
  }

  dns_server_list  = local.config.networks.main.dns_server_list
  dns_suffix_list  = local.config.networks.main.dns_suffix_list
  vmgateway        = local.config.networks.main.ipv4gateway
  dc               = data.vsphere_datacenter.dc.name
  datastore        = data.vsphere_datastore.datastore.name
}

I would assume the expected behavior is to pull the 3.4.1 module from the Terraform Registry, but instead I'm getting this output:

~/terratest/ > docker run --rm -it -p 9000:9000 -v $(pwd):/src im2nguyen/rover -standalone true -planPath tfplan.binary      
2022/02/11 16:54:44 Starting Rover...
2022/02/11 16:54:44 Initializing Terraform...
2022/02/11 16:55:07 Unable to parse Plan: Unable to initialize Terraform Plan: exit status 1

Error: Error accessing remote module registry

Failed to retrieve available versions for module "linuxvms" (main.tf:1) from
registry.terraform.io: Failed to request discovery document: Get
"https://registry.terraform.io/.well-known/terraform.json": net/http: TLS
handshake timeout.

The behavior is the same when I do not provide the -planPath flag.

We're not doing anything funky with SSL cert/MITM inspection (e.g. Bluecoat), any ideas on what else to try?

EDIT:

I tried a non-module project, and it's failing with the same TLS handshake timeout while querying for providers:

docker run --rm -it -p 9000:9000 -v $(pwd):/src im2nguyen/rover -standalone true --env-file ./.env
2022/02/11 17:58:32 Starting Rover...
2022/02/11 17:58:32 Initializing Terraform...
2022/02/11 17:58:55 Unable to parse Plan: Unable to initialize Terraform Plan: exit status 1

Error: Failed to query available provider packages

Could not retrieve the list of available versions for provider vmware/nsxt:
could not connect to registry.terraform.io: Failed to request discovery
document: Get "https://registry.terraform.io/.well-known/terraform.json":
net/http: TLS handshake timeout

Error: Failed to query available provider packages

Could not retrieve the list of available versions for provider
hashicorp/vsphere: could not connect to registry.terraform.io: Failed to
request discovery document: Get
"https://registry.terraform.io/.well-known/terraform.json": net/http: TLS
handshake timeout
JLUTHE10-ford commented 1 year ago

I'm attempting to use Rover but am experiencing a similar issue. Were you able to resolve this issue?