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

panic: Unknown variable type: %!!(MISSING)s(config.VariableType=0) #602

Closed
josephholsten opened this issue Nov 25, 2014 · 2 comments
Closed

Comments

@josephholsten
Copy link
Contributor

Given this syntactically invalid config:

variable "crash" {
  default = [
    "foo",
    "bar"
  ]
}

When I run terraform plan,
then I get output including panic: Unknown variable type: %!!(MISSING)s(config.VariableType=0),
But I should instead see Error loading config: Error parsing .../crash.tf: Line 2, column 12: syntax error

This crash is coming from terraform/context.go:178

Here's the logs:

2014/11/25 13:16:01 [INFO] Terraform version: 0.3.1  
2014/11/25 13:16:01 Detected home directory from env var: /Users/josephholsten
2014/11/25 13:16:01 [DEBUG] Discoverd plugin: aws = /usr/local/bin/terraform-provider-aws
2014/11/25 13:16:01 [DEBUG] Discoverd plugin: cloudflare = /usr/local/bin/terraform-provider-cloudflare
2014/11/25 13:16:01 [DEBUG] Discoverd plugin: consul = /usr/local/bin/terraform-provider-consul
2014/11/25 13:16:01 [DEBUG] Discoverd plugin: digitalocean = /usr/local/bin/terraform-provider-digitalocean
2014/11/25 13:16:01 [DEBUG] Discoverd plugin: dnsimple = /usr/local/bin/terraform-provider-dnsimple
2014/11/25 13:16:01 [DEBUG] Discoverd plugin: google = /usr/local/bin/terraform-provider-google
2014/11/25 13:16:01 [DEBUG] Discoverd plugin: heroku = /usr/local/bin/terraform-provider-heroku
2014/11/25 13:16:01 [DEBUG] Discoverd plugin: mailgun = /usr/local/bin/terraform-provider-mailgun
2014/11/25 13:16:01 [DEBUG] Discoverd plugin: null = /usr/local/bin/terraform-provider-null
2014/11/25 13:16:01 [DEBUG] Discoverd plugin: file = /usr/local/bin/terraform-provisioner-file
2014/11/25 13:16:01 [DEBUG] Discoverd plugin: local-exec = /usr/local/bin/terraform-provisioner-local-exec
2014/11/25 13:16:01 [DEBUG] Discoverd plugin: remote-exec = /usr/local/bin/terraform-provisioner-remote-exec
2014/11/25 13:16:01 Detected home directory from env var: /Users/josephholsten
2014/11/25 13:16:01 [DEBUG] Attempting to open CLI config file: /Users/josephholsten/.terraformrc
2014/11/25 13:16:01 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2014/11/25 13:16:01 waiting for all plugin processes to complete...
2014/11/25 13:16:01 Detected home directory from env var: /Users/josephholsten
panic: Unknown variable type: %!s(config.VariableType=0)

goroutine 16 [running]:
runtime.panic(0x394f00, 0xc2080d60e0)
    /usr/local/Cellar/go/1.3.3/libexec/src/pkg/runtime/panic.c:279 +0xf5
github.com/hashicorp/terraform/terraform.(*Context).Input(0xc20804e6e0, 0xc2080bc803, 0x0, 0x0)
    /private/tmp/terraform-BBvjcu/terraform-0.3.1/src/github.com/hashicorp/terraform/terraform/context.go:178 +0xa7d
github.com/hashicorp/terraform/command.(*PlanCommand).Run(0xc20804a480, 0xc20800e020, 0x0, 0x0, 0x0)
    /private/tmp/terraform-BBvjcu/terraform-0.3.1/src/github.com/hashicorp/terraform/command/plan.go:78 +0x807
github.com/mitchellh/cli.(*CLI).Run(0xc20804e460, 0xc208063230, 0x0, 0x0)
    /private/tmp/terraform-BBvjcu/terraform-0.3.1/src/github.com/mitchellh/cli/cli.go:100 +0x3a1
main.wrappedMain(0x0)
    /private/tmp/terraform-BBvjcu/terraform-0.3.1/src/github.com/hashicorp/terraform/main.go:150 +0x986
main.realMain(0x0)
    /private/tmp/terraform-BBvjcu/terraform-0.3.1/src/github.com/hashicorp/terraform/main.go:82 +0x81b
main.main()
    /private/tmp/terraform-BBvjcu/terraform-0.3.1/src/github.com/hashicorp/terraform/main.go:18 +0x1e

goroutine 19 [finalizer wait]:
runtime.park(0x1b790, 0x755ef8, 0x754949)
    /usr/local/Cellar/go/1.3.3/libexec/src/pkg/runtime/proc.c:1369 +0x89
runtime.parkunlock(0x755ef8, 0x754949)
    /usr/local/Cellar/go/1.3.3/libexec/src/pkg/runtime/proc.c:1385 +0x3b
runfinq()
    /usr/local/Cellar/go/1.3.3/libexec/src/pkg/runtime/mgc0.c:2644 +0xcf
runtime.goexit()
    /usr/local/Cellar/go/1.3.3/libexec/src/pkg/runtime/proc.c:1445

goroutine 20 [syscall]:
os/signal.loop()
    /usr/local/Cellar/go/1.3.3/libexec/src/pkg/os/signal/signal_unix.go:21 +0x1e
created by os/signal.init·1
    /usr/local/Cellar/go/1.3.3/libexec/src/pkg/os/signal/signal_unix.go:27 +0x32

goroutine 23 [semacquire]:
sync.runtime_Syncsemacquire(0xc2080be100)
    /usr/local/Cellar/go/1.3.3/libexec/src/pkg/runtime/sema.goc:257 +0xc0
sync.(*Cond).Wait(0xc2080be0f0)
    /usr/local/Cellar/go/1.3.3/libexec/src/pkg/sync/cond.go:62 +0x9d
io.(*pipe).read(0xc2080be0c0, 0xc2080b7000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /usr/local/Cellar/go/1.3.3/libexec/src/pkg/io/pipe.go:52 +0x2b6
io.(*PipeReader).Read(0xc208038158, 0xc2080b7000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /usr/local/Cellar/go/1.3.3/libexec/src/pkg/io/pipe.go:134 +0x5f
bufio.(*Scanner).Scan(0xc20802c460, 0x0)
    /usr/local/Cellar/go/1.3.3/libexec/src/pkg/bufio/scan.go:165 +0x508
github.com/hashicorp/terraform/command.func·006()
    /private/tmp/terraform-BBvjcu/terraform-0.3.1/src/github.com/hashicorp/terraform/command/meta.go:185 +0x3c
created by github.com/hashicorp/terraform/command.(*Meta).flagSet
    /private/tmp/terraform-BBvjcu/terraform-0.3.1/src/github.com/hashicorp/terraform/command/meta.go:188 +0x412
@armon armon closed this as completed in 5b745e5 Dec 9, 2014
@armon
Copy link
Member

armon commented Dec 9, 2014

Thanks for the report! Now looks like:

There are warnings and/or errors related to your configuration. Please
fix these before continuing.

Errors:

  * module root: 1 error(s) occurred:

* Variable 'crash': must be string or mapping

@josephholsten
Copy link
Contributor Author

woo! I have no idea how this patch works. reading time!

@ghost ghost locked and limited conversation to collaborators May 5, 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

2 participants