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

Crash using boolean variables with modules #819

Closed
mcoms opened this issue Jan 16, 2015 · 3 comments · Fixed by #1017
Closed

Crash using boolean variables with modules #819

mcoms opened this issue Jan 16, 2015 · 3 comments · Fixed by #1017
Assignees

Comments

@mcoms
Copy link

mcoms commented Jan 16, 2015

I encounter a crash with Terraform v0.3.5 if I try to use boolean variables with a module, during terraform plan.

module "cluster_node_1" {
  source = "./cluster_node"
  leader = true
}
variable "leader" { default = false }
output "leader" { value = "${var.leader}" }
2015/01/16 12:07:01 [INFO] Terraform version: 0.3.5  
2015/01/16 12:07:01 Detected home directory from env var: /Users/nick
2015/01/16 12:07:01 [DEBUG] Discoverd plugin: aws = /usr/local/bin/terraform-provider-aws
2015/01/16 12:07:01 [DEBUG] Discoverd plugin: cloudflare = /usr/local/bin/terraform-provider-cloudflare
2015/01/16 12:07:01 [DEBUG] Discoverd plugin: consul = /usr/local/bin/terraform-provider-consul
2015/01/16 12:07:01 [DEBUG] Discoverd plugin: digitalocean = /usr/local/bin/terraform-provider-digitalocean
2015/01/16 12:07:01 [DEBUG] Discoverd plugin: dnsimple = /usr/local/bin/terraform-provider-dnsimple
2015/01/16 12:07:01 [DEBUG] Discoverd plugin: google = /usr/local/bin/terraform-provider-google
2015/01/16 12:07:01 [DEBUG] Discoverd plugin: heroku = /usr/local/bin/terraform-provider-heroku
2015/01/16 12:07:01 [DEBUG] Discoverd plugin: mailgun = /usr/local/bin/terraform-provider-mailgun
2015/01/16 12:07:01 [DEBUG] Discoverd plugin: null = /usr/local/bin/terraform-provider-null
2015/01/16 12:07:01 [DEBUG] Discoverd plugin: file = /usr/local/bin/terraform-provisioner-file
2015/01/16 12:07:01 [DEBUG] Discoverd plugin: local-exec = /usr/local/bin/terraform-provisioner-local-exec
2015/01/16 12:07:01 [DEBUG] Discoverd plugin: remote-exec = /usr/local/bin/terraform-provisioner-remote-exec
2015/01/16 12:07:01 Detected home directory from env var: /Users/nick
2015/01/16 12:07:01 [DEBUG] Attempting to open CLI config file: /Users/nick/.terraformrc
2015/01/16 12:07:01 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2015/01/16 12:07:01 Detected home directory from env var: /Users/nick
2015/01/16 12:07:01 [DEBUG] Creating graph for path: [root]
2015/01/16 12:07:01 [DEBUG] Creating graph for path: [root cluster_node_1]
2015/01/16 12:07:01 [DEBUG] Graph [root cluster_node_1] created and valid. 1 nouns.
2015/01/16 12:07:01 [DEBUG] Graph [root] created and valid. 2 nouns.
2015/01/16 12:07:01 [DEBUG] Creating graph for path: [root]
2015/01/16 12:07:01 [DEBUG] Creating graph for path: [root cluster_node_1]
2015/01/16 12:07:01 [DEBUG] Graph [root cluster_node_1] created and valid. 1 nouns.
2015/01/16 12:07:01 [DEBUG] Graph [root] created and valid. 2 nouns.
2015/01/16 12:07:01 [DEBUG] Creating graph for path: [root]
2015/01/16 12:07:01 [DEBUG] Creating graph for path: [root cluster_node_1]
2015/01/16 12:07:01 [DEBUG] Graph [root cluster_node_1] created and valid. 1 nouns.
2015/01/16 12:07:01 [DEBUG] Graph [root] created and valid. 2 nouns.
panic: interface conversion: interface is bool, not string

goroutine 35 [running]:
runtime.panic(0x484fa0, 0xc2080afb00)
    /usr/local/Cellar/go/1.3.3/libexec/src/pkg/runtime/panic.c:279 +0xf5
github.com/hashicorp/terraform/terraform.func·009(0xc2080af900, 0x0, 0x0)
    /private/tmp/terraform-KKDtJo/terraform-0.3.5/src/github.com/hashicorp/terraform/terraform/context.go:1231 +0x7b7
github.com/hashicorp/terraform/depgraph.func·002(0xc2080af900)
    /private/tmp/terraform-KKDtJo/terraform-0.3.5/src/github.com/hashicorp/terraform/depgraph/graph.go:321 +0x254
created by github.com/hashicorp/terraform/depgraph.(*Graph).Walk
    /private/tmp/terraform-KKDtJo/terraform-0.3.5/src/github.com/hashicorp/terraform/depgraph/graph.go:328 +0x516

goroutine 16 [select]:
github.com/hashicorp/terraform/depgraph.(*Graph).Walk(0xc2080af740, 0xc2080cd920, 0x0, 0x0)
    /private/tmp/terraform-KKDtJo/terraform-0.3.5/src/github.com/hashicorp/terraform/depgraph/graph.go:342 +0x726
github.com/hashicorp/terraform/terraform.(*walkContext).Walk(0xc2080d0190, 0x0, 0x0)
    /private/tmp/terraform-KKDtJo/terraform-0.3.5/src/github.com/hashicorp/terraform/terraform/context.go:489 +0x18b
github.com/hashicorp/terraform/terraform.(*Context).Refresh(0xc20805e8c0, 0x0, 0x0, 0x0)
    /private/tmp/terraform-KKDtJo/terraform-0.3.5/src/github.com/hashicorp/terraform/terraform/context.go:295 +0xd0
github.com/hashicorp/terraform/command.(*PlanCommand).Run(0xc20802ac30, 0xc20800e020, 0x0, 0x0, 0x0)
    /private/tmp/terraform-KKDtJo/terraform-0.3.5/src/github.com/hashicorp/terraform/command/plan.go:73 +0x8f5
github.com/mitchellh/cli.(*CLI).Run(0xc20805e460, 0xc208030a20, 0x0, 0x0)
    /private/tmp/terraform-KKDtJo/terraform-0.3.5/src/github.com/mitchellh/cli/cli.go:100 +0x3a1
main.wrappedMain(0x0)
    /private/tmp/terraform-KKDtJo/terraform-0.3.5/src/github.com/hashicorp/terraform/main.go:150 +0x986
main.realMain(0x0)
    /private/tmp/terraform-KKDtJo/terraform-0.3.5/src/github.com/hashicorp/terraform/main.go:82 +0x81b
main.main()
    /private/tmp/terraform-KKDtJo/terraform-0.3.5/src/github.com/hashicorp/terraform/main.go:18 +0x1e

goroutine 19 [finalizer wait]:
runtime.park(0x1bb80, 0x7aaef8, 0x7a9949)
    /usr/local/Cellar/go/1.3.3/libexec/src/pkg/runtime/proc.c:1369 +0x89
runtime.parkunlock(0x7aaef8, 0x7a9949)
    /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 22 [runnable]:
syscall.Syscall(0x3, 0x4, 0xc208078640, 0x4, 0x4, 0x0, 0x0)
    /usr/local/Cellar/go/1.3.3/libexec/src/pkg/syscall/asm_darwin_amd64.s:20 +0x5
syscall.read(0x4, 0xc208078640, 0x4, 0x8, 0x7fff5fbffd1c, 0x0, 0x0)
    /usr/local/Cellar/go/1.3.3/libexec/src/pkg/syscall/zsyscall_darwin_amd64.go:952 +0x75
syscall.Read(0x4, 0xc208078640, 0x4, 0x8, 0x8e0698, 0x0, 0x0)
    /usr/local/Cellar/go/1.3.3/libexec/src/pkg/syscall/syscall_unix.go:136 +0x5c
os.(*File).read(0xc208038190, 0xc208078640, 0x4, 0x8, 0x0, 0x0, 0x0)
    /usr/local/Cellar/go/1.3.3/libexec/src/pkg/os/file_unix.go:190 +0x89
os.(*File).Read(0xc208038190, 0xc208078640, 0x4, 0x8, 0x36967, 0x0, 0x0)
    /usr/local/Cellar/go/1.3.3/libexec/src/pkg/os/file.go:95 +0x98
io.ReadAtLeast(0x88a080, 0xc208038190, 0xc208078640, 0x4, 0x8, 0x4, 0x0, 0x0, 0x0)
    /usr/local/Cellar/go/1.3.3/libexec/src/pkg/io/io.go:289 +0xf7
io.ReadFull(0x88a080, 0xc208038190, 0xc208078640, 0x4, 0x8, 0x0, 0x0, 0x0)
    /usr/local/Cellar/go/1.3.3/libexec/src/pkg/io/io.go:307 +0x71
encoding/binary.Read(0x88a080, 0xc208038190, 0x88a0d0, 0x0, 0x3a6760, 0xc20800f620, 0x0, 0x0)
    /usr/local/Cellar/go/1.3.3/libexec/src/pkg/encoding/binary/binary.go:147 +0x12b
github.com/hashicorp/go-checkpoint.checkCache(0x5042f0, 0x5, 0xc208030ea0, 0x29, 0x9d29229e0000, 0x0, 0x0, 0x0, 0x0)
    /private/tmp/terraform-KKDtJo/terraform-0.3.5/src/github.com/hashicorp/go-checkpoint/checkpoint.go:228 +0x413
github.com/hashicorp/go-checkpoint.Check(0xc20805c700, 0x0, 0x0, 0x0)
    /private/tmp/terraform-KKDtJo/terraform-0.3.5/src/github.com/hashicorp/go-checkpoint/checkpoint.go:91 +0x8d
main.runCheckpoint(0xc20800e9e0)
    /private/tmp/terraform-KKDtJo/terraform-0.3.5/src/github.com/hashicorp/terraform/checkpoint.go:51 +0x3a8
created by main.wrappedMain
    /private/tmp/terraform-KKDtJo/terraform-0.3.5/src/github.com/hashicorp/terraform/main.go:99 +0x347

goroutine 23 [semacquire]:
sync.runtime_Syncsemacquire(0xc2080b0100)
    /usr/local/Cellar/go/1.3.3/libexec/src/pkg/runtime/sema.goc:257 +0xc0
sync.(*Cond).Wait(0xc2080b00f0)
    /usr/local/Cellar/go/1.3.3/libexec/src/pkg/sync/cond.go:62 +0x9d
io.(*pipe).read(0xc2080b00c0, 0xc208087000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /usr/local/Cellar/go/1.3.3/libexec/src/pkg/io/pipe.go:52 +0x2b6
io.(*PipeReader).Read(0xc208038158, 0xc208087000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /usr/local/Cellar/go/1.3.3/libexec/src/pkg/io/pipe.go:134 +0x5f
bufio.(*Scanner).Scan(0xc2080a0380, 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-KKDtJo/terraform-0.3.5/src/github.com/hashicorp/terraform/command/meta.go:338 +0x3c
created by github.com/hashicorp/terraform/command.(*Meta).flagSet
    /private/tmp/terraform-KKDtJo/terraform-0.3.5/src/github.com/hashicorp/terraform/command/meta.go:341 +0x412

goroutine 36 [runnable]:
github.com/hashicorp/terraform/depgraph.func·003()
    /private/tmp/terraform-KKDtJo/terraform-0.3.5/src/github.com/hashicorp/terraform/depgraph/graph.go:333
created by github.com/hashicorp/terraform/depgraph.(*Graph).Walk
    /private/tmp/terraform-KKDtJo/terraform-0.3.5/src/github.com/hashicorp/terraform/depgraph/graph.go:339 +0x5ad

goroutine 34 [runnable]:
github.com/hashicorp/terraform/depgraph.func·002(0xc2080af940)
    /private/tmp/terraform-KKDtJo/terraform-0.3.5/src/github.com/hashicorp/terraform/depgraph/graph.go:308 +0x19e
created by github.com/hashicorp/terraform/depgraph.(*Graph).Walk
    /private/tmp/terraform-KKDtJo/terraform-0.3.5/src/github.com/hashicorp/terraform/depgraph/graph.go:328 +0x516
@mitchellh
Copy link
Contributor

Reproduced.

@mitchellh
Copy link
Contributor

Fixed in #1017 pending review.

@mitchellh mitchellh self-assigned this Feb 20, 2015
mitchellh added a commit that referenced this issue Feb 23, 2015
terraform: module inputs/vars can be non-strings [GH-819]
yahyapo pushed a commit to yahyapo/terraform that referenced this issue Mar 13, 2015
@ghost
Copy link

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

Successfully merging a pull request may close this issue.

2 participants