Skip to content

Instantly share code, notes, and snippets.

@tombuildsstuff
Last active April 16, 2018 08:18
Show Gist options
  • Save tombuildsstuff/ecb051924409d40a682e91b36c4ed8ab to your computer and use it in GitHub Desktop.
Save tombuildsstuff/ecb051924409d40a682e91b36c4ed8ab to your computer and use it in GitHub Desktop.
Terraform Console crash with an empty statefile
$ terraform console
> azurerm_resource_group.test.name
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x1755a04]

goroutine 1 [running]:
github.com/hashicorp/terraform/config/module.(*Tree).Config(...)
	/Users/tharvey/code/src/github.com/hashicorp/terraform/config/module/tree.go:78
github.com/hashicorp/terraform/terraform.(*Interpolater).resourceVariableInfo(0xc420434440, 0xc4204058d0, 0xc42046e000, 0xc4202f4400, 0x2e5ef00, 0x396bb60, 0x0)
	/Users/tharvey/code/src/github.com/hashicorp/terraform/terraform/interpolate.go:771 +0x44
github.com/hashicorp/terraform/terraform.(*Interpolater).computeResourceVariable(0xc420434440, 0xc4204058d0, 0xc42046e000, 0x0, 0x0, 0x0)
	/Users/tharvey/code/src/github.com/hashicorp/terraform/terraform/interpolate.go:459 +0x14e
github.com/hashicorp/terraform/terraform.(*Interpolater).valueResourceVar(0xc420434440, 0xc4204058d0, 0xc420392902, 0x20, 0xc42046e000, 0xc420394150, 0xc420394030, 0xc420394030)
	/Users/tharvey/code/src/github.com/hashicorp/terraform/terraform/interpolate.go:252 +0x68
github.com/hashicorp/terraform/terraform.(*Interpolater).Values(0xc420434440, 0xc4204058d0, 0xc420394120, 0x0, 0xc4202d8088, 0xc420392900)
	/Users/tharvey/code/src/github.com/hashicorp/terraform/terraform/interpolate.go:86 +0x82f
github.com/hashicorp/terraform/repl.(*Session).handleEval(0xc420405a98, 0xc4203927b0, 0x20, 0x20, 0x20, 0x0, 0x0)
	/Users/tharvey/code/src/github.com/hashicorp/terraform/repl/session.go:55 +0x2b7
github.com/hashicorp/terraform/repl.(*Session).Handle(0xc420671a98, 0xc4203927b0, 0x20, 0x0, 0x0, 0x0, 0x17ba386)
	/Users/tharvey/code/src/github.com/hashicorp/terraform/repl/session.go:35 +0xa9
github.com/hashicorp/terraform/command.(*ConsoleCommand).modeInteractive(0xc4203ae000, 0xc420405a98, 0x532f5a0, 0xc420426a20, 0x0)
	/Users/tharvey/code/src/github.com/hashicorp/terraform/command/console_interactive.go:48 +0x1e7
github.com/hashicorp/terraform/command.(*ConsoleCommand).Run(0xc4203ae000, 0x0, 0x0, 0x0, 0x0)
	/Users/tharvey/code/src/github.com/hashicorp/terraform/command/console.go:107 +0x5ef
github.com/hashicorp/terraform/vendor/github.com/mitchellh/cli.(*CLI).Run(0xc4202d3e00, 0xc4202d3e00, 0xc4201dbd18, 0x1)
	/Users/tharvey/code/src/github.com/hashicorp/terraform/vendor/github.com/mitchellh/cli/cli.go:255 +0x1eb
main.wrappedMain(0x0)
	/Users/tharvey/code/src/github.com/hashicorp/terraform/main.go:214 +0xbda
main.realMain(0x0)
	/Users/tharvey/code/src/github.com/hashicorp/terraform/main.go:99 +0xbb
main.main()
	/Users/tharvey/code/src/github.com/hashicorp/terraform/main.go:35 +0x38



!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!

Terraform crashed! This is always indicative of a bug within Terraform.
A crash log has been placed at "crash.log" relative to your current
working directory. It would be immensely helpful if you could please
report the crash with Terraform[1] so that we can fix this.

When reporting bugs, please include your terraform version. That
information is available on the first line of crash.log. You can also
get it by running 'terraform --version' on the command line.

[1]: https://github.com/hashicorp/terraform/issues

!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment