Open ThisMayActuallyBeTyler opened 5 years ago
Hello @ThisMayActuallyBeTyler
Thank you for the detail report, we didn't consider manual networks for the MVP of the connector, but unfortunately, we have considered the case where the manual network come from the template.
There isn't an acceptance test validating this scenario. An acceptant test should be added as part of this ticket.
Regards.
Hi James. I talked with Tyler and got the steps to reproduce this issue. They are as documented above.
terraform apply
Here is my code:
variable "skytap_username" {}
variable "skytap_api_token" {}
provider "skytap" {
username = "${var.skytap_username}"
api_token = "${var.skytap_api_token}"
}
resource "skytap_environment" "MBTest" {
template_id = "1652071"
name = "MB Terraform Test (Manual Net)"
description = "Testing TF deployment flow"
}
resource "skytap_vm" "Add" {
template_id = "1652071"
vm_id = "48749233"
environment_id = "${skytap_environment.MBTest.id}"
name = "Add"
}
Here is the result:
[thewellington:~/Development … ps_stacks/issue29] dev(+34/-18)* ± terraform apply
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
+ skytap_environment.MBTest
id: <computed>
description: "Testing TF deployment flow"
name: "MB Terraform Test (Manual Net)"
outbound_traffic: "false"
routable: "false"
template_id: "1652071"
+ skytap_vm.Add
id: <computed>
cpus: <computed>
environment_id: "${skytap_environment.MBTest.id}"
max_cpus: <computed>
max_ram: <computed>
name: "Add"
network_interface.#: <computed>
os_disk_size: <computed>
ram: <computed>
service_ips.%: <computed>
service_ports.%: <computed>
template_id: "1652071"
vm_id: "48749233"
Plan: 2 to add, 0 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
skytap_environment.MBTest: Creating...
description: "" => "Testing TF deployment flow"
name: "" => "MB Terraform Test (Manual Net)"
outbound_traffic: "" => "false"
routable: "" => "false"
template_id: "" => "1652071"
skytap_environment.MBTest: Still creating... (10s elapsed)
skytap_environment.MBTest: Still creating... (20s elapsed)
skytap_environment.MBTest: Still creating... (30s elapsed)
skytap_environment.MBTest: Still creating... (40s elapsed)
skytap_environment.MBTest: Still creating... (50s elapsed)
skytap_environment.MBTest: Creation complete after 56s (ID: 56190286)
skytap_vm.Add: Creating...
cpus: "" => "<computed>"
environment_id: "" => "56190286"
max_cpus: "" => "<computed>"
max_ram: "" => "<computed>"
name: "" => "Add"
network_interface.#: "" => "<computed>"
os_disk_size: "" => "<computed>"
ram: "" => "<computed>"
service_ips.%: "" => "<computed>"
service_ports.%: "" => "<computed>"
template_id: "" => "1652071"
vm_id: "" => "48749233"
skytap_vm.Add: Still creating... (10s elapsed)
skytap_vm.Add: Still creating... (20s elapsed)
skytap_vm.Add: Still creating... (30s elapsed)
skytap_vm.Add: Still creating... (40s elapsed)
skytap_vm.Add: Still creating... (50s elapsed)
skytap_vm.Add: Still creating... (1m0s elapsed)
skytap_vm.Add: Still creating... (1m10s elapsed)
skytap_vm.Add: Still creating... (1m20s elapsed)
skytap_vm.Add: Still creating... (1m30s elapsed)
skytap_vm.Add: Still creating... (1m40s elapsed)
Error: Error applying plan:
1 error(s) occurred:
* skytap_vm.Add: 1 error(s) occurred:
* skytap_vm.Add: unexpected EOF
Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.
panic: runtime error: invalid memory address or nil pointer dereference
2019-06-19T11:28:28.716-0700 [DEBUG] plugin.terraform-provider-skytap: [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x18e2552]
2019-06-19T11:28:28.716-0700 [DEBUG] plugin.terraform-provider-skytap:
2019-06-19T11:28:28.716-0700 [DEBUG] plugin.terraform-provider-skytap: goroutine 89 [running]:
2019-06-19T11:28:28.716-0700 [DEBUG] plugin.terraform-provider-skytap: github.com/terraform-providers/terraform-provider-skytap/skytap.flattenNetworkInterface(0xc00058ac90, 0x0, 0x0, 0xc00058aca0, 0xc0004a3e78, 0x24deda8, 0x0, 0x0, 0xc0004a3f10, 0x24deda8, ...)
2019-06-19T11:28:28.716-0700 [DEBUG] plugin.terraform-provider-skytap: /Users/thewellington/Development/go/src/github.com/terraform-providers/terraform-provider-skytap/skytap/structures.go:27 +0x1a2
2019-06-19T11:28:28.716-0700 [DEBUG] plugin.terraform-provider-skytap: github.com/terraform-providers/terraform-provider-skytap/skytap.flattenNetworkInterfaces(0xc00048ee00, 0x1, 0x4, 0x0)
2019-06-19T11:28:28.716-0700 [DEBUG] plugin.terraform-provider-skytap: /Users/thewellington/Development/go/src/github.com/terraform-providers/terraform-provider-skytap/skytap/structures.go:16 +0xfc
2019-06-19T11:28:28.716-0700 [DEBUG] plugin.terraform-provider-skytap: github.com/terraform-providers/terraform-provider-skytap/skytap.resourceSkytapVMReadAfterCreateUpdate(0xc0002824d0, 0x194db60, 0xc00049a080, 0x0, 0x0, 0x1ac0b60, 0xc000622000, 0x0, 0xc000622000)
2019-06-19T11:28:28.716-0700 [DEBUG] plugin.terraform-provider-skytap: /Users/thewellington/Development/go/src/github.com/terraform-providers/terraform-provider-skytap/skytap/resource_skytap_vm.go:317 +0xfc8
2019-06-19T11:28:28.716-0700 [DEBUG] plugin.terraform-provider-skytap: github.com/terraform-providers/terraform-provider-skytap/skytap.resourceSkytapVMCreate(0xc0002824d0, 0x194db60, 0xc00049a080, 0xc0002824d0, 0x0)
2019-06-19T11:28:28.716-0700 [DEBUG] plugin.terraform-provider-skytap: /Users/thewellington/Development/go/src/github.com/terraform-providers/terraform-provider-skytap/skytap/resource_skytap_vm.go:258 +0x717
2019-06-19T11:28:28.716-0700 [DEBUG] plugin.terraform-provider-skytap: github.com/terraform-providers/terraform-provider-skytap/vendor/github.com/hashicorp/terraform/helper/schema.(*Resource).Apply(0xc0004447e0, 0xc000370410, 0xc0001bcee0, 0x194db60, 0xc00049a080, 0x1, 0x0, 0x0)
2019-06-19T11:28:28.716-0700 [DEBUG] plugin.terraform-provider-skytap: /Users/thewellington/Development/go/src/github.com/terraform-providers/terraform-provider-skytap/vendor/github.com/hashicorp/terraform/helper/schema/resource.go:225 +0x3a2
2019-06-19T11:28:28.716-0700 [DEBUG] plugin.terraform-provider-skytap: github.com/terraform-providers/terraform-provider-skytap/vendor/github.com/hashicorp/terraform/helper/schema.(*Provider).Apply(0xc000444850, 0xc0003703c0, 0xc000370410, 0xc0001bcee0, 0xc0003bf950, 0xc0003bedb0, 0x18)
2019-06-19T11:28:28.716-0700 [DEBUG] plugin.terraform-provider-skytap: /Users/thewellington/Development/go/src/github.com/terraform-providers/terraform-provider-skytap/vendor/github.com/hashicorp/terraform/helper/schema/provider.go:283 +0x18f
2019-06-19T11:28:28.716-0700 [DEBUG] plugin.terraform-provider-skytap: github.com/terraform-providers/terraform-provider-skytap/vendor/github.com/hashicorp/terraform/plugin.(*ResourceProviderServer).Apply(0xc0003821e0, 0xc0001bce60, 0xc000474480, 0x0, 0x0)
2019-06-19T11:28:28.716-0700 [DEBUG] plugin.terraform-provider-skytap: /Users/thewellington/Development/go/src/github.com/terraform-providers/terraform-provider-skytap/vendor/github.com/hashicorp/terraform/plugin/resource_provider.go:527 +0x57
2019-06-19T11:28:28.717-0700 [DEBUG] plugin.terraform-provider-skytap: reflect.Value.call(0xc0000ab440, 0xc00016a840, 0x13, 0x1afa288, 0x4, 0xc0006a4f18, 0x3, 0x3, 0xc0000d8a40, 0x0, ...)
2019-06-19T11:28:28.717-0700 [DEBUG] plugin.terraform-provider-skytap: /usr/local/go/src/reflect/value.go:447 +0x461
2019-06-19T11:28:28.717-0700 [DEBUG] plugin.terraform-provider-skytap: reflect.Value.Call(0xc0000ab440, 0xc00016a840, 0x13, 0xc0001b5f18, 0x3, 0x3, 0x0, 0x0, 0x0)
2019-06-19T11:28:28.717-0700 [DEBUG] plugin.terraform-provider-skytap: /usr/local/go/src/reflect/value.go:308 +0xa4
2019-06-19T11:28:28.717-0700 [DEBUG] plugin.terraform-provider-skytap: net/rpc.(*service).call(0xc0003d6040, 0xc000172460, 0xc00014a640, 0xc00014a650, 0xc000148680, 0xc000169340, 0x19520e0, 0xc0001bce60, 0x16, 0x1952120, ...)
2019-06-19T11:28:28.717-0700 [DEBUG] plugin.terraform-provider-skytap: /usr/local/go/src/net/rpc/server.go:384 +0x14e
2019-06-19T11:28:28.717-0700 [DEBUG] plugin.terraform-provider-skytap: created by net/rpc.(*Server).ServeCodec
2019-06-19T11:28:28.717-0700 [DEBUG] plugin.terraform-provider-skytap: /usr/local/go/src/net/rpc/server.go:481 +0x42b
2019/06/19 11:28:28 [TRACE] root: eval: *terraform.EvalWriteState
2019/06/19 11:28:28 [TRACE] root: eval: *terraform.EvalApplyProvisioners
2019/06/19 11:28:28 [TRACE] root: eval: *terraform.EvalIf
2019/06/19 11:28:28 [TRACE] root: eval: *terraform.EvalWriteState
2019/06/19 11:28:28 [TRACE] root: eval: *terraform.EvalWriteDiff
2019/06/19 11:28:28 [TRACE] root: eval: *terraform.EvalApplyPost
2019/06/19 11:28:28 [ERROR] root: eval: *terraform.EvalApplyPost, err: 1 error(s) occurred:
* skytap_vm.Add: unexpected EOF
2019/06/19 11:28:28 [ERROR] root: eval: *terraform.EvalSequence, err: 1 error(s) occurred:
* skytap_vm.Add: unexpected EOF
2019/06/19 11:28:28 [TRACE] [walkApply] Exiting eval tree: skytap_vm.Add
2019/06/19 11:28:28 [TRACE] dag/walk: upstream errored, not walking "provider.skytap (close)"
2019/06/19 11:28:28 [TRACE] dag/walk: upstream errored, not walking "meta.count-boundary (count boundary fixup)"
2019-06-19T11:28:28.720-0700 [DEBUG] plugin: plugin process exited: path=/Users/thewellington/.terraform.d/plugins/terraform-provider-skytap
2019/06/19 11:28:28 [TRACE] dag/walk: upstream errored, not walking "root"
2019/06/19 11:28:28 [TRACE] Preserving existing state lineage "2021d718-ac31-b046-40fc-c3afcf0e10d4"
2019/06/19 11:28:28 [TRACE] Preserving existing state lineage "2021d718-ac31-b046-40fc-c3afcf0e10d4"
2019/06/19 11:28:28 [TRACE] Preserving existing state lineage "2021d718-ac31-b046-40fc-c3afcf0e10d4"
2019/06/19 11:28:28 [DEBUG] plugin: waiting for all plugin processes to complete...
2019-06-19T11:28:28.808-0700 [WARN ] plugin: error closing client during Kill: err="connection is shut down"
!!!!!!!!!!!!!!!!!!!!!!!!!!! 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 !!!!!!!!!!!!!!!!!!!!!!!!!!!!
[thewellington:~/Development … ps_stacks/issue29] dev(+34/-18)* 1 ±
Because I cannot share the template with your account, you will have to go through the steps to reproduce yourself. I can assist w/ that. We can chat tomorrow.
Also, I am still running the code I built, equal to v0.10
[thewellington:~/Development … ps_stacks/issue29] dev(+34/-18)* 127 ± terraform -version
Terraform v0.11.13
+ provider.skytap (unversioned)
👍
Terraform Version
This was also attempted by other users on v0.11.13
Affected Resource(s)
func flattenNetworkInterface(v skytap.Interface) map[string]interface{} {
Terraform Configuration Files
Debug Output
Panic Output
Expected Behavior
Terraform should add a VM from a template to the designated environment regardless of automatic or manual networks.
Actual Behavior
It seems like adding a VM connected to a manual network to an existing environment in Terraform causes Terraform to crash. The environment and corresponding add VM functionaility completes in Skytap as expected. However, Terraform crashes despite the process completing within Skytap
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform apply
Important Factoids
This may be related to "null" values retrieved in the "interfaces" section of JSON retrieved for a VM with one NIC on a manual network