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 on plan, using getting started tutorial on OSX - 14.0.0 #786

Closed
zanderstrachan opened this issue Jan 14, 2015 · 5 comments
Closed
Labels
core crash waiting-response An issue/pull request is waiting for a response from the community

Comments

@zanderstrachan
Copy link

Using tutorial - AWS region is region = "ap-southeast-2"

On running terraform plan
...
2015/01/14 15:54:04 [INFO] Terraform version: 0.3.6 4e11ed4+CHANGES
2015/01/14 15:54:04 Detected home directory from env var: /Users/zander
2015/01/14 15:54:04 Detected home directory from env var: /Users/zander
2015/01/14 15:54:04 [DEBUG] Attempting to open CLI config file: /Users/zander/.terraformrc
2015/01/14 15:54:04 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2015/01/14 15:54:04 [INFO] Refreshing local state...
2015/01/14 15:54:04 Detected home directory from env var: /Users/zander
2015/01/14 15:54:05 [DEBUG] Creating graph for path: [root]
2015/01/14 15:54:05 [DEBUG] Graph [root] created and valid. 4 nouns.
2015/01/14 15:54:05 [DEBUG] aws_instance.web: expanding to count = 2
2015/01/14 15:54:05 [DEBUG] aws_elb.web: expanding to count = 1
2015/01/14 15:54:05 [DEBUG] Creating graph for path: [root]
2015/01/14 15:54:05 [DEBUG] Graph [root] created and valid. 4 nouns.
2015/01/14 15:54:05 [DEBUG] Creating graph for path: [root]
2015/01/14 15:54:05 [DEBUG] Graph [root] created and valid. 4 nouns.
2015/01/14 15:54:05 [DEBUG] aws_instance.web: expanding to count = 2
2015/01/14 15:54:05 [INFO] Module root walking: aws_instance.web.1 (Graph node: aws_instance.web.1)
2015/01/14 15:54:05 [DEBUG] aws_instance.web.1: Not refreshing, ID is empty
2015/01/14 15:54:05 [INFO] Module root walking: aws_instance.web.0 (Graph node: aws_instance.web.0)
2015/01/14 15:54:05 [DEBUG] aws_instance.web.0: Not refreshing, ID is empty
2015/01/14 15:54:05 [DEBUG] aws_elb.web: expanding to count = 1
2015/01/14 15:54:05 [INFO] Module root walking: aws_elb.web (Graph node: aws_elb.web)
2015/01/14 15:54:05 [DEBUG] aws_elb.web: Not refreshing, ID is empty
2015/01/14 15:54:05 [INFO] Writing state output to: /Users/zander/Projects/atlas/atlas-examples/getting-started/ops/.terraform/terraform.tfstate
2015/01/14 15:54:05 [INFO] Persisting state to local cache
2015/01/14 15:54:05 [INFO] Uploading state to remote store
2015/01/14 15:54:06 [DEBUG] Creating graph for path: [root]
2015/01/14 15:54:06 [DEBUG] Graph [root] created and valid. 4 nouns.
2015/01/14 15:54:06 [DEBUG] aws_instance.web: expanding to count = 2
2015/01/14 15:54:06 [INFO] Module root walking: aws_instance.web.1 (Graph node: aws_instance.web.1)
2015/01/14 15:54:06 [DEBUG] aws_instance.web.1: Executing diff
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x30 pc=0xe5176]

goroutine 51 [running]:
github.com/hashicorp/terraform/terraform.func·008()
/Users/mitchellh/code/go/src/github.com/hashicorp/terraform/terraform/context.go:1299 +0xe2
github.com/hashicorp/terraform/terraform.func·004(0xc20810e870, 0xc208332090, 0x0, 0x0)
/Users/mitchellh/code/go/src/github.com/hashicorp/terraform/terraform/context.go:852 +0xcd6
github.com/hashicorp/terraform/terraform.func·009(0xc208321340, 0x0, 0x0)
/Users/mitchellh/code/go/src/github.com/hashicorp/terraform/terraform/context.go:1314 +0xee7
github.com/hashicorp/terraform/depgraph.func·002(0xc208321340)
/Users/mitchellh/code/go/src/github.com/hashicorp/terraform/depgraph/graph.go:321 +0x25b
created by github.com/hashicorp/terraform/depgraph.(*Graph).Walk
/Users/mitchellh/code/go/src/github.com/hashicorp/terraform/depgraph/graph.go:328 +0x64f

goroutine 1 [select]:
github.com/hashicorp/terraform/depgraph.(_Graph).Walk(0xc208320c40, 0xc20831fe60, 0x0, 0x0)
/Users/mitchellh/code/go/src/github.com/hashicorp/terraform/depgraph/graph.go:342 +0x916
github.com/hashicorp/terraform/terraform.(_walkContext).Walk(0xc20810e870, 0x0, 0x0)
/Users/mitchellh/code/go/src/github.com/hashicorp/terraform/terraform/context.go:489 +0x23c
github.com/hashicorp/terraform/terraform.(_Context).Plan(0xc2082c55e0, 0xc20830f98f, 0x0, 0x0, 0x0)
/Users/mitchellh/code/go/src/github.com/hashicorp/terraform/terraform/context.go:273 +0x210
github.com/hashicorp/terraform/command.(_PlanCommand).Run(0xc20801f1e0, 0xc20800a010, 0x0, 0x0, 0x0)
/Users/mitchellh/code/go/src/github.com/hashicorp/terraform/command/plan.go:89 +0xe27
github.com/mitchellh/cli.(*CLI).Run(0xc208042d20, 0xc208060450, 0x0, 0x0)
/Users/mitchellh/code/go/src/github.com/mitchellh/cli/cli.go:100 +0x3ce
main.wrappedMain(0x0)
/Users/mitchellh/code/go/src/github.com/hashicorp/terraform/main.go:150 +0xb70
main.realMain(0x0)
/Users/mitchellh/code/go/src/github.com/hashicorp/terraform/main.go:82 +0x923
main.main()
/Users/mitchellh/code/go/src/github.com/hashicorp/terraform/main.go:18 +0x1f

goroutine 5 [syscall]:
os/signal.loop()
/Users/mitchellh/code/3rdparty/go/src/os/signal/signal_unix.go:21 +0x1f
created by os/signal.init·1
/Users/mitchellh/code/3rdparty/go/src/os/signal/signal_unix.go:27 +0x35

goroutine 8 [semacquire]:
sync.(_Cond).Wait(0xc2080d6030)
/Users/mitchellh/code/3rdparty/go/src/sync/cond.go:62 +0x9e
io.(_pipe).read(0xc2080d6000, 0xc2080d1000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
/Users/mitchellh/code/3rdparty/go/src/io/pipe.go:52 +0x303
io.(_PipeReader).Read(0xc20803e0b0, 0xc2080d1000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
/Users/mitchellh/code/3rdparty/go/src/io/pipe.go:134 +0x5b
bufio.(_Scanner).Scan(0xc208054480, 0x0)
/Users/mitchellh/code/3rdparty/go/src/bufio/scan.go:180 +0x688
github.com/hashicorp/terraform/command.func·006()
/Users/mitchellh/code/go/src/github.com/hashicorp/terraform/command/meta.go:338 +0x3d
created by github.com/hashicorp/terraform/command.(*Meta).flagSet
/Users/mitchellh/code/go/src/github.com/hashicorp/terraform/command/meta.go:341 +0x519

goroutine 52 [runnable]:
github.com/hashicorp/terraform/depgraph.func·002(0xc208321280)
/Users/mitchellh/code/go/src/github.com/hashicorp/terraform/depgraph/graph.go:294
created by github.com/hashicorp/terraform/depgraph.(*Graph).Walk
/Users/mitchellh/code/go/src/github.com/hashicorp/terraform/depgraph/graph.go:328 +0x64f

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
/Users/mitchellh/code/3rdparty/go/src/runtime/asm_amd64.s:2232 +0x1

goroutine 50 [chan receive]:
github.com/hashicorp/terraform/depgraph.func·002(0xc208321380)
/Users/mitchellh/code/go/src/github.com/hashicorp/terraform/depgraph/graph.go:308 +0x1a6
created by github.com/hashicorp/terraform/depgraph.(*Graph).Walk
/Users/mitchellh/code/go/src/github.com/hashicorp/terraform/depgraph/graph.go:328 +0x64f

goroutine 46 [select]:
github.com/hashicorp/terraform/depgraph.(_Graph).Walk(0xc2083211c0, 0xc20831fe60, 0x0, 0x0)
/Users/mitchellh/code/go/src/github.com/hashicorp/terraform/depgraph/graph.go:342 +0x916
github.com/hashicorp/terraform/terraform.(_walkContext).genericWalkResource(0xc20810e870, 0xc208320dc0, 0xc20831fe60, 0x0, 0x0)
/Users/mitchellh/code/go/src/github.com/hashicorp/terraform/terraform/context.go:1354 +0x358
github.com/hashicorp/terraform/terraform.func·009(0xc208320e40, 0x0, 0x0)
/Users/mitchellh/code/go/src/github.com/hashicorp/terraform/terraform/context.go:1283 +0xb68
github.com/hashicorp/terraform/depgraph.func·002(0xc208320e40)
/Users/mitchellh/code/go/src/github.com/hashicorp/terraform/depgraph/graph.go:321 +0x25b
created by github.com/hashicorp/terraform/depgraph.(*Graph).Walk
/Users/mitchellh/code/go/src/github.com/hashicorp/terraform/depgraph/graph.go:328 +0x64f

goroutine 48 [chan receive]:
github.com/hashicorp/terraform/depgraph.func·002(0xc208320d40)
/Users/mitchellh/code/go/src/github.com/hashicorp/terraform/depgraph/graph.go:308 +0x1a6
created by github.com/hashicorp/terraform/depgraph.(*Graph).Walk
/Users/mitchellh/code/go/src/github.com/hashicorp/terraform/depgraph/graph.go:328 +0x64f

goroutine 45 [chan receive]:
github.com/hashicorp/terraform/depgraph.func·002(0xc208320f80)
/Users/mitchellh/code/go/src/github.com/hashicorp/terraform/depgraph/graph.go:308 +0x1a6
created by github.com/hashicorp/terraform/depgraph.(*Graph).Walk
/Users/mitchellh/code/go/src/github.com/hashicorp/terraform/depgraph/graph.go:328 +0x64f

goroutine 49 [chan receive]:
github.com/hashicorp/terraform/depgraph.func·003()
/Users/mitchellh/code/go/src/github.com/hashicorp/terraform/depgraph/graph.go:337 +0xb8
created by github.com/hashicorp/terraform/depgraph.(*Graph).Walk
/Users/mitchellh/code/go/src/github.com/hashicorp/terraform/depgraph/graph.go:339 +0x73e

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

@mitchellh
Copy link
Contributor

Can you show me the configuration you used so I can try to repro this? Thanks

@mitchellh mitchellh added the waiting-response An issue/pull request is waiting for a response from the community label Jan 15, 2015
@zanderstrachan
Copy link
Author

The files are from Atlas Getting Started Tutorial

I updated ./ops/example-infrastructure.tf with the key info for atlas, and aws. This is the only file changed, then ran terraform plan

ops$ cat example-infrastructure.tf
provider "atlas" {
token = "****"
}

provider "aws" {
access_key = "_"
secret_key = "
_
"
region = "ap-southeast-2"
}

resource "aws_elb" "web" {
name = "terraform-example-elb"

# The same availability zone as our instances
availability_zones = ["${aws_instance.web.*.availability_zone}"]

listener {
    instance_port = 80
    instance_protocol = "http"
    lb_port = 80
    lb_protocol = "http"
}

# The instances are registered automatically
instances = ["${aws_instance.web.*.id}"]

}

resource "aws_instance" "web" {
instance_type = "t1.micro"
ami = "ami-408c7f28"

# This will create 2 instances
count = 2

}

@publysher
Copy link

I had the exact same problem when I was trying to run terraform from source. As it turned out, go install creates provider binaries called provider-*, while terraform discovery is looking for binaries called terraform-provider-*

Renaming my binaries solved the immediate problem. In my case, reading the README before starting to work with the source would also have helped :)

Suggestion: error out when discovery does not result in any providers or provisioners.

@mitchellh
Copy link
Contributor

Fixed. This ended up being annoyingly deep in TF, but we have a test case now and we pushed the fix.

@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.
Labels
core crash waiting-response An issue/pull request is waiting for a response from the community
Projects
None yet
Development

No branches or pull requests

3 participants