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

Terraform crashes on "terraform get" when pulling a new tag from a repository #16135

Closed
skenmy opened this issue Sep 20, 2017 · 4 comments
Closed
Assignees
Labels

Comments

@skenmy
Copy link

skenmy commented Sep 20, 2017

Terraform Version

Terraform v0.10.6

Terraform Configuration Files

https://www.dropbox.com/s/k3k4b9hi7330klo/tfbug.tar.gz.gpg?dl=0
Encrypted using the HashiCorp public key

Debug Output

Available as console.output.log in the tarball above

Crash Output

Available as crash.log in the tarball above

Expected Behavior

Modules should download

Actual Behavior

Terraform crashed

Steps to Reproduce

  1. Update source version tag in module
  2. terraform get -update=true

Important Factoids

Module is being imported from a remote repo.

References

N/A

@skenmy
Copy link
Author

skenmy commented Sep 20, 2017

For a little context - in the base_network module in main.tf inside one of the local modules, I updated the source from source = "git@github.com:org/repo//base_network?ref=v0.1.0-alpha" to source = "git@github.com:org/repo//base_network?ref=v0.1.1-alpha"

The remote module is verified as working.

@jbardin jbardin self-assigned this Sep 20, 2017
@skenmy
Copy link
Author

skenmy commented Sep 21, 2017

Found the source of the issue:

$ brew switch terraform 0.10.5
Cleaning /usr/local/Cellar/terraform/0.10.0
Cleaning /usr/local/Cellar/terraform/0.10.2
Cleaning /usr/local/Cellar/terraform/0.10.3
Cleaning /usr/local/Cellar/terraform/0.10.4
Cleaning /usr/local/Cellar/terraform/0.10.5
Cleaning /usr/local/Cellar/terraform/0.10.6
2 links created for /usr/local/Cellar/terraform/0.10.5

$ terraform get -update=true
Get: file:///Users/paul/Project/1234567-aws-123456789012-Live-Production/eu-central-1 (update)
Get: file:///Users/paul/Project/1234567-aws-123456789012-Live-Production/eu-west-1 (update)
Get: git::ssh://git@github.com/org/repo2 (update)
Error loading modules: error downloading 'ssh://git@github.com/org/repo2': /usr/local/bin/git exited with 1: From ssh://github.com/org/repo2
   b34c764..813b8a4  master     -> origin/master
error: Your local changes to the following files would be overwritten by merge:
	iam/main.tf
Please commit your changes or stash them before you merge.
Aborting
Updating b34c764..813b8a4

Looks like the locally cached module under modules became modified somehow.

In addition - I found the following, after rm -rf .terraform in the root module:

$ terraform init -get=true -upgrade=true
Upgrading modules...
Get: file:///Users/paul/Project/1234567-aws-123456789012-Live-Production/eu-central-1 (update)
Get: file:///Users/paul/Project/1234567-aws-123456789012-Live-Production/eu-west-1 (update)
Get: git::ssh://git@github.com/org/repo2 (update)
Get: git::ssh://git@github.com/org/repo?ref=v0.1.1-alpha (update)
Error downloading modules: Error loading modules: module base_network: open .terraform/modules/eed93336955ac9feb02fb28bfcc80f44/base_network: no such file or directory

Turns out that org/repo had been moved. Thus Git was following the redirect, but no directory called base_network was in the new repo. I am unsure which of these two issues is the cause of the crash.

After rectifying these issues, v0.10.6 runs cleanly.

@jbardin
Copy link
Member

jbardin commented Sep 29, 2017

Closed via 16161

@jbardin jbardin closed this as completed Sep 29, 2017
@ghost
Copy link

ghost commented Apr 7, 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 Apr 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants