Terraform v0.12.8
# Configure the AWS Provider
provider "aws" {
region = "us-east-1"
}
# Create a VPC
resource "aws_vpc" "example" {
cidr_block = "10.0.0.0/16"
}
2019/09/08 15:08:32 [INFO] Go runtime version: go1.12.9
2019/09/08 15:08:32 [INFO] CLI args: []string{"/Users/gabdav01/Library/Application Support/splatt/bin/terraform_0.12.8_darwin_amd64/terraform", "init", "-input=false"}
2019/09/08 15:08:32 [ERROR] Error detecting default CLI config file path: user: Current not implemented on darwin/amd64
2019/09/08 15:08:32 [DEBUG] Attempting to open CLI config file:
2019/09/08 15:08:32 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2019/09/08 15:08:32 [ERROR] Error finding global config directory: user: Current not implemented on darwin/amd64
2019/09/08 15:08:32 [WARN] Cannot initialize remote host credentials manager: can't locate credentials file: user: Current not implemented on darwin/amd64
2019/09/08 15:08:32 [ERROR] Error finding global config directory: user: Current not implemented on darwin/amd64
2019/09/08 15:08:32 [INFO] CLI command args: []string{"init", "-input=false"}
2019/09/08 15:08:32 [ERR] Checkpoint setup error: user: Current not implemented on darwin/amd64
Initializing the backend...
2019/09/08 15:08:32 [TRACE] Meta.Backend: no config given or present on disk, so returning nil config
2019/09/08 15:08:32 [TRACE] Meta.Backend: backend has not previously been initialized in this working directory
2019/09/08 15:08:32 [DEBUG] New state was assigned lineage "3c943d82-c0d9-2ba1-8cb8-505e66d61d75"
2019/09/08 15:08:32 [TRACE] Meta.Backend: using default local state only (no backend configuration, and no existing initialized backend)
2019/09/08 15:08:32 [TRACE] Meta.Backend: instantiated backend of type <nil>
2019/09/08 15:08:32 [DEBUG] checking for provider in "."
2019/09/08 15:08:32 [DEBUG] checking for provider in "/Users/gabdav01/Library/Application Support/splatt/bin/terraform_0.12.8_darwin_amd64"
2019/09/08 15:08:32 [DEBUG] checking for provisioner in "."
2019/09/08 15:08:32 [DEBUG] checking for provisioner in "/Users/gabdav01/Library/Application Support/splatt/bin/terraform_0.12.8_darwin_amd64"
2019/09/08 15:08:32 [INFO] Failed to read plugin lock file .terraform/plugins/darwin_amd64/lock.json: open .terraform/plugins/darwin_amd64/lock.json: no such file or directory
2019/09/08 15:08:32 [TRACE] Meta.Backend: backend <nil> does not support operations, so wrapping it in a local backend
2019/09/08 15:08:32 [TRACE] backend/local: state manager for workspace "default" will:
- read initial snapshot from terraform.tfstate
- write new snapshots to terraform.tfstate
- create any backup at terraform.tfstate.backup
2019/09/08 15:08:32 [TRACE] statemgr.Filesystem: reading initial snapshot from terraform.tfstate
2019/09/08 15:08:32 [TRACE] statemgr.Filesystem: snapshot file has nil snapshot, but that's okay
2019/09/08 15:08:32 [TRACE] statemgr.Filesystem: read nil snapshot
2019/09/08 15:08:32 [DEBUG] checking for provider in "."
2019/09/08 15:08:32 [DEBUG] checking for provider in "/Users/gabdav01/Library/Application Support/splatt/bin/terraform_0.12.8_darwin_amd64"
Initializing provider plugins...
2019/09/08 15:08:32 [DEBUG] plugin requirements: "aws"="2.27.0"
2019/09/08 15:08:32 [DEBUG] plugin requirements: "ignition"="1.1.0"
2019/09/08 15:08:32 [DEBUG] plugin requirements: "template"="2.1.2"
- Checking for available provider plugins...
panic: runtime error: invalid memory address or nil pointer dereference
- Checking for available provider plugins...
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x245a716]
goroutine 1 [running]:
github.com/hashicorp/terraform/command/cliconfig.(*CredentialsSource).ForHost(0x0, 0x2994db1, 0x15, 0xa, 0xc000295280, 0x29785b3, 0x3)
/opt/teamcity-agent/work/9e329aa031982669/src/github.com/hashicorp/terraform/command/cliconfig/credentials.go:155 +0x26
github.com/hashicorp/terraform/svchost/disco.(*Disco).CredentialsForHost(...)
/opt/teamcity-agent/work/9e329aa031982669/src/github.com/hashicorp/terraform/svchost/disco/disco.go:96
github.com/hashicorp/terraform/svchost/disco.(*Disco).discover(0xc00003ac60, 0x2994db1, 0x15, 0x0, 0x0, 0x0)
/opt/teamcity-agent/work/9e329aa031982669/src/github.com/hashicorp/terraform/svchost/disco/disco.go:190 +0x10c6
github.com/hashicorp/terraform/svchost/disco.(*Disco).Discover(0xc00003ac60, 0x2994db1, 0x15, 0x0, 0xc000000073, 0xc000052180)
/opt/teamcity-agent/work/9e329aa031982669/src/github.com/hashicorp/terraform/svchost/disco/disco.go:141 +0x87
github.com/hashicorp/terraform/svchost/disco.(*Disco).DiscoverServiceURL(0xc00003ac60, 0x2994db1, 0x15, 0x2985155, 0xc, 0x0, 0x0, 0x0)
/opt/teamcity-agent/work/9e329aa031982669/src/github.com/hashicorp/terraform/svchost/disco/disco.go:153 +0x43
github.com/hashicorp/terraform/registry.(*Client).Discover(0xc00095a690, 0x2994db1, 0x15, 0x2985155, 0xc, 0x0, 0xc00009a150, 0x40)
/opt/teamcity-agent/work/9e329aa031982669/src/github.com/hashicorp/terraform/registry/client.go:63 +0x61
github.com/hashicorp/terraform/registry.(*Client).TerraformProviderVersions(0xc00095a690, 0xc000902d20, 0x0, 0x0, 0x0)
/opt/teamcity-agent/work/9e329aa031982669/src/github.com/hashicorp/terraform/registry/client.go:237 +0xc0
github.com/hashicorp/terraform/plugin/discovery.(*ProviderInstaller).listProviderVersions(0xc0003d87e0, 0xc00059d0a6, 0x3, 0x100, 0x1, 0x0)
/opt/teamcity-agent/work/9e329aa031982669/src/github.com/hashicorp/terraform/plugin/discovery/get.go:476 +0x7e
github.com/hashicorp/terraform/plugin/discovery.(*ProviderInstaller).Get(0xc0003d87e0, 0xc00059d0a6, 0x3, 0xc0000c09a8, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, ...)
/opt/teamcity-agent/work/9e329aa031982669/src/github.com/hashicorp/terraform/plugin/discovery/get.go:124 +0xd1
github.com/hashicorp/terraform/command.(*InitCommand).getProviders(0xc0004136c0, 0xc0003507e0, 0x0, 0x0, 0xc000642480, 0x0, 0x0, 0x0)
/opt/teamcity-agent/work/9e329aa031982669/src/github.com/hashicorp/terraform/command/init.go:519 +0x415
github.com/hashicorp/terraform/command.(*InitCommand).Run(0xc0004136c0, 0xc0000c4020, 0x1, 0x1, 0xc0000c7980)
/opt/teamcity-agent/work/9e329aa031982669/src/github.com/hashicorp/terraform/command/init.go:337 +0x1021
github.com/mitchellh/cli.(*CLI).Run(0xc000116640, 0xc000116640, 0xc00053bd90, 0x1)
/opt/teamcity-agent/work/9e329aa031982669/pkg/mod/github.com/mitchellh/[email protected]/cli.go:255 +0x1f1
main.wrappedMain(0x0)
/opt/teamcity-agent/work/9e329aa031982669/src/github.com/hashicorp/terraform/main.go:232 +0xb66
main.realMain(0x0)
/opt/teamcity-agent/work/9e329aa031982669/src/github.com/hashicorp/terraform/main.go:100 +0xb4
main.main()
/opt/teamcity-agent/work/9e329aa031982669/src/github.com/hashicorp/terraform/main.go:36 +0x3b
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x245a716]
goroutine 1 [running]:
github.com/hashicorp/terraform/command/cliconfig.(*CredentialsSource).ForHost(0x0, 0x2994db1, 0x15, 0xa, 0xc000295280, 0x29785b3, 0x3)
/opt/teamcity-agent/work/9e329aa031982669/src/github.com/hashicorp/terraform/command/cliconfig/credentials.go:155 +0x26
github.com/hashicorp/terraform/svchost/disco.(*Disco).CredentialsForHost(...)
/opt/teamcity-agent/work/9e329aa031982669/src/github.com/hashicorp/terraform/svchost/disco/disco.go:96
github.com/hashicorp/terraform/svchost/disco.(*Disco).discover(0xc00003ac60, 0x2994db1, 0x15, 0x0, 0x0, 0x0)
/opt/teamcity-agent/work/9e329aa031982669/src/github.com/hashicorp/terraform/svchost/disco/disco.go:190 +0x10c6
github.com/hashicorp/terraform/svchost/disco.(*Disco).Discover(0xc00003ac60, 0x2994db1, 0x15, 0x0, 0xc000000073, 0xc000052180)
/opt/teamcity-agent/work/9e329aa031982669/src/github.com/hashicorp/terraform/svchost/disco/disco.go:141 +0x87
github.com/hashicorp/terraform/svchost/disco.(*Disco).DiscoverServiceURL(0xc00003ac60, 0x2994db1, 0x15, 0x2985155, 0xc, 0x0, 0x0, 0x0)
/opt/teamcity-agent/work/9e329aa031982669/src/github.com/hashicorp/terraform/svchost/disco/disco.go:153 +0x43
github.com/hashicorp/terraform/registry.(*Client).Discover(0xc00095a690, 0x2994db1, 0x15, 0x2985155, 0xc, 0x0, 0xc00009a150, 0x40)
/opt/teamcity-agent/work/9e329aa031982669/src/github.com/hashicorp/terraform/registry/client.go:63 +0x61
github.com/hashicorp/terraform/registry.(*Client).TerraformProviderVersions(0xc00095a690, 0xc000902d20, 0x0, 0x0, 0x0)
/opt/teamcity-agent/work/9e329aa031982669/src/github.com/hashicorp/terraform/registry/client.go:237 +0xc0
github.com/hashicorp/terraform/plugin/discovery.(*ProviderInstaller).listProviderVersions(0xc0003d87e0, 0xc00059d0a6, 0x3, 0x100, 0x1, 0x0)
/opt/teamcity-agent/work/9e329aa031982669/src/github.com/hashicorp/terraform/plugin/discovery/get.go:476 +0x7e
github.com/hashicorp/terraform/plugin/discovery.(*ProviderInstaller).Get(0xc0003d87e0, 0xc00059d0a6, 0x3, 0xc0000c09a8, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, ...)
/opt/teamcity-agent/work/9e329aa031982669/src/github.com/hashicorp/terraform/plugin/discovery/get.go:124 +0xd1
github.com/hashicorp/terraform/command.(*InitCommand).getProviders(0xc0004136c0, 0xc0003507e0, 0x0, 0x0, 0xc000642480, 0x0, 0x0, 0x0)
/opt/teamcity-agent/work/9e329aa031982669/src/github.com/hashicorp/terraform/command/init.go:519 +0x415
github.com/hashicorp/terraform/command.(*InitCommand).Run(0xc0004136c0, 0xc0000c4020, 0x1, 0x1, 0xc0000c7980)
/opt/teamcity-agent/work/9e329aa031982669/src/github.com/hashicorp/terraform/command/init.go:337 +0x1021
github.com/mitchellh/cli.(*CLI).Run(0xc000116640, 0xc000116640, 0xc00053bd90, 0x1)
/opt/teamcity-agent/work/9e329aa031982669/pkg/mod/github.com/mitchellh/[email protected]/cli.go:255 +0x1f1
main.wrappedMain(0x0)
/opt/teamcity-agent/work/9e329aa031982669/src/github.com/hashicorp/terraform/main.go:232 +0xb66
main.realMain(0x0)
/opt/teamcity-agent/work/9e329aa031982669/src/github.com/hashicorp/terraform/main.go:100 +0xb4
main.main()
/opt/teamcity-agent/work/9e329aa031982669/src/github.com/hashicorp/terraform/main.go:36 +0x3b
!!!!!!!!!!!!!!!!!!!!!!!!!!! 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 !!!!!!!!!!!!!!!!!!!!!!!!!!!!
Terraform successfully initialized, or fail gracefully with clear message on what is missing.
Terraform crushed
$ unset HOME
$ terraform init
It seems v0.12.8 introduced a dependency on HOME environment variable to exist. In some testing envs (like Tox) this variable is _not_ passed to the testing process.
https://tox.readthedocs.io/en/latest/config.html#conf-passenv
Any update on a nicer error? cc @jbardin @mildwonkey @alisdair
@ofek @mindw I've been going through and re-triaging all the issues labeled crash in this repository, and I noticed that some variant of this has been reported several times. I've been consolidating all of them into https://github.com/hashicorp/terraform/issues/24520. I just noticed this, and it looks like an identical crash message to 24520:
From #24520:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x2449596]
goroutine 1 [running]:
github.com/hashicorp/terraform/command/cliconfig.(*CredentialsSource).ForHost(0x0, 0x2a584d5, 0x15, 0x6, 0xc0000f01e8, 0x2a3a8b3, 0x3)
/private/tmp/terraform-20200319-2773-d1flw8/terraform-0.12.24/src/github.com/hashicorp/terraform/command/cliconfig/credentials.go:155 +0x26
I'm going to close this and treat #24520 as the primary issue for this bug. If you're interested in watching for the resolution, please follow and 👍 that issue. Please let me know ([email protected]) if you think I've missed something and this should a different issue.
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.
Most helpful comment
Any update on a nicer error? cc @jbardin @mildwonkey @alisdair