Closed hposca closed 1 year ago
Same here after an upgrade to 1.10. Yeah "surprise" but no harm done in my case.
I can reproduce the issue with providers versions 1.10.0, 1.9.0 and 1.8.0, but not 1.7.0.
Never noticed it because all my deployments happen to have at least one volume.
Tried to work it around with an empty volume {}
block but it crashed the provider:
kubernetes_deployment.kube_state_metrics: Creating...
Error: rpc error: code = Unavailable desc = transport is closing
panic: interface conversion: interface {} is nil, not map[string]interface {}
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4:
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4: goroutine 97 [running]:
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4: github.com/terraform-providers/terraform-provider-kubernetes/kubernetes.expandVolumes(0xc0007b0790, 0x1,
0x1, 0x6, 0xc0006d9518, 0x1, 0x0, 0x0)
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4: /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-kubern
etes/kubernetes/structures_pod.go:875 +0x273b
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4: github.com/terraform-providers/terraform-provider-kubernetes/kubernetes.expandPodSpec(0xc0007b0690, 0x1,
0x1, 0x4, 0xc0004d2988, 0x0)
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4: /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-kubern
etes/kubernetes/structures_pod.go:556 +0xb7c
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4: github.com/terraform-providers/terraform-provider-kubernetes/kubernetes.expandPodTemplate(0xc0007b0670,
0x1, 0x1, 0x8, 0xc000ae1cc8, 0x19a4880)
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4: /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-kubern
etes/kubernetes/structures_deployment.go:108 +0x261
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4: github.com/terraform-providers/terraform-provider-kubernetes/kubernetes.expandDeploymentSpec(0xc0007b060
0, 0x1, 0x1, 0x19a4880, 0xc0008730c0, 0x1)
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4: /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-kubern
etes/kubernetes/structures_deployment.go:89 +0x3ea
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4: github.com/terraform-providers/terraform-provider-kubernetes/kubernetes.resourceKubernetesDeploymentCrea
te(0xc00029fce0, 0x196e520, 0xc000a06fd0, 0x2, 0x350f840)
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4: /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-kubern
etes/kubernetes/resource_kubernetes_deployment.go:201 +0x148
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4: github.com/terraform-providers/terraform-provider-kubernetes/vendor/github.com/hashicorp/terraform-plugi
n-sdk/helper/schema.(*Resource).Apply(0xc000421100, 0xc0008be0a0, 0xc0008721c0, 0x196e520, 0xc000a06fd0, 0xc000868301, 0xc0007b8228, 0x1a4cfa0)
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4: /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-kubern
etes/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/resource.go:305 +0x3b4
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4: github.com/terraform-providers/terraform-provider-kubernetes/vendor/github.com/hashicorp/terraform-plugi
n-sdk/helper/schema.(*Provider).Apply(0xc00067ea00, 0xc00027fa68, 0xc0008be0a0, 0xc0008721c0, 0xc0006e7168, 0xc0005cb020, 0x1a4fb20)
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4: /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-kubern
etes/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/provider.go:294 +0x18f
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4: github.com/terraform-providers/terraform-provider-kubernetes/vendor/github.com/hashicorp/terraform-plugi
n-sdk/internal/helper/plugin.(*GRPCProviderServer).ApplyResourceChange(0xc0005ca110, 0x2119880, 0xc000d5e1e0, 0xc00013e9c0, 0xc0005ca110, 0xc000d5e1e0, 0xc000905bd0)
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4: /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-kubern
etes/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin/grpc_provider.go:885 +0x884
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4: github.com/terraform-providers/terraform-provider-kubernetes/vendor/github.com/hashicorp/terraform-plugi
n-sdk/internal/tfplugin5._Provider_ApplyResourceChange_Handler(0x1c493e0, 0xc0005ca110, 0x2119880, 0xc000d5e1e0, 0xc00013e960, 0x0, 0x2119880, 0xc000d5e1e0, 0xc000aa9300, 0x1060)
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4: /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-kubern
etes/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5/tfplugin5.pb.go:3189 +0x23e
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4: github.com/terraform-providers/terraform-provider-kubernetes/vendor/google.golang.org/grpc.(*Server).pro
cessUnaryRPC(0xc0005ce160, 0x2139e00, 0xc000490f00, 0xc00013a200, 0xc000533c50, 0x34d8e80, 0x0, 0x0, 0x0)
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4: /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-kubern
etes/vendor/google.golang.org/grpc/server.go:995 +0x466
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4: github.com/terraform-providers/terraform-provider-kubernetes/vendor/google.golang.org/grpc.(*Server).han
dleStream(0xc0005ce160, 0x2139e00, 0xc000490f00, 0xc00013a200, 0x0)
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4: /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-kubern
etes/vendor/google.golang.org/grpc/server.go:1275 +0xda6
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4: github.com/terraform-providers/terraform-provider-kubernetes/vendor/google.golang.org/grpc.(*Server).ser
veStreams.func1.1(0xc000040550, 0xc0005ce160, 0x2139e00, 0xc000490f00, 0xc00013a200)
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4: /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-kubern
etes/vendor/google.golang.org/grpc/server.go:710 +0x9f
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4: created by github.com/terraform-providers/terraform-provider-kubernetes/vendor/google.golang.org/grpc.(*
Server).serveStreams.func1
2019-11-15T16:42:27.925+0100 [DEBUG] plugin.terraform-provider-kubernetes_v1.10.0_x4: /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-kubern
etes/vendor/google.golang.org/grpc/server.go:708 +0xa1
2019-11-15T16:42:27.928+0100 [DEBUG] plugin: plugin process exited: path=/home/patrick/go/src/github.com/terraform-providers/terraform-provider-kubernetes/_examples/in-cluster/.terraform/plu
gins/linux_amd64/terraform-provider-kubernetes_v1.10.0_x4 pid=32335 error="exit status 2"
2019/11/15 16:42:27 [DEBUG] kubernetes_deployment.kube_state_metrics: apply errored, but we're indicating that via the Error pointer rather than returning it: rpc error: code = Unavailable d
esc = transport is closing
2019/11/15 16:42:27 [TRACE] <root>: eval: *terraform.EvalMaybeTainted
2019/11/15 16:42:27 [TRACE] EvalMaybeTainted: kubernetes_deployment.kube_state_metrics encountered an error during creation, so it is now marked as tainted
2019/11/15 16:42:27 [TRACE] <root>: eval: *terraform.EvalWriteState
2019/11/15 16:42:27 [TRACE] EvalWriteState: removing state object for kubernetes_deployment.kube_state_metrics
2019/11/15 16:42:27 [TRACE] <root>: eval: *terraform.EvalApplyProvisioners
2019/11/15 16:42:27 [TRACE] EvalApplyProvisioners: kubernetes_deployment.kube_state_metrics has no state, so skipping provisioners
2019/11/15 16:42:27 [TRACE] <root>: eval: *terraform.EvalMaybeTainted
2019/11/15 16:42:27 [TRACE] EvalMaybeTainted: kubernetes_deployment.kube_state_metrics encountered an error during creation, so it is now marked as tainted
2019/11/15 16:42:27 [TRACE] <root>: eval: *terraform.EvalWriteState
2019/11/15 16:42:27 [TRACE] EvalWriteState: removing state object for kubernetes_deployment.kube_state_metrics
2019/11/15 16:42:27 [TRACE] <root>: eval: *terraform.EvalIf
2019/11/15 16:42:27 [TRACE] <root>: eval: *terraform.EvalIf
2019/11/15 16:42:27 [TRACE] <root>: eval: *terraform.EvalWriteDiff
2019/11/15 16:42:27 [TRACE] <root>: eval: *terraform.EvalApplyPost
2019/11/15 16:42:27 [ERROR] <root>: eval: *terraform.EvalApplyPost, err: rpc error: code = Unavailable desc = transport is closing
2019/11/15 16:42:27 [ERROR] <root>: eval: *terraform.EvalSequence, err: rpc error: code = Unavailable desc = transport is closing
2019/11/15 16:42:27 [TRACE] [walkApply] Exiting eval tree: kubernetes_deployment.kube_state_metrics
2019/11/15 16:42:27 [TRACE] vertex "kubernetes_deployment.kube_state_metrics": visit complete
2019/11/15 16:42:27 [TRACE] dag/walk: upstream of "provider.kubernetes (close)" errored, so skipping
2019/11/15 16:42:27 [TRACE] dag/walk: upstream of "meta.count-boundary (EachMode fixup)" errored, so skipping
2019/11/15 16:42:27 [TRACE] dag/walk: upstream of "root" errored, so skipping
2019/11/15 16:42:27 [TRACE] statemgr.Filesystem: creating backup snapshot at terraform.tfstate.backup
2019/11/15 16:42:27 [TRACE] statemgr.Filesystem: state has changed since last snapshot, so incrementing serial to 75
2019/11/15 16:42:27 [TRACE] statemgr.Filesystem: writing snapshot at terraform.tfstate
2019/11/15 16:42:27 [TRACE] statemgr.Filesystem: removing lock metadata file .terraform.tfstate.lock.info
2019/11/15 16:42:27 [TRACE] statemgr.Filesystem: unlocking terraform.tfstate using fcntl flock
2019-11-15T16:42:27.963+0100 [DEBUG] plugin: plugin exited
!!!!!!!!!!!!!!!!!!!!!!!!!!! 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 !!!!!!!!!!!!!!!!!!!!!!!!!!!!
This issue has been open 180 days with no activity. If this issue is reproducible with the latest version of the provider and with Terraform 0.12, please comment. Otherwise this issue will be closed in 30 days.
Reproducible in provider.kubernetes v1.11.3
I was also able to reproduce this with the cron job example from the docs
resource "kubernetes_cron_job" "demo" {
metadata {
name = "demo"
}
spec {
concurrency_policy = "Replace"
failed_jobs_history_limit = 5
schedule = "1 0 * * *"
starting_deadline_seconds = 10
successful_jobs_history_limit = 10
suspend = true
# ttl_seconds_after_finished = 10
job_template {
metadata {}
spec {
backoff_limit = 2
template {
metadata {}
spec {
container {
name = "hello"
image = "busybox"
command = ["/bin/sh", "-c", "date; echo Hello from the Kubernetes cluster"]
}
restart_policy = "OnFailure"
}
}
}
}
}
}
I was able to reproduce this with tf 0.13.0 and kubernetes v1.13.3. Unwanted volume and volume mount appears in tf plan for a cronjob.
Edit: it was possible to get rid of unwanted volumes by writing volumes: {}
, but we coudn't get rid of unwanted volume claims. After trying for several hours to find a solution, we gave in, deciding to use helm provider and a regular chart.
Reproducible in kubernetes v2.0.2. Is there any update or a workaround ?
Reproducible in v2.4.1
I've tried the same workaround than @pdecat (put an empty volume {}
), and it still makes the plugin crash:
Still happening with Terraform v1.0.9 and hashicorp/kubernetes v2.9.0. Also crashed when using volumes: {}
on apply (not on plan).
Hi there,
Recently I did a
terraform plan
which said that some volumes would be created on a deployment. Which is strange as I'm not making any volume claim. Just to check, I applied and then saw that these volumes were not there. It seems like a plan bug because it even shows incompatible volumes like EC2/Azure/GCE.If there is anything I could do I'd be glad to help.
Thanks
Terraform Version
Affected Resource(s)
Terraform Configuration Files
Debug Output
Not debugged yet.
Panic Output
No panic.
Expected Behavior
Shouldn't say that it would create basically all the volume types defined in https://github.com/terraform-providers/terraform-provider-kubernetes/blob/2c80accb5635246099d383af6cfb9f2811b548e2/kubernetes/schema_volume_source.go
Actual Behavior
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform plan
terraform apply
kubectl edit deploy/kube-state-metrics --namespace kube-system
, none of these volumes appearImportant Factoids
Nothing special, running on AWS EKS.
References
None yet