Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terraform panic: runtime error: index out of range #56

Closed
hashibot opened this issue Jun 13, 2017 · 3 comments
Closed

Terraform panic: runtime error: index out of range #56

hashibot opened this issue Jun 13, 2017 · 3 comments
Labels
bug Type: Bug crash Impact: Crash

Comments

@hashibot
Copy link

This issue was originally opened by @Dinomoe as hashicorp/terraform#9495. It was migrated here as part of the provider split. The original body of the issue is below.


Hello Newb Here,

When running a terraform plan I receive a !!! TERRAFORM CRASH !!!

Troubleshooting:

  1. Upgraded to most recent version
  2. Restarted host
  3. It appears if I remove the terraform.tfsate file I can successfully run terraform plan

Original version Terraform v0.7.3
Upgraded to Terraform v0.7.7

2016/10/20 14:47:36 [DEBUG] plugin: terraform: panic: runtime error: index out of range
2016/10/20 14:47:36 [DEBUG] plugin: terraform:
2016/10/20 14:47:36 [DEBUG] plugin: terraform: goroutine 45 [running]:
2016/10/20 14:47:36 [DEBUG] plugin: terraform: panic(0x28c59c0, 0xc42000e0c0)
2016/10/20 14:47:36 [DEBUG] plugin: terraform:  /opt/go/src/runtime/panic.go:500 +0x1a1
less crash.log |grep ERROR
2016/10/20 13:55:31 [ERROR] root.vsphere-dc: eval: *terraform.EvalRefresh, err: vsphere_virtual_machine.mi-edge-nodes: unexpected EOF
2016/10/20 13:55:31 [ERROR] root.vsphere-dc: eval: *terraform.EvalSequence, err: vsphere_virtual_machine.mi-edge-nodes: unexpected EOF
2016/10/20 13:55:31 [ERROR] root.vsphere-dc: eval: *terraform.EvalOpFilter, err: vsphere_virtual_machine.mi-edge-nodes: unexpected EOF
2016/10/20 13:55:31 [ERROR] root.vsphere-dc: eval: *terraform.EvalSequence, err: vsphere_virtual_machine.mi-edge-nodes: unexpected EOF
2016/10/20 13:55:31 [ERROR] root.vsphere-dc: eval: *terraform.EvalRefresh, err: vsphere_virtual_machine.mi-control-nodes: unexpected EOF
2016/10/20 13:55:31 [ERROR] root.vsphere-dc: eval: *terraform.EvalSequence, err: vsphere_virtual_machine.mi-control-nodes: unexpected EOF
2016/10/20 13:55:31 [ERROR] root.vsphere-dc: eval: *terraform.EvalOpFilter, err: vsphere_virtual_machine.mi-control-nodes: unexpected EOF
2016/10/20 13:55:31 [ERROR] root.vsphere-dc: eval: *terraform.EvalSequence, err: vsphere_virtual_machine.mi-control-nodes: unexpected EOF
2016/10/20 13:55:31 [ERROR] root.vsphere-dc: eval: *terraform.EvalRefresh, err: vsphere_virtual_machine.mi-worker-nodes.0: unexpected EOF
2016/10/20 13:55:31 [ERROR] root.vsphere-dc: eval: *terraform.EvalSequence, err: vsphere_virtual_machine.mi-worker-nodes.0: unexpected EOF
2016/10/20 13:55:31 [ERROR] root.vsphere-dc: eval: *terraform.EvalOpFilter, err: vsphere_virtual_machine.mi-worker-nodes.0: unexpected EOF
2016/10/20 13:55:31 [ERROR] root.vsphere-dc: eval: *terraform.EvalSequence, err: vsphere_virtual_machine.mi-worker-nodes.0: unexpected EOF
2016/10/20 13:55:31 [ERROR] root.vsphere-dc: eval: *terraform.EvalRefresh, err: vsphere_virtual_machine.mi-kubeworker-nodes: unexpected EOF
2016/10/20 13:55:31 [ERROR] root.vsphere-dc: eval: *terraform.EvalSequence, err: vsphere_virtual_machine.mi-kubeworker-nodes: unexpected EOF
2016/10/20 13:55:31 [ERROR] root.vsphere-dc: eval: *terraform.EvalOpFilter, err: vsphere_virtual_machine.mi-kubeworker-nodes: unexpected EOF
2016/10/20 13:55:31 [ERROR] root.vsphere-dc: eval: *terraform.EvalSequence, err: vsphere_virtual_machine.mi-kubeworker-nodes: unexpected EOF

Deploying to vSphere Resources
vsphere_virtual_machine.mi-edge-nodes
vsphere_virtual_machine.mi-control-nodes
vsphere_virtual_machine.mi-worker-nodes
vsphere_virtual_machine.mi-kubeworker-nodes

Terraform Configuration Files

vsphere.tf
https://gist.github.com/Dinomoe/73c7d70abb6127e81f773aa47c17a916

main.tf
https://gist.github.com/Dinomoe/16916ec517d67913a682e3d1124e7a2d

Debug Output

https://gist.github.com/Dinomoe/0d793c170525917eb6c8df8d5137e0ce

Panic Output

https://gist.github.com/Dinomoe/118221eb94fe3bb4180015e418772240

terraform.tfstate Output

https://gist.github.com/Dinomoe/b345aca90047c68805496263a019c166

Expected Behavior

What should have happened? Terraform Plan output expected.

Actual Behavior

What actually happened? Terraform Crash

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform plan
@hashibot hashibot added bug Type: Bug crash Impact: Crash labels Jun 13, 2017
@bamb00
Copy link

bamb00 commented Jul 8, 2017

Looks like this issue was open in October 2016. Will this issue be address? Is there a workaround?

@vancluever
Copy link
Contributor

Hello!

Looking at the crash logs, and judging from the nature of the issue, I think this should be fixed now that #129 has been merged. If there is anyone watching this issue that has the capabilities to build a custom provider binary can give it a go, that'd be great.

If course, if this does not fix this issue specifically, please open a new issue and reference this one.

Thanks again and sorry for the delays!

@Mihai-CMM
Copy link

Hi guys,
This is yet not fixed in 11.2 with Openstack provider
crash.log

panic: runtime error: index out of range
2018-01-25T15:24:28.251+0200 [DEBUG] plugin.terraform-provider-openstack_v1.2.0_x4:
2018-01-25T15:24:28.251+0200 [DEBUG] plugin.terraform-provider-openstack_v1.2.0_x4: goroutine 574 [running]:
2018-01-25T15:24:28.251+0200 [DEBUG] plugin.terraform-provider-openstack_v1.2.0_x4: github.com/terraform-providers/terraform-provider-openstack/openstack.flattenInstanceNetworks(0xc4201398f0, 0xcd2340, 0xc4205a7b00, 0xbd8f00, 0xc4202e0fb0, 0x0, 0x0, 0x0)
2018-01-25T15:24:28.252+0200 [DEBUG] plugin.terraform-provider-openstack_v1.2.0_x4: /opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/terraform-providers/terraform-provider-openstack/openstack/compute_instance_v2_networking.go:432 +0x13d7
2018-01-25T15:24:28.252+0200 [DEBUG] plugin.terraform-provider-openstack_v1.2.0_x4: github.com/terraform-providers/terraform-provider-openstack/openstack.resourceComputeInstanceV2Read(0xc4201398f0, 0xcd2340, 0xc4205a7b00, 0x0, 0x0)
2018-01-25T15:24:28.252+0200 [DEBUG] plugin.terraform-provider-openstack_v1.2.0_x4: /opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/terraform-providers/terraform-provider-openstack/openstack/resource_openstack_compute_instance_v2.go:491 +0x3a0
2018-01-25T15:24:28.252+0200 [DEBUG] plugin.terraform-provider-openstack_v1.2.0_x4: github.com/terraform-providers/terraform-provider-openstack/openstack.resourceComputeInstanceV2Create(0xc4201398f0, 0xcd2340, 0xc4205a7b00, 0x0, 0xc4204c4748)
2018-01-25T15:24:28.252+0200 [DEBUG] plugin.terraform-provider-openstack_v1.2.0_x4: /opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/terraform-providers/terraform-provider-openstack/openstack/resource_openstack_compute_instance_v2.go:471 +0xf3d
2018-01-25T15:24:28.252+0200 [DEBUG] plugin.terraform-provider-openstack_v1.2.0_x4: github.com/terraform-providers/terraform-provider-openstack/vendor/github.com/hashicorp/terraform/helper/schema.(*Resource).Apply(0xc420254840, 0xc420587590, 0xc42031a340, 0xcd2340, 0xc4205a7b00, 0x1, 0xc420278d80, 0xc420278d80)
2018-01-25T15:24:28.252+0200 [DEBUG] plugin.terraform-provider-openstack_v1.2.0_x4: /opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/terraform-providers/terraform-provider-openstack/vendor/github.com/hashicorp/terraform/helper/schema/resource.go:193 +0x3b6
2018-01-25T15:24:28.253+0200 [DEBUG] plugin.terraform-provider-openstack_v1.2.0_x4: github.com/terraform-providers/terraform-provider-openstack/vendor/github.com/hashicorp/terraform/helper/schema.(*Provider).Apply(0xc420138700, 0xc420587540, 0xc420587590, 0xc42031a340, 0x7ffae018d000, 0x0, 0x2b9)
2018-01-25T15:24:28.253+0200 [DEBUG] plugin.terraform-provider-openstack_v1.2.0_x4: /opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/terraform-providers/terraform-provider-openstack/vendor/github.com/hashicorp/terraform/helper/schema/provider.go:259 +0xa4
2018-01-25T15:24:28.253+0200 [DEBUG] plugin.terraform-provider-openstack_v1.2.0_x4: github.com/terraform-providers/terraform-provider-openstack/vendor/github.com/hashicorp/terraform/plugin.(*ResourceProviderServer).Apply(0xc4203aa200, 0xc42031a2a0, 0xc42033ef00, 0x0, 0x0)
2018-01-25T15:24:28.253+0200 [DEBUG] plugin.terraform-provider-openstack_v1.2.0_x4: /opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/terraform-providers/terraform-provider-openstack/vendor/github.com/hashicorp/terraform/plugin/resource_provider.go:488 +0x57
2018-01-25T15:24:28.253+0200 [DEBUG] plugin.terraform-provider-openstack_v1.2.0_x4: reflect.Value.call(0xc42021b9e0, 0xc42000d160, 0x13, 0xd17f7d, 0x4, 0xc4203f0f20, 0x3, 0x3, 0x0, 0xc42056a380, ...)
2018-01-25T15:24:28.253+0200 [DEBUG] plugin.terraform-provider-openstack_v1.2.0_x4: /usr/local/go/src/reflect/value.go:434 +0x905
2018-01-25T15:24:28.253+0200 [DEBUG] plugin.terraform-provider-openstack_v1.2.0_x4: reflect.Value.Call(0xc42021b9e0, 0xc42000d160, 0x13, 0xc4205a1f20, 0x3, 0x3, 0xc4205a1f20, 0xc4205a1f28, 0xc4204b3580)
2018-01-25T15:24:28.253+0200 [DEBUG] plugin.terraform-provider-openstack_v1.2.0_x4: /usr/local/go/src/reflect/value.go:302 +0xa4
2018-01-25T15:24:28.254+0200 [DEBUG] plugin.terraform-provider-openstack_v1.2.0_x4: net/rpc.(*service).call(0xc42046f440, 0xc4204112c0, 0xc420412590, 0xc420070400, 0xc4203aa820, 0xbb75a0, 0xc42031a2a0, 0x16, 0xbb75e0, 0xc42033ef00, ...)
2018-01-25T15:24:28.254+0200 [DEBUG] plugin.terraform-provider-openstack_v1.2.0_x4: /usr/local/go/src/net/rpc/server.go:381 +0x142
2018-01-25T15:24:28.254+0200 [DEBUG] plugin.terraform-provider-openstack_v1.2.0_x4: created by net/rpc.(*Server).ServeCodec
2018-01-25T15:24:28.254+0200 [DEBUG] plugin.terraform-provider-openstack_v1.2.0_x4: /usr/local/go/src/net/rpc/server.go:475 +0x36b
2018/01/25 15:24:28 [TRACE] root.gw_pub: eval: *terraform.EvalWriteState
2018/01/25 15:24:28 [TRACE] root.gw_pub: eval: *terraform.EvalApplyProvisioners
2018/01/25 15:24:28 [TRACE] root.gw_pub: eval: *terraform.EvalIf
2018/01/25 15:24:28 [TRACE] root.gw_pub: eval: *terraform.EvalWriteState
2018/01/25 15:24:28 [TRACE] root.gw_pub: eval: *terraform.EvalWriteDiff
2018/01/25 15:24:28 [TRACE] root.gw_pub: eval: *terraform.EvalApplyPost
2018/01/25 15:24:28 [ERROR] root.gw_pub: eval: *terraform.EvalApplyPost, err: 1 error(s) occurred:

  • openstack_compute_instance_v2.instance.0: unexpected EOF
    2018/01/25 15:24:28 [ERROR] root.gw_pub: eval: *terraform.EvalSequence, err: 1 error(s) occurred:

  • openstack_compute_instance_v2.instance.0: unexpected EOF
    2018/01/25 15:24:28 [TRACE] [walkApply] Exiting eval tree: module.gw_pub.openstack_compute_instance_v2.instance[0]
    2018/01/25 15:24:28 [TRACE] root.gw_pub: eval: *terraform.EvalWriteState
    2018/01/25 15:24:28 [TRACE] root.gw_pub: eval: *terraform.EvalApplyProvisioners
    2018/01/25 15:24:28 [TRACE] root.gw_pub: eval: *terraform.EvalIf
    2018/01/25 15:24:28 [TRACE] root.gw_pub: eval: *terraform.EvalWriteState
    2018/01/25 15:24:28 [TRACE] root.gw_pub: eval: *terraform.EvalWriteDiff
    2018/01/25 15:24:28 [TRACE] root.gw_pub: eval: *terraform.EvalApplyPost
    2018/01/25 15:24:28 [ERROR] root.gw_pub: eval: *terraform.EvalApplyPost, err: 1 error(s) occurred:

  • openstack_compute_instance_v2.instance.1: unexpected EOF
    2018/01/25 15:24:28 [ERROR] root.gw_pub: eval: *terraform.EvalSequence, err: 1 error(s) occurred:

  • openstack_compute_instance_v2.instance.1: unexpected EOF
    2018/01/25 15:24:28 [TRACE] [walkApply] Exiting eval tree: module.gw_pub.openstack_compute_instance_v2.instance1
    2018/01/25 15:24:28 [TRACE] dag/walk: upstream errored, not walking "module.gw_pub.output.name_list"
    2018/01/25 15:24:28 [TRACE] root.bastion: eval: *terraform.EvalWriteState
    2018/01/25 15:24:28 [TRACE] root.bastion: eval: *terraform.EvalApplyProvisioners
    2018/01/25 15:24:28 [TRACE] root.bastion: eval: *terraform.EvalIf
    2018/01/25 15:24:28 [TRACE] root.bastion: eval: *terraform.EvalWriteState
    2018/01/25 15:24:28 [TRACE] root.bastion: eval: *terraform.EvalWriteDiff
    2018/01/25 15:24:28 [TRACE] root.bastion: eval: *terraform.EvalApplyPost
    2018/01/25 15:24:28 [ERROR] root.bastion: eval: *terraform.EvalApplyPost, err: 1 error(s) occurred:

  • openstack_compute_instance_v2.instance: unexpected EOF
    2018/01/25 15:24:28 [ERROR] root.bastion: eval: *terraform.EvalSequence, err: 1 error(s) occurred:

  • openstack_compute_instance_v2.instance: unexpected EOF
    2018/01/25 15:24:28 [TRACE] [walkApply] Exiting eval tree: module.bastion.openstack_compute_instance_v2.instance
    2018/01/25 15:24:28 [TRACE] dag/walk: upstream errored, not walking "module.bastion.output.ip_list_net_2"
    2018/01/25 15:24:28 [TRACE] dag/walk: upstream errored, not walking "module.gw_pub.output.ip_list_net_1"
    2018/01/25 15:24:28 [TRACE] dag/walk: upstream errored, not walking "module.gw_pub.output.ip_list_net_0"
    2018/01/25 15:24:28 [TRACE] dag/walk: upstream errored, not walking "module.attach_fip_gw.var.fixed_ip"
    2018/01/25 15:24:28 [TRACE] dag/walk: upstream errored, not walking "module.gw_pub.output.id_list"
    2018/01/25 15:24:28 [TRACE] dag/walk: upstream errored, not walking "module.attach_fip_gw.var.instance_list"
    2018/01/25 15:24:28 [TRACE] dag/walk: upstream errored, not walking "module.attach_fip_gw.openstack_compute_floatingip_associate_v2.attach_fip1"
    2018/01/25 15:24:28 [TRACE] dag/walk: upstream errored, not walking "module.bastion.output.id_list"
    2018/01/25 15:24:28 [TRACE] dag/walk: upstream errored, not walking "module.attach_fip_bastion.var.instance_list"
    2018/01/25 15:24:28 [TRACE] dag/walk: upstream errored, not walking "module.bastion.output.ip_list_net_0"
    2018/01/25 15:24:28 [TRACE] dag/walk: upstream errored, not walking "module.attach_fip_bastion.var.fixed_ip"
    2018/01/25 15:24:28 [TRACE] dag/walk: upstream errored, not walking "module.attach_fip_bastion.openstack_compute_floatingip_associate_v2.attach_fip"
    2018/01/25 15:24:28 [TRACE] dag/walk: upstream errored, not walking "module.bastion.output.ip_list_net_1"
    2018/01/25 15:24:28 [TRACE] dag/walk: upstream errored, not walking "module.bastion.output.name_list"
    2018/01/25 15:24:28 [TRACE] dag/walk: upstream errored, not walking "module.attach_fip_gw.openstack_compute_floatingip_associate_v2.attach_fip[0]"
    2018/01/25 15:24:28 [TRACE] dag/walk: upstream errored, not walking "module.attach_bastion.var.instance_list"
    2018/01/25 15:24:28 [TRACE] dag/walk: upstream errored, not walking "module.attach_bastion.openstack_compute_volume_attach_v2.attach_cinder"
    2018/01/25 15:24:28 [TRACE] dag/walk: upstream errored, not walking "provider.openstack (close)"
    2018/01/25 15:24:28 [TRACE] dag/walk: upstream errored, not walking "meta.count-boundary (count boundary fixup)"
    2018/01/25 15:24:28 [TRACE] dag/walk: upstream errored, not walking "root"
    2018/01/25 15:24:28 [TRACE] Preserving existing state lineage "b3835b37-c2c1-45d5-863e-09cf9f40e517"
    2018-01-25T15:24:28.268+0200 [DEBUG] plugin: plugin process exited: path=/home/mircea1costache/Proiecte/apollo/terraform/.terraform/plugins/linux_amd64/terraform-provider-openstack_v1.2.0_x4
    2018/01/25 15:24:28 [DEBUG] plugin: waiting for all plugin processes to complete...
    2018-01-25T15:24:28.316+0200 [WARN ] plugin: error closing client during Kill: err="connection is shut down"
    2018-01-25T15:24:28.318+0200 [DEBUG] plugin: plugin process exited: path=/home/mircea1costache/Proiecte/apollo/terraform/.terraform/plugins/linux_amd64/terraform-provider-template_v1.0.0_x4

!!!!!!!!!!!!!!!!!!!!!!!!!!! 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.

!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!
crash.log

[root@localhost terraform]# terraform11.2 --version
Terraform v0.11.2

  • provider.openstack v1.2.0
  • provider.template v1.0.0

@ghost ghost locked and limited conversation to collaborators Apr 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Type: Bug crash Impact: Crash
Projects
None yet
Development

No branches or pull requests

4 participants