Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while downloading module from terraform registry #23833

Closed
eduardohf-ciandt opened this issue Jan 10, 2020 · 4 comments
Closed

Error while downloading module from terraform registry #23833

eduardohf-ciandt opened this issue Jan 10, 2020 · 4 comments

Comments

@eduardohf-ciandt
Copy link

eduardohf-ciandt commented Jan 10, 2020

Error:

: Error: Failed to download module
:
: Could not download module "service_accounts" (../../../main.tf:6) source code
: from
: "https://api.github.com/repos/terraform-google-modules/terraform-google-service-accounts/tarball/v2.0.2//*?archive=tar.gz":
: Error opening a gzip reader for /tmp/tmp.pBync0kChF/getter826662469/archive:
: EOF.

Code:

module "service_accounts" {
source = "terraform-google-modules/service-accounts/google"
version = "~> 2.0"
project_id = var.project_id
prefix = "sa"
names = [var.name]
generate_keys = var.generate_key
project_roles = local.project_roles
}

@eduardohf-ciandt eduardohf-ciandt changed the title Error while downloading module from terraform registry with GitHub backend Error while downloading module from terraform registry Jan 10, 2020
@n0rig
Copy link

n0rig commented Jan 10, 2020

Hi, I am seeing the same issue as well.

➜  TF_VER=0.12.9 && rm -rf .terraform ./k8s && TF_LOG=trace terraform-${TF_VER} init
2020/01/10 09:52:59 [INFO] Terraform version: 0.12.9
2020/01/10 09:52:59 [INFO] Go runtime version: go1.12.9
2020/01/10 09:52:59 [INFO] CLI args: []string{"/usr/local/bin/terraform-0.12.9", "init"}
2020/01/10 09:52:59 [DEBUG] Attempting to open CLI config file: /Users/me/.terraformrc
2020/01/10 09:52:59 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2020/01/10 09:52:59 [INFO] CLI command args: []string{"init"}
Initializing modules...

...
...
...

2020/01/10 09:53:07 [TRACE] ModuleInstaller: org-vpc address "[email protected]:PRIVATE_ORG/org-terraform-modules.git//org-vpc?ref=v0.0.16" will be handled by go-getter
2020/01/10 09:53:07 [DEBUG] will download "[email protected]:PRIVATE_ORG/org-terraform-modules.git?ref=v0.0.16" to .terraform/modules/org-vpc
2020/01/10 09:53:07 [TRACE] go-getter detectors rewrote "[email protected]:PRIVATE_ORG/org-terraform-modules.git?ref=v0.0.16" to "git::ssh://[email protected]/PRIVATE_ORG/org-terraform-modules.git?ref=v0.0.16"
2020/01/10 09:53:07 [TRACE] copying previous install .terraform/modules/org-eks to .terraform/modules/org-vpc
Downloading [email protected]:PRIVATE_ORG/org-terraform-modules.git?ref=v0.0.16 for org-vpc...
2020/01/10 09:53:07 [TRACE] expanded "org-vpc" to ".terraform/modules/org-vpc/org-vpc"
2020/01/10 09:53:07 [TRACE] ModuleInstaller: org-vpc "[email protected]:PRIVATE_ORG/org-terraform-modules.git//org-vpc?ref=v0.0.16" was downloaded to .terraform/modules/org-vpc/org-vpc
2020/01/10 09:53:07 [DEBUG] Module installer: org-vpc installed at .terraform/modules/org-vpc/org-vpc
2020/01/10 09:53:07 [DEBUG] Module installer: begin org-vpc.vpc
2020/01/10 09:53:07 [TRACE] ModuleInstaller: org-vpc.vpc is not yet installed
2020/01/10 09:53:07 [TRACE] ModuleInstaller: cleaning directory .terraform/modules/org-vpc.vpc prior to install of org-vpc.vpc
2020/01/10 09:53:07 [TRACE] ModuleInstaller: org-vpc.vpc is a registry module at terraform-aws-modules/vpc/aws
- org-vpc in .terraform/modules/org-vpc/org-vpc
2020/01/10 09:53:07 [DEBUG] org-vpc.vpc listing available versions of terraform-aws-modules/vpc/aws at registry.terraform.io
2020/01/10 09:53:07 [DEBUG] fetching module versions from "https://registry.terraform.io/v1/modules/terraform-aws-modules/vpc/aws/versions"
2020/01/10 09:53:07 [TRACE] HTTP client GET request to https://registry.terraform.io/v1/modules/terraform-aws-modules/vpc/aws/versions


2020/01/10 09:53:07 [DEBUG] looking up module location from "https://registry.terraform.io/v1/modules/terraform-aws-modules/vpc/aws/2.15.0/download"
2020/01/10 09:53:07 [TRACE] HTTP client GET request to https://registry.terraform.io/v1/modules/terraform-aws-modules/vpc/aws/2.15.0/download
2020/01/10 09:53:07 [TRACE] ModuleInstaller: org-vpc.vpc terraform-aws-modules/vpc/aws 2.15.0 is available at "https://api.github.com/repos/terraform-aws-modules/terraform-aws-vpc/tarball/v2.15.0//*?archive=tar.gz"
2020/01/10 09:53:07 [DEBUG] will download "https://api.github.com/repos/terraform-aws-modules/terraform-aws-vpc/tarball/v2.15.0?archive=tar.gz" to .terraform/modules/org-vpc.vpc
2020/01/10 09:53:07 [TRACE] fetching "https://api.github.com/repos/terraform-aws-modules/terraform-aws-vpc/tarball/v2.15.0?archive=tar.gz" to ".terraform/modules/org-vpc.vpc"
2020/01/10 09:53:13 [TRACE] modsdir: writing modules manifest to .terraform/modules/modules.json


Error: Failed to download module

Could not download module "vpc"
(.terraform/modules/org-vpc/org-vpc/aws_vpc.tf:9) source code from
"https://api.github.com/repos/terraform-aws-modules/terraform-aws-vpc/tarball/v2.15.0//*?archive=tar.gz":
Error opening a gzip reader for
/var/folders/w4/j15tdrx14lj3vzmh24nt80s5hk44q9/T/getter685006845/archive: EOF.

^ This are the trace logs of what is happening.

It looks like terraform gets the correct working URL path:

2020/01/10 09:53:07 [DEBUG] looking up module location from "https://registry.terraform.io/v1/modules/terraform-aws-modules/vpc/aws/2.15.0/download"
2020/01/10 09:53:07 [TRACE] HTTP client GET request to https://registry.terraform.io/v1/modules/terraform-aws-modules/vpc/aws/2.15.0/download
2020/01/10 09:53:07 [TRACE] ModuleInstaller: org-vpc.vpc terraform-aws-modules/vpc/aws 2.15.0 is available at "https://api.github.com/repos/terraform-aws-modules/terraform-aws-vpc/tarball/v2.15.0//*?archive=tar.gz"
2020/01/10 09:53:07 [DEBUG] will download "https://api.github.com/repos/terraform-aws-modules/terraform-aws-vpc/tarball/v2.15.0?archive=tar.gz" to .terraform/modules/org-vpc.vpc

But, then, it somehow get's converted to a path that does not work later on:

Could not download module "vpc"
(.terraform/modules/org-vpc/org-vpc/aws_vpc.tf:9) source code from
"https://api.github.com/repos/terraform-aws-modules/terraform-aws-vpc/tarball/v2.15.0//*?archive=tar.gz":

@jbardin
Copy link
Member

jbardin commented Jan 10, 2020

Duplicate of #23721 and #23829

@jbardin jbardin closed this as completed Jan 10, 2020
@justincampbell
Copy link
Contributor

This should now be fixed! Details in #23834

@ghost
Copy link

ghost commented Mar 28, 2020

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.

@ghost ghost locked and limited conversation to collaborators Mar 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants