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

Crashing when assigning int instead of string to module variable #624

Closed
jhedev opened this issue Dec 3, 2014 · 3 comments · Fixed by #679
Closed

Crashing when assigning int instead of string to module variable #624

jhedev opened this issue Dec 3, 2014 · 3 comments · Fixed by #679
Assignees

Comments

@jhedev
Copy link

jhedev commented Dec 3, 2014

I have a simple module to set up an CoreOS cluster on DigitalOcean (see here).

I used the module as follows:

module "coreos-cluster" {
       source = "github.com/jhedev/terram/coreos/digitalocean"
       no_nodes = 3
       do_token = "<do_token>"
       ssh_key = "<my_ssh_key>"
       discovery_url = "<discovery_url>"
}

I ran the following commands:

$ terraform get
$ terraform plan

The second command crashes with the message panic: interface conversion: interface is int, not string. After changing no_nodes = 3 to no_nodes = "3" everything works fine.

I was able to reproduce the crash with v0.3.1 and the current master (crash.log for master below).

crash.log:

2014/12/03 12:58:29 [INFO] Terraform version: 0.3.2 dev 
2014/12/03 12:58:29 Detected home directory from env var: /Users/joel
2014/12/03 12:58:29 Detected home directory from env var: /Users/joel
2014/12/03 12:58:29 [DEBUG] Attempting to open CLI config file: /Users/joel/.terraformrc
2014/12/03 12:58:29 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2014/12/03 12:58:29 [DEBUG] Creating graph for path: [root]
2014/12/03 12:58:29 [DEBUG] Creating graph for path: [root coreos-cluster]
2014/12/03 12:58:29 [DEBUG] Graph [root coreos-cluster] created and valid. 3 nouns.
2014/12/03 12:58:29 [DEBUG] Graph [root] created and valid. 2 nouns.
2014/12/03 12:58:29 Detected home directory from env var: /Users/joel
2014/12/03 12:58:29 [DEBUG] Creating graph for path: [root]
2014/12/03 12:58:29 [DEBUG] Creating graph for path: [root coreos-cluster]
2014/12/03 12:58:29 [DEBUG] Graph [root coreos-cluster] created and valid. 3 nouns.
2014/12/03 12:58:29 [DEBUG] Graph [root] created and valid. 2 nouns.
2014/12/03 12:58:29 [DEBUG] digitalocean_droplet.node: expanding to count = 3
2014/12/03 12:58:29 [DEBUG] Creating graph for path: [root]
2014/12/03 12:58:29 [DEBUG] Creating graph for path: [root coreos-cluster]
2014/12/03 12:58:29 [DEBUG] Graph [root coreos-cluster] created and valid. 3 nouns.
2014/12/03 12:58:29 [DEBUG] Graph [root] created and valid. 2 nouns.
panic: interface conversion: interface is int, not string

goroutine 29 [running]:
runtime.panic(0x3cdec0, 0xc2100a6140)
    /usr/local/go/src/pkg/runtime/panic.c:266 +0xb6
github.com/hashicorp/terraform/terraform.func·009(0xc210055e40, 0x0, 0x0)
    /Users/joel/code/go/src/github.com/hashicorp/terraform/terraform/context.go:1207 +0x66c
github.com/hashicorp/terraform/depgraph.func·002(0xc210055e40)
    /Users/joel/code/go/src/github.com/hashicorp/terraform/depgraph/graph.go:321 +0x21f
created by github.com/hashicorp/terraform/depgraph.(*Graph).Walk
    /Users/joel/code/go/src/github.com/hashicorp/terraform/depgraph/graph.go:328 +0x4aa

goroutine 1 [select]:
github.com/hashicorp/terraform/depgraph.(*Graph).Walk(0xc210055b00, 0xc2100ac690, 0x0, 0x0)
    /Users/joel/code/go/src/github.com/hashicorp/terraform/depgraph/graph.go:342 +0x671
github.com/hashicorp/terraform/terraform.(*walkContext).Walk(0xc2100b7b40, 0x5, 0x8d4770)
    /Users/joel/code/go/src/github.com/hashicorp/terraform/terraform/context.go:489 +0x151
github.com/hashicorp/terraform/terraform.(*Context).Refresh(0xc2100b5140, 0x0, 0x0, 0x0)
    /Users/joel/code/go/src/github.com/hashicorp/terraform/terraform/context.go:295 +0xcf
github.com/hashicorp/terraform/command.(*PlanCommand).Run(0xc21004c5a0, 0xc21000a020, 0x0, 0x0, 0x0)
    /Users/joel/code/go/src/github.com/hashicorp/terraform/command/plan.go:102 +0x92f
github.com/mitchellh/cli.(*CLI).Run(0xc21000fd20, 0xc210095270, 0x0, 0x0)
    /Users/joel/code/go/src/github.com/mitchellh/cli/cli.go:100 +0x32e
main.wrappedMain(0x0)
    /Users/joel/code/go/src/github.com/hashicorp/terraform/main.go:150 +0x8d8
main.realMain(0x0)
    /Users/joel/code/go/src/github.com/hashicorp/terraform/main.go:82 +0x7cb
main.main()
    /Users/joel/code/go/src/github.com/hashicorp/terraform/main.go:18 +0x1e

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

goroutine 5 [select]:
net/http.(*Transport).getConn(0xc21005a580, 0xc2100b6930, 0xc2100b6930, 0x0, 0x0)
    /usr/local/go/src/pkg/net/http/transport.go:424 +0x24d
net/http.(*Transport).RoundTrip(0xc21005a580, 0xc2100b9000, 0x1, 0x0, 0x0)
    /usr/local/go/src/pkg/net/http/transport.go:182 +0x340
net/http.send(0xc2100b9000, 0xa45488, 0xc21005a580, 0x0, 0x0, ...)
    /usr/local/go/src/pkg/net/http/client.go:168 +0x37f
net/http.(*Client).send(0x8e08e0, 0xc2100b9000, 0x8d, 0xc210051850, 0x27a91)
    /usr/local/go/src/pkg/net/http/client.go:100 +0xd9
net/http.(*Client).doFollowingRedirects(0x8e08e0, 0xc2100b9000, 0x50d788, 0x0, 0x0, ...)
    /usr/local/go/src/pkg/net/http/client.go:294 +0x671
net/http.(*Client).Do(0x8e08e0, 0xc2100b9000, 0xa, 0x0, 0x0)
    /usr/local/go/src/pkg/net/http/client.go:129 +0x8f
github.com/hashicorp/go-checkpoint.Check(0xc21005aa00, 0x0, 0x0, 0x0)
    /Users/joel/code/go/src/github.com/hashicorp/go-checkpoint/checkpoint.go:139 +0x92d
main.runCheckpoint(0xc21007f4a0)
    /Users/joel/code/go/src/github.com/hashicorp/terraform/checkpoint.go:51 +0x520
created by main.wrappedMain
    /Users/joel/code/go/src/github.com/hashicorp/terraform/main.go:99 +0x307

goroutine 6 [semacquire]:
sync.runtime_Syncsemacquire(0xc2100781c0)
    /private/var/folders/00/0sdwh000h01000cxqpysvccm0035qk/T/bindist922710130/go/src/pkg/runtime/sema.goc:257 +0xca
sync.(*Cond).Wait(0xc2100781b0)
    /usr/local/go/src/pkg/sync/cond.go:62 +0x89
io.(*pipe).read(0xc210078180, 0xc210099000, 0x1000, 0x1000, 0x0, ...)
    /usr/local/go/src/pkg/io/pipe.go:52 +0x245
io.(*PipeReader).Read(0xc210000518, 0xc210099000, 0x1000, 0x1000, 0x0, ...)
    /usr/local/go/src/pkg/io/pipe.go:134 +0x5f
bufio.(*Scanner).Scan(0xc2100825b0, 0x0)
    /usr/local/go/src/pkg/bufio/scan.go:165 +0x487
github.com/hashicorp/terraform/command.func·006()
    /Users/joel/code/go/src/github.com/hashicorp/terraform/command/meta.go:185 +0x3c
created by github.com/hashicorp/terraform/command.(*Meta).flagSet
    /Users/joel/code/go/src/github.com/hashicorp/terraform/command/meta.go:188 +0x392

goroutine 30 [runnable]:
github.com/hashicorp/terraform/depgraph.func·003()
    /Users/joel/code/go/src/github.com/hashicorp/terraform/depgraph/graph.go:333
created by github.com/hashicorp/terraform/depgraph.(*Graph).Walk
    /Users/joel/code/go/src/github.com/hashicorp/terraform/depgraph/graph.go:339 +0x539

goroutine 28 [runnable]:
github.com/hashicorp/terraform/depgraph.func·002(0xc210055ec0)
    /Users/joel/code/go/src/github.com/hashicorp/terraform/depgraph/graph.go:308 +0x176
created by github.com/hashicorp/terraform/depgraph.(*Graph).Walk
    /Users/joel/code/go/src/github.com/hashicorp/terraform/depgraph/graph.go:328 +0x4aa

goroutine 10 [syscall]:
net._C2func_getaddrinfo(0xf00000, 0x0, 0xc2100b6ba0, 0xc210000d60, 0xc2100b91a0, ...)
    net/_obj/_cgo_defun.c:50 +0x36
net.cgoLookupIPCNAME(0xc2100b6900, 0x1c, 0x0, 0x0, 0x0, ...)
    /private/var/folders/00/0sdwh000h01000cxqpysvccm0035qk/T/bindist922710130/go/src/pkg/net/cgo_unix.go:96 +0x174
net.cgoLookupIP(0xc2100b6900, 0x1c, 0x0, 0x0, 0x0, ...)
    /private/var/folders/00/0sdwh000h01000cxqpysvccm0035qk/T/bindist922710130/go/src/pkg/net/cgo_unix.go:148 +0x69
net.lookupIP(0xc2100b6900, 0x1c, 0x0, 0x0, 0x0, ...)
    /usr/local/go/src/pkg/net/lookup_unix.go:64 +0x63
net.func·022(0x8e0190, 0xc2100b6b70, 0xc2100b6900, 0x1c)
    /usr/local/go/src/pkg/net/lookup.go:41 +0x2d
net.(*singleflight).Do(0x8e0190, 0xc2100b6900, 0x1c, 0xa959e0, 0x0, ...)
    /usr/local/go/src/pkg/net/singleflight.go:45 +0x1de
net.lookupIPMerge(0xc2100b6900, 0x1c, 0x0, 0x0, 0x0, ...)
    /usr/local/go/src/pkg/net/lookup.go:42 +0xc0
net.lookupIPDeadline(0xc2100b6900, 0x1c, 0x0, 0x0, 0x0, ...)
    /usr/local/go/src/pkg/net/lookup.go:57 +0xd0
net.resolveInternetAddr(0x44fc40, 0x3, 0xc2100b6900, 0x20, 0x0, ...)
    /usr/local/go/src/pkg/net/ipsock.go:285 +0x395
net.resolveAddr(0x448f80, 0x4, 0x44fc40, 0x3, 0xc2100b6900, ...)
    /usr/local/go/src/pkg/net/dial.go:104 +0x32a
net.(*Dialer).Dial(0xa95d78, 0x44fc40, 0x3, 0xc2100b6900, 0x20, ...)
    /usr/local/go/src/pkg/net/dial.go:153 +0xa7
net.Dial(0x44fc40, 0x3, 0xc2100b6900, 0x20, 0x0, ...)
    /usr/local/go/src/pkg/net/dial.go:138 +0x75
net/http.(*Transport).dial(0xc21005a580, 0x44fc40, 0x3, 0xc2100b6900, 0x20, ...)
    /usr/local/go/src/pkg/net/http/transport.go:401 +0xd4
net/http.(*Transport).dialConn(0xc21005a580, 0xc2100b6930, 0x0, 0x0, 0x0)
    /usr/local/go/src/pkg/net/http/transport.go:444 +0x6e
net/http.func·014()
    /usr/local/go/src/pkg/net/http/transport.go:419 +0x3e
created by net/http.(*Transport).getConn
    /usr/local/go/src/pkg/net/http/transport.go:421 +0x11a

goroutine 15 [syscall]:
runtime.goexit()
    /usr/local/go/src/pkg/runtime/proc.c:1394
@armon
Copy link
Member

armon commented Dec 8, 2014

Thanks! Probably a bug in our configuration decoding!

@mitchellh
Copy link
Contributor

Reproduced. Working on this now.

@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.

4 participants