rancher / terraform-provider-rke

Terraform provider plugin for deploy kubernetes cluster by RKE(Rancher Kubernetes Engine)
Mozilla Public License 2.0
340 stars 152 forks source link

Terraform crash #216

Closed remche closed 4 years ago

remche commented 4 years ago

Master branch at e73f8343 build is crashing immediatly :

module.rke.rke_cluster.cluster: Creating...

Error: rpc error: code = Unavailable desc = transport is closing

panic: runtime error: invalid memory address or nil pointer dereference
2020-06-29T22:41:31.673+0200 [DEBUG] plugin.terraform-provider-rke_v1.1: [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x19cd09a]
2020-06-29T22:41:31.673+0200 [DEBUG] plugin.terraform-provider-rke_v1.1: 
2020-06-29T22:41:31.673+0200 [DEBUG] plugin.terraform-provider-rke_v1.1: goroutine 72 [running]:
2020-06-29T22:41:31.673+0200 [DEBUG] plugin.terraform-provider-rke_v1.1: github.com/rancher/rke/cluster.(*Cluster).InvertIndexHosts(0xc000d85500, 0x0, 0x0)
2020-06-29T22:41:31.673+0200 [DEBUG] plugin.terraform-provider-rke_v1.1:    /home/remche/go/pkg/mod/github.com/rancher/rke@v1.1.3/cluster/hosts.go:84 +0x1fa
2020-06-29T22:41:31.673+0200 [DEBUG] plugin.terraform-provider-rke_v1.1: github.com/rancher/rke/cluster.InitClusterObject(0x231e780, 0xc000046090, 0xc000cdc800, 0xc00037a4e0, 0x5c, 0xc00037a300, 0x5a, 0x0, 0x0, 0x0, ...)
2020-06-29T22:41:31.673+0200 [DEBUG] plugin.terraform-provider-rke_v1.1:    /home/remche/go/pkg/mod/github.com/rancher/rke@v1.1.3/cluster/cluster.go:747 +0x508
2020-06-29T22:41:31.673+0200 [DEBUG] plugin.terraform-provider-rke_v1.1: github.com/rancher/rke/cmd.ClusterInit(0x231e780, 0xc000046090, 0xc000cdc800, 0x0, 0x0, 0x0, 0xc00037a4e0, 0x5c, 0xc00037a300, 0x5a, ...)
2020-06-29T22:41:31.673+0200 [DEBUG] plugin.terraform-provider-rke_v1.1:    /home/remche/go/pkg/mod/github.com/rancher/rke@v1.1.3/cmd/common.go:77 +0x17d
2020-06-29T22:41:31.673+0200 [DEBUG] plugin.terraform-provider-rke_v1.1: github.com/rancher/terraform-provider-rke/rke.clusterUp(0xc0003ae620, 0x0, 0x0)
2020-06-29T22:41:31.673+0200 [DEBUG] plugin.terraform-provider-rke_v1.1:    /home/remche/taf/GRICAD/CT-OS/terraform-provider-rke/rke/resource_rke_cluster.go:136 +0x1f0
2020-06-29T22:41:31.673+0200 [DEBUG] plugin.terraform-provider-rke_v1.1: github.com/rancher/terraform-provider-rke/rke.resourceRKEClusterUpdate(0xc0003ae620, 0x1c517e0, 0xc000ab4150, 0x1b7c9c0, 0x229d4f0)
2020-06-29T22:41:31.673+0200 [DEBUG] plugin.terraform-provider-rke_v1.1:    /home/remche/taf/GRICAD/CT-OS/terraform-provider-rke/rke/resource_rke_cluster.go:90 +0x83
2020-06-29T22:41:31.673+0200 [DEBUG] plugin.terraform-provider-rke_v1.1: github.com/rancher/terraform-provider-rke/rke.resourceRKEClusterCreate(0xc0003ae620, 0x1c517e0, 0xc000ab4150, 0x2, 0x3360500)
2020-06-29T22:41:31.673+0200 [DEBUG] plugin.terraform-provider-rke_v1.1:    /home/remche/taf/GRICAD/CT-OS/terraform-provider-rke/rke/resource_rke_cluster.go:85 +0xda
2020-06-29T22:41:31.673+0200 [DEBUG] plugin.terraform-provider-rke_v1.1: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Resource).Apply(0xc00075db00, 0xc0010184b0, 0xc0002fd180, 0x1c517e0, 0xc000ab4150, 0x1c22501, 0xc0009a0428, 0xc0007ed650)
2020-06-29T22:41:31.673+0200 [DEBUG] plugin.terraform-provider-rke_v1.1:    /home/remche/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk@v1.14.0/helper/schema/resource.go:310 +0x365
2020-06-29T22:41:31.673+0200 [DEBUG] plugin.terraform-provider-rke_v1.1: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Provider).Apply(0xc000870300, 0xc00114ba10, 0xc0010184b0, 0xc0002fd180, 0xc0006ff168, 0xc0005a4cc0, 0x1c25a40)
2020-06-29T22:41:31.673+0200 [DEBUG] plugin.terraform-provider-rke_v1.1:    /home/remche/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk@v1.14.0/helper/schema/provider.go:294 +0x99
2020-06-29T22:41:31.673+0200 [DEBUG] plugin.terraform-provider-rke_v1.1: github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin.(*GRPCProviderServer).ApplyResourceChange(0xc0004b2198, 0x231e800, 0xc000e78d20, 0xc0003149a0, 0xc0004b2198, 0xc000e78d20, 0xc000e1cb78)
2020-06-29T22:41:31.673+0200 [DEBUG] plugin.terraform-provider-rke_v1.1:    /home/remche/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk@v1.14.0/internal/helper/plugin/grpc_provider.go:885 +0x8b4
2020-06-29T22:41:31.673+0200 [DEBUG] plugin.terraform-provider-rke_v1.1: github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5._Provider_ApplyResourceChange_Handler(0x1e4b5e0, 0xc0004b2198, 0x231e800, 0xc000e78d20, 0xc000b903c0, 0x0, 0x231e800, 0xc000e78d20, 0xc00115e000, 0x3d8c)
2020-06-29T22:41:31.673+0200 [DEBUG] plugin.terraform-provider-rke_v1.1:    /home/remche/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk@v1.14.0/internal/tfplugin5/tfplugin5.pb.go:3305 +0x217
2020-06-29T22:41:31.673+0200 [DEBUG] plugin.terraform-provider-rke_v1.1: google.golang.org/grpc.(*Server).processUnaryRPC(0xc00057f800, 0x2338cc0, 0xc0006c2c00, 0xc000120400, 0xc000756e70, 0x331a000, 0x0, 0x0, 0x0)
2020-06-29T22:41:31.673+0200 [DEBUG] plugin.terraform-provider-rke_v1.1:    /home/remche/go/pkg/mod/google.golang.org/grpc@v1.27.1/server.go:1024 +0x501
2020-06-29T22:41:31.673+0200 [DEBUG] plugin.terraform-provider-rke_v1.1: google.golang.org/grpc.(*Server).handleStream(0xc00057f800, 0x2338cc0, 0xc0006c2c00, 0xc000120400, 0x0)
2020-06-29T22:41:31.673+0200 [DEBUG] plugin.terraform-provider-rke_v1.1:    /home/remche/go/pkg/mod/google.golang.org/grpc@v1.27.1/server.go:1313 +0xd3d
2020-06-29T22:41:31.673+0200 [DEBUG] plugin.terraform-provider-rke_v1.1: google.golang.org/grpc.(*Server).serveStreams.func1.1(0xc00047e0d0, 0xc00057f800, 0x2338cc0, 0xc0006c2c00, 0xc000120400)
2020-06-29T22:41:31.673+0200 [DEBUG] plugin.terraform-provider-rke_v1.1:    /home/remche/go/pkg/mod/google.golang.org/grpc@v1.27.1/server.go:722 +0xa1
2020-06-29T22:41:31.673+0200 [DEBUG] plugin.terraform-provider-rke_v1.1: created by google.golang.org/grpc.(*Server).serveStreams.func1
2020-06-29T22:41:31.673+0200 [DEBUG] plugin.terraform-provider-rke_v1.1:    /home/remche/go/pkg/mod/google.golang.org/grpc@v1.27.1/server.go:720 +0xa1
2020-06-29T22:41:31.677+0200 [DEBUG] plugin: plugin process exited: path=/home/remche/.terraform.d/plugins/terraform-provider-rke_v1.1 pid=232697 error="exit status 2"
2020-06-29T22:41:31.678+0200 [WARN]  plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2020/06/29 22:41:31 [DEBUG] module.rke.rke_cluster.cluster: apply errored, but we're indicating that via the Error pointer rather than returning it: rpc error: code = Unavailable desc = transport is closing
2020/06/29 22:41:31 [TRACE] module.rke: eval: *terraform.EvalMaybeTainted
2020/06/29 22:41:31 [TRACE] EvalMaybeTainted: module.rke.rke_cluster.cluster encountered an error during creation, so it is now marked as tainted
2020/06/29 22:41:31 [TRACE] module.rke: eval: *terraform.EvalWriteState
2020/06/29 22:41:31 [TRACE] EvalWriteState: removing state object for module.rke.rke_cluster.cluster
2020/06/29 22:41:31 [TRACE] module.rke: eval: *terraform.EvalApplyProvisioners
2020/06/29 22:41:31 [TRACE] EvalApplyProvisioners: rke_cluster.cluster has no state, so skipping provisioners
2020/06/29 22:41:31 [TRACE] module.rke: eval: *terraform.EvalMaybeTainted
2020/06/29 22:41:31 [TRACE] EvalMaybeTainted: module.rke.rke_cluster.cluster encountered an error during creation, so it is now marked as tainted
2020/06/29 22:41:31 [TRACE] module.rke: eval: *terraform.EvalWriteState
2020/06/29 22:41:31 [TRACE] EvalWriteState: removing state object for module.rke.rke_cluster.cluster
2020/06/29 22:41:31 [TRACE] module.rke: eval: *terraform.EvalIf
2020/06/29 22:41:31 [TRACE] module.rke: eval: *terraform.EvalIf
2020/06/29 22:41:31 [TRACE] module.rke: eval: *terraform.EvalWriteDiff
2020/06/29 22:41:31 [TRACE] module.rke: eval: *terraform.EvalApplyPost
2020/06/29 22:41:31 [ERROR] module.rke: eval: *terraform.EvalApplyPost, err: rpc error: code = Unavailable desc = transport is closing
2020/06/29 22:41:31 [ERROR] module.rke: eval: *terraform.EvalSequence, err: rpc error: code = Unavailable desc = transport is closing
2020/06/29 22:41:31 [TRACE] [walkApply] Exiting eval tree: module.rke.rke_cluster.cluster
2020/06/29 22:41:31 [TRACE] vertex "module.rke.rke_cluster.cluster": visit complete
2020/06/29 22:41:31 [TRACE] dag/walk: upstream of "provider.rke (close)" errored, so skipping
2020/06/29 22:41:31 [TRACE] dag/walk: upstream of "module.rke.local_file.kube_cluster_yaml[0]" errored, so skipping
2020/06/29 22:41:31 [TRACE] dag/walk: upstream of "module.rke.output.rke_cluster" errored, so skipping
2020/06/29 22:41:31 [TRACE] dag/walk: upstream of "provider.local (close)" errored, so skipping
2020/06/29 22:41:31 [TRACE] dag/walk: upstream of "output.rke_cluster" errored, so skipping
2020/06/29 22:41:31 [TRACE] dag/walk: upstream of "meta.count-boundary (EachMode fixup)" errored, so skipping
2020/06/29 22:41:31 [TRACE] dag/walk: upstream of "root" errored, so skipping
2020/06/29 22:41:31 [TRACE] statemgr.Filesystem: have already backed up original terraform.tfstate to terraform.tfstate.backup on a previous write
2020/06/29 22:41:31 [TRACE] statemgr.Filesystem: state has changed since last snapshot, so incrementing serial to 87
2020/06/29 22:41:31 [TRACE] statemgr.Filesystem: writing snapshot at terraform.tfstate
2020/06/29 22:41:31 [TRACE] statemgr.Filesystem: removing lock metadata file .terraform.tfstate.lock.info
2020/06/29 22:41:31 [TRACE] statemgr.Filesystem: unlocking terraform.tfstate using fcntl flock
2020-06-29T22:41:31.739+0200 [DEBUG] plugin: plugin exited
2020-06-29T22:41:31.741+0200 [DEBUG] plugin: plugin process exited: path=/home/remche/taf/GRICAD/CT-OS/nova-k8s-tf/.terraform/plugins/linux_amd64/terraform-provider-local_v1.4.0_x4 pid=232647
2020-06-29T22:41:31.741+0200 [DEBUG] plugin: plugin exited
rawmind0 commented 4 years ago

@remche , it's an issue when ignore_docker_version = false or not defined. Fixed on PR #217 In the meanwhile, if you set ignore_docker_version = true in your tf file, should work.

rawmind0 commented 4 years ago

PR merged on master. Related to #207 . Please, reopen issue if needed.