CiscoDevNet / terraform-provider-intersight

Cisco Intersight Terraform
Mozilla Public License 2.0
19 stars 26 forks source link

TERRAFORM CRASH #19

Closed huich0 closed 3 years ago

huich0 commented 3 years ago

panic: runtime error: index out of range [0] with length 0 2020-12-17T21:24:26.040-0800 [DEBUG] plugin.terraform-provider-intersight_v0.1.1: 2020-12-17T21:24:26.040-0800 [DEBUG] plugin.terraform-provider-intersight_v0.1.1: goroutine 26 [running]: 2020-12-17T21:24:26.040-0800 [DEBUG] plugin.terraform-provider-intersight_v0.1.1: github.com/CiscoDevNet/terraform-provider-intersight/intersight.flattenMapFirmwareDirectDownload(0xc001545400, 0x17, 0xc001545420, 0x17, 0xc0007e38c0, 0xc0015452a0, 0x17, 0xc0015453c0, 0x17, 0xc001c35e60, ...) 2020-12-17T21:24:26.040-0800 [DEBUG] plugin.terraform-provider-intersight_v0.1.1: github.com/CiscoDevNet/terraform-provider-intersight/intersight/flatten_functions.go:5915 +0x85c 2020-12-17T21:24:26.040-0800 [DEBUG] plugin.terraform-provider-intersight_v0.1.1: github.com/CiscoDevNet/terraform-provider-intersight/intersight.resourceFirmwareUpgradeRead(0xc0002ea8c0, 0x4b530e0, 0xc00125a820, 0x1, 0x1) 2020-12-17T21:24:26.040-0800 [DEBUG] plugin.terraform-provider-intersight_v0.1.1: github.com/CiscoDevNet/terraform-provider-intersight/intersight/resource_intersight_firmware_upgrade.go:1514 +0x68a 2020-12-17T21:24:26.040-0800 [DEBUG] plugin.terraform-provider-intersight_v0.1.1: github.com/CiscoDevNet/terraform-provider-intersight/intersight.resourceFirmwareUpgradeCreate(0xc0002ea8c0, 0x4b530e0, 0xc00125a820, 0x2, 0x89e99c0) 2020-12-17T21:24:26.040-0800 [DEBUG] plugin.terraform-provider-intersight_v0.1.1: github.com/CiscoDevNet/terraform-provider-intersight/intersight/resource_intersight_firmware_upgrade.go:1487 +0x618d 2020-12-17T21:24:26.040-0800 [DEBUG] plugin.terraform-provider-intersight_v0.1.1: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(Resource).Apply(0xc00020b500, 0xc0009aa4b0, 0xc00099aca0, 0x4b530e0, 0xc00125a820, 0x4db9701, 0xc0007b5d28, 0xc000556900) 2020-12-17T21:24:26.040-0800 [DEBUG] plugin.terraform-provider-intersight_v0.1.1: github.com/hashicorp/terraform-plugin-sdk@v1.7.0/helper/schema/resource.go:305 +0x365 2020-12-17T21:24:26.040-0800 [DEBUG] plugin.terraform-provider-intersight_v0.1.1: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(Provider).Apply(0xc00114e280, 0xc001bb98e0, 0xc0009aa4b0, 0xc00099aca0, 0xc00140e748, 0xc00099e170, 0x4dbb460) 2020-12-17T21:24:26.040-0800 [DEBUG] plugin.terraform-provider-intersight_v0.1.1: github.com/hashicorp/terraform-plugin-sdk@v1.7.0/helper/schema/provider.go:294 +0x99 2020-12-17T21:24:26.040-0800 [DEBUG] plugin.terraform-provider-intersight_v0.1.1: github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin.(GRPCProviderServer).ApplyResourceChange(0xc000512020, 0x5bcb060, 0xc001969050, 0xc0009a81e0, 0xc000512020, 0xc001969050, 0xc000549a48) 2020-12-17T21:24:26.040-0800 [DEBUG] plugin.terraform-provider-intersight_v0.1.1: github.com/hashicorp/terraform-plugin-sdk@v1.7.0/internal/helper/plugin/grpc_provider.go:885 +0x8b4 2020-12-17T21:24:26.040-0800 [DEBUG] plugin.terraform-provider-intersight_v0.1.1: github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5._Provider_ApplyResourceChange_Handler(0x510f9e0, 0xc000512020, 0x5bcb060, 0xc001969050, 0xc0009a8180, 0x0, 0x5bcb060, 0xc001969050, 0xc001298000, 0x593) 2020-12-17T21:24:26.040-0800 [DEBUG] plugin.terraform-provider-intersight_v0.1.1: github.com/hashicorp/terraform-plugin-sdk@v1.7.0/internal/tfplugin5/tfplugin5.pb.go:3189 +0x217 2020-12-17T21:24:26.040-0800 [DEBUG] plugin.terraform-provider-intersight_v0.1.1: google.golang.org/grpc.(Server).processUnaryRPC(0xc0000e82c0, 0x5be3f40, 0xc000703080, 0xc0009a6400, 0xc001421020, 0x89afce0, 0x0, 0x0, 0x0) 2020-12-17T21:24:26.040-0800 [DEBUG] plugin.terraform-provider-intersight_v0.1.1: google.golang.org/grpc@v1.23.0/server.go:995 +0x460 2020-12-17T21:24:26.040-0800 [DEBUG] plugin.terraform-provider-intersight_v0.1.1: google.golang.org/grpc.(Server).handleStream(0xc0000e82c0, 0x5be3f40, 0xc000703080, 0xc0009a6400, 0x0) 2020-12-17T21:24:26.040-0800 [DEBUG] plugin.terraform-provider-intersight_v0.1.1: google.golang.org/grpc@v1.23.0/server.go:1275 +0xd3d 2020-12-17T21:24:26.040-0800 [DEBUG] plugin.terraform-provider-intersight_v0.1.1: google.golang.org/grpc.(Server).serveStreams.func1.1(0xc00051c1b0, 0xc0000e82c0, 0x5be3f40, 0xc000703080, 0xc0009a6400) 2020-12-17T21:24:26.040-0800 [DEBUG] plugin.terraform-provider-intersight_v0.1.1: google.golang.org/grpc@v1.23.0/server.go:710 +0xa1 2020-12-17T21:24:26.040-0800 [DEBUG] plugin.terraform-provider-intersight_v0.1.1: created by google.golang.org/grpc.(*Server).serveStreams.func1 2020-12-17T21:24:26.040-0800 [DEBUG] plugin.terraform-provider-intersight_v0.1.1: google.golang.org/grpc@v1.23.0/server.go:708 +0xa1 2020/12/17 21:24:26 [DEBUG] intersight_firmware_upgrade.edge1: apply errored, but we're indicating that via the Error pointer rather than returning it: rpc error: code = Unavailable desc = transport is closing 2020/12/17 21:24:26 [DEBUG] intersight_firmware_upgrade.edge[0]: apply errored, but we're indicating that via the Error pointer rather than returning it: rpc error: code = Unavailable desc = transport is closing 2020/12/17 21:24:26 [DEBUG] intersight_firmware_upgrade.edge[2]: apply errored, but we're indicating that via the Error pointer rather than returning it: rpc error: code = Unavailable desc = transport is closing 2020/12/17 21:24:26 [DEBUG] intersight_firmware_upgrade.edge[3]: apply errored, but we're indicating that via the Error pointer rather than returning it: rpc error: code = Unavailable desc = transport is closing 2020/12/17 21:24:26 [TRACE] EvalMaybeTainted: intersight_firmware_upgrade.edge1 encountered an error during creation, so it is now marked as tainted 2020/12/17 21:24:26 [TRACE] EvalMaybeTainted: intersight_firmware_upgrade.edge[2] encountered an error during creation, so it is now marked as tainted 2020/12/17 21:24:26 [TRACE] EvalMaybeTainted: intersight_firmware_upgrade.edge[3] encountered an error during creation, so it is now marked as tainted 2020/12/17 21:24:26 [TRACE] EvalWriteState: removing state object for intersight_firmware_upgrade.edge1 2020/12/17 21:24:26 [TRACE] EvalWriteState: removing state object for intersight_firmware_upgrade.edge[3] 2020/12/17 21:24:26 [TRACE] EvalWriteState: removing state object for intersight_firmware_upgrade.edge[2] 2020/12/17 21:24:26 [TRACE] EvalApplyProvisioners: intersight_firmware_upgrade.edge[2] has no state, so skipping provisioners 2020/12/17 21:24:26 [TRACE] EvalMaybeTainted: intersight_firmware_upgrade.edge[0] encountered an error during creation, so it is now marked as tainted 2020/12/17 21:24:26 [TRACE] EvalApplyProvisioners: intersight_firmware_upgrade.edge[3] has no state, so skipping provisioners 2020/12/17 21:24:26 [TRACE] EvalMaybeTainted: intersight_firmware_upgrade.edge[2] encountered an error during creation, so it is now marked as tainted 2020/12/17 21:24:26 [TRACE] EvalMaybeTainted: intersight_firmware_upgrade.edge[3] encountered an error during creation, so it is now marked as tainted 2020/12/17 21:24:26 [TRACE] EvalWriteState: removing state object for intersight_firmware_upgrade.edge[2] 2020/12/17 21:24:26 [TRACE] vertex "intersight_firmware_upgrade.edge[2]": visit complete 2020/12/17 21:24:26 [TRACE] EvalWriteState: removing state object for intersight_firmware_upgrade.edge[3] 2020/12/17 21:24:26 [TRACE] vertex "intersight_firmware_upgrade.edge[3]": visit complete 2020/12/17 21:24:26 [TRACE] EvalApplyProvisioners: intersight_firmware_upgrade.edge1 has no state, so skipping provisioners 2020/12/17 21:24:26 [TRACE] EvalMaybeTainted: intersight_firmware_upgrade.edge1 encountered an error during creation, so it is now marked as tainted 2020/12/17 21:24:26 [TRACE] EvalWriteState: removing state object for intersight_firmware_upgrade.edge1 2020/12/17 21:24:26 [TRACE] EvalWriteState: removing state object for intersight_firmware_upgrade.edge[0] 2020/12/17 21:24:26 [TRACE] EvalApplyProvisioners: intersight_firmware_upgrade.edge[0] has no state, so skipping provisioners 2020/12/17 21:24:26 [TRACE] vertex "intersight_firmware_upgrade.edge1": visit complete 2020/12/17 21:24:26 [TRACE] EvalMaybeTainted: intersight_firmware_upgrade.edge[0] encountered an error during creation, so it is now marked as tainted 2020/12/17 21:24:26 [TRACE] EvalWriteState: removing state object for intersight_firmware_upgrade.edge[0] 2020/12/17 21:24:26 [TRACE] vertex "intersight_firmware_upgrade.edge[0]": visit complete 2020/12/17 21:24:26 [TRACE] dag/walk: upstream of "meta.count-boundary (EachMode fixup)" errored, so skipping 2020/12/17 21:24:26 [TRACE] dag/walk: upstream of "provider["registry.terraform.io/ciscodevnet/intersight"] (close)" errored, so skipping 2020/12/17 21:24:26 [TRACE] dag/walk: upstream of "root" errored, so skipping 2020-12-17T21:24:26.043-0800 [DEBUG] plugin: plugin process exited: path=.terraform/providers/registry.terraform.io/ciscodevnet/intersight/0.1.1/darwin_amd64/terraform-provider-intersight_v0.1.1 pid=43043 error="exit status 2" 2020/12/17 21:24:26 [TRACE] statemgr.Filesystem: not making a backup, because the new snapshot is identical to the old 2020/12/17 21:24:26 [TRACE] statemgr.Filesystem: no state changes since last snapshot 2020/12/17 21:24:26 [TRACE] statemgr.Filesystem: writing snapshot at terraform.tfstate 2020/12/17 21:24:26 [TRACE] statemgr.Filesystem: removing lock metadata file .terraform.tfstate.lock.info 2020/12/17 21:24:26 [TRACE] statemgr.Filesystem: unlocking terraform.tfstate using fcntl flock 2020-12-17T21:24:26.081-0800 [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 Terraform1 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.

SECURITY WARNING: the "crash.log" file that was created may contain sensitive information that must be redacted before it is safe to share on the issue tracker.

!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!

code-lucidal58 commented 3 years ago
2020-12-17T21:24:26.040-0800 [DEBUG] plugin.terraform-provider-intersight_v0.1.1: created by google.golang.org/grpc.(*Server).serveStreams.func1
2020-12-17T21:24:26.040-0800 [DEBUG] plugin.terraform-provider-intersight_v0.1.1: google.golang.org/grpc@v1.23.0/server.go:708 +0xa1
2020/12/17 21:24:26 [DEBUG] intersight_firmware_upgrade.edge1: apply errored, but we're indicating that via the Error pointer rather than returning it: rpc error: code = Unavailable desc = transport is closing
2020/12/17 21:24:26 [DEBUG] intersight_firmware_upgrade.edge[0]: apply errored, but we're indicating that via the Error pointer rather than returning it: rpc error: code = Unavailable desc = transport is closing
2020/12/17 21:24:26 [DEBUG] intersight_firmware_upgrade.edge[2]: apply errored, but we're indicating that via the Error pointer rather than returning it: rpc error: code = Unavailable desc = transport is closing
2020/12/17 21:24:26 [DEBUG] intersight_firmware_upgrade.edge[3]: apply errored, but we're indicating that via the Error pointer rather than returning it: rpc error: code = Unavailable desc = transport is closing

Looks like the error occurred while establishing a connection with the server. There is a possibility that incorrect or expired values are used in endpoint, apikey and secretkeyfile in provide{} block. If the values provided are correct, please share the terraform configuration you were applying.

huich0 commented 3 years ago

Hi Aanisha,

The keys are correct. I can login to Inetrsight.

Here are the config that caused the crash:

data "intersight_compute_physical_summary" "edge_server" { count = length(var.server_names) name = var.server_names[count.index] }

output "server_moids" { value = data.intersight_compute_physical_summary.edge_server.*.moid }

resource "intersight_firmware_upgrade" "edge" { count = length(var.server_names)

server { object_type = "compute.RackUnit" moid = data.intersight_compute_physical_summary.edge_server[count.index].moid }

upgrade_type = "network_upgrade"

network_share { map_type = "www" /* nfs_server { remote_ip = var.remote-server remote_share = var.remote-share remote_file = var.remote-huu }

cifs_server {
    remote_ip = var.remote-server
    remote_share = var.remote-share
    remote_file = var.remote-huu
}

*/ http_server { location_link = "http://10.29.145.231/images/ucs-c220m5-huu-4.1.2b.iso" } } }

Thanks,

Hui

From: Aanisha Mishra notifications@github.com Reply-To: CiscoDevNet/terraform-provider-intersight reply@reply.github.com Date: Friday, December 18, 2020 at 10:37 AM To: CiscoDevNet/terraform-provider-intersight terraform-provider-intersight@noreply.github.com Cc: Hui C huich@cisco.com, Author author@noreply.github.com Subject: Re: [CiscoDevNet/terraform-provider-intersight] TERRAFORM CRASH (#19)

2020-12-17T21:24:26.040-0800 [DEBUG] plugin.terraform-provider-intersight_v0.1.1: created by google.golang.org/grpc.(*Server).serveStreams.func1

2020-12-17T21:24:26.040-0800 [DEBUG] plugin.terraform-provider-intersight_v0.1.1: google.golang.org/grpc@v1.23.0/server.go:708 +0xa1

2020/12/17 21:24:26 [DEBUG] intersight_firmware_upgrade.edge1: apply errored, but we're indicating that via the Error pointer rather than returning it: rpc error: code = Unavailable desc = transport is closing

2020/12/17 21:24:26 [DEBUG] intersight_firmware_upgrade.edge[0]: apply errored, but we're indicating that via the Error pointer rather than returning it: rpc error: code = Unavailable desc = transport is closing

2020/12/17 21:24:26 [DEBUG] intersight_firmware_upgrade.edge[2]: apply errored, but we're indicating that via the Error pointer rather than returning it: rpc error: code = Unavailable desc = transport is closing

2020/12/17 21:24:26 [DEBUG] intersight_firmware_upgrade.edge[3]: apply errored, but we're indicating that via the Error pointer rather than returning it: rpc error: code = Unavailable desc = transport is closing

Looks like the error occurred while establishing a connection with the server. There is a possibility that incorrect or expired values are used in endpoint, apikey and secretkeyfile in provide{} block. If the values provided are correct, please share the terraform configuration you were applying.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/CiscoDevNet/terraform-provider-intersight/issues/19#issuecomment-748250335, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AMOXGIMSTDSVIM5X7J37ARTSVOOPDANCNFSM4VBNQ6PA.

code-lucidal58 commented 3 years ago

This issue is fixed in 0.1.2