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

Terragrunt Panics when Checking an S3 Bucket for Which Versioning is Not Enabled #65

Closed
josh-padnick opened this issue Dec 5, 2016 · 0 comments · Fixed by #66
Closed

Comments

@josh-padnick
Copy link
Contributor

When you run terragrunt where a .terragrunt file specifies an S3 Bucket that exists but for which versioning has not been enabled, it panics when instead it should issue a warning. Here are the steps to reproduce.

  1. Create an S3 Bucket but do NOT enable versioning.
  2. Specify that S3 Bucket Name in a .terragrunt file.
  3. Run terragrunt plan or terragrunt apply.
  4. Terragrunt will panic.

I received this output:

> terragrunt plan
[terragrunt] 2016/12/05 01:30:59 Reading Terragrunt config file at .terragrunt
[terragrunt] 2016/12/05 01:30:59 Initializing remote state for the s3 backend
[terragrunt] 2016/12/05 01:31:00 runtime.errorString runtime error: invalid memory address or nil pointer dereference
/home/ubuntu/.go_workspace/src/github.com/gruntwork-io/terragrunt/errors/errors.go:70 (0x69e31)
/usr/local/go/src/runtime/asm_amd64.s:472 (0x59d8e)
	call32: MOVQ	DX, 0(SP);			\
/usr/local/go/src/runtime/panic.go:443 (0x2ba89)
	gopanic: freedefer(d)
/usr/local/go/src/runtime/panic.go:62 (0x2a145)
	panicmem: panic(memoryError)
/usr/local/go/src/runtime/sigpanic_unix.go:24 (0x40a39)
	sigpanic: panicmem()
/home/ubuntu/.go_workspace/src/github.com/gruntwork-io/terragrunt/remote/remote_state_s3.go:113 (0xca055)
/home/ubuntu/.go_workspace/src/github.com/gruntwork-io/terragrunt/remote/remote_state_s3.go:49 (0xc96b1)
/home/ubuntu/.go_workspace/src/github.com/gruntwork-io/terragrunt/remote/remote_state.go:45 (0xc83c8)
/home/ubuntu/.go_workspace/src/github.com/gruntwork-io/terragrunt/remote/remote_state.go:60 (0xc85a7)
/home/ubuntu/.go_workspace/src/github.com/gruntwork-io/terragrunt/cli/cli_app.go:199 (0x68601)
/home/ubuntu/.go_workspace/src/github.com/gruntwork-io/terragrunt/cli/cli_app.go:102 (0x67475)
/usr/local/go/src/runtime/asm_amd64.s:472 (0x59d8e)
	call32: MOVQ	DX, 0(SP);			\
/usr/local/go/src/reflect/value.go:435 (0x12bc5d)
	Value.call:
/usr/local/go/src/reflect/value.go:303 (0x12a921)
	Value.Call: }
/home/ubuntu/.go_workspace/src/github.com/gruntwork-io/terragrunt/vendor/github.com/urfave/cli/app.go:480 (0xd13be)
/home/ubuntu/.go_workspace/src/github.com/gruntwork-io/terragrunt/vendor/github.com/urfave/cli/app.go:241 (0xceac5)
/home/ubuntu/.go_workspace/src/github.com/gruntwork-io/terragrunt/main.go:19 (0x20ce)
/usr/local/go/src/runtime/proc.go:188 (0x2d5a0)
	main: // Make racy client program work: if panicking on
/usr/local/go/src/runtime/asm_amd64.s:1998 (0x5c441)
	goexit: endofpage:

The fix is straightforward. I'll submit a PR for it now, but would prefer to fix #64 so that we can write a failing test for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant